Hello, I am trying to link LibTorch to a C++ codebase that uses Gradle as its build system. Unfortunately, it appears that the vast majority of documentation covers adding LibTorch to a CMake project, not Gradle, and I am running into issues linking the library.
My issue primarily stems from including the headers (even when using the pre-built variant). From the repository we have:
It seems that there are two include directories for LibTorch, one of which is inside the other one. This poses issues for me when I try to provide the
headers.srcDir because it appears to only accept one option for a folder path where it can look for the headers.
If I simply copy the headers over to
/usr/local/include and provide that path to Gradle, then I am informed it cannot find the inner one. I tried several roundabout ways of doing this, but any time I run into issues where it either (a) cannot find the inner folder, (b) cannot find the outer folder, or (c) states that there are duplicate declarations for overlapping files.
Hence, I am wondering if anyone has an example of integrating it with a Gradle C++ project (or another build tool), possible workarounds, or any suggestions on how to deal with the two nested include folders. Thank you!