Closed yurivict closed 4 years ago
Because this is a header only library, if you do not built examples or unit tests, then you have nothing to build. Just include the path to the Ascent "include" directory in your project and use the files directly.
It doesn't install anything. Even a headers-only library needs to install headers.
I'm not sure your use case, but usually it is your project's CMake file that will have a line like: include_directories(../Ascent/include)
This will then allow you to use the Ascent headers in your project. You could also go into your IDE's properties and include the folder.
For packaging it's optimal to have cmake install the headers into a standard location. See for example, Eigen3.
I could certainly add something like that. But, it is simply creating another copy of the files and requiring the use of calling CMake whenever the repository is pulled. I tend to find it a better practice to clone repositories to common locations or locations specific to a project, in this way there is no need to run CMake with updates and the files aren't duplicated. How important to your process is the specification of an install path?
cmake has a standard instruction for installing files. See here, for example: https://stackoverflow.com/questions/10487256/cmake-how-to-properly-copy-static-librarys-header-file-into-usr-include
This issue hasn't been properly resolved.
usually it is your project's CMake file that will have a line like: include_directories(../Ascent/include)
The above isn't true. In order to properly create a package the project needs to install its files.
In your case, installing means copying files into ${DESTDIR}${PREFIX}/include/...
cmake has instructions for this.
Pull request #7 should fix this issue.
If it is accepted you should be able install ascent and use it like this:
find_package(ascent REQUIRED)
...Other stuff...
target_link_libraries(${PROJECT_NAME} ascent::ascent)
With BUILD_EXAMPLES=OFF BUILD_UNIT_TESTS=OFF I am getting