Conversation
|
Looks similar to what I'm achieving here #176 |
|
I'd happily use your commit when it gets merged. This one is the minimalist version to get it to run. |
|
Well I believe I understand. They need to check if it works because I'm barely providing any proof nor tests. Moreover, I've been using Windows to make the changes and test them. I cannot guarantee it works on Linux. There could also be an issue related to naming and standardization. For example, should a given directory be called "geometrycentral", or "geometry-central"? EDIT: Also, it would be a breaking change, bumping the version to 1. They may not want that now. |
|
Hi all, thanks for your effort on this (combining discussion here and in #176 since they both concern similar changes). I'm happy to merge changes to support exported targets/installation, although I don't know much about setting this up in CMake so it's tough for me to tell what changes are reasonable. Can you point to any places in the CMake docs that suggest this kind of a setup? Or other established projects which you a similar system? RE versioning, would it be easier if we recorded a version string somewhere in the project rather than attempting to read it from a git tag? I am used to having to do this in other project, and it's not the end of the world to need to bump the version in two places. |
Add exported targets to make it easier to link against geometry-central.
Projects can then simply use
find_package(geometry-central)to link against it and configure the location using
geometry-central_DIR, which will also be automatically detected if geometry-central is installed in$CMAKE_PREFIX_PATH.I also added the version (from the latest tag) to the CMakeLists.txt so that projects can require a specific version.
The targets should probably be handled by
${GC_DEP_LIBS}, but that causes a mismatch between theeigenandEigen3::Eigentargets, and I do not want to change too much in your CMakeFiles.txt files. Possibly these dependencies could also be private in case that geometry-central links them statically.