Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cmake exported targets #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

aschier
Copy link

@aschier aschier commented Jan 14, 2025

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 the eigen and Eigen3::Eigen targets, 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.

@hollowsunhc
Copy link

Looks similar to what I'm achieving here #176

@aschier
Copy link
Author

aschier commented Jan 15, 2025

I'd happily use your commit when it gets merged. This one is the minimalist version to get it to run.
What do the maintainers think? There is little news on the other pull request as well.

@hollowsunhc
Copy link

hollowsunhc commented Jan 15, 2025

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"? find_package(geometrycentral) or find_package(geometry-central)? Ultimately, it's up to them to decide what they want. I'm just here providing some logic that worked for me 😄

EDIT: Also, it would be a breaking change, bumping the version to 1. They may not want that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants