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

exported CONFIG.cmake problems #106

Open
KrisThielemans opened this issue Dec 21, 2023 · 0 comments
Open

exported CONFIG.cmake problems #106

KrisThielemans opened this issue Dec 21, 2023 · 0 comments

Comments

@KrisThielemans
Copy link
Contributor

Using NIFTYREG_LIBRARIES fails as these are just the names of the libraries, not absolute paths, and their dependencies are not exported.
We currently work around this as in https://github.com/SyneRBI/SIRF/blob/master/src/CMakeLists.txt#L53-L71

I believe this needs

install(TARGETS somelib EXPORT NIFTYREGTargets 
   RUNTIME_DESTINATION ...)

for every library, and in cmake/CMakeLists.txt

install(EXPORT NIFTYREGTargets DESTINATION "${ConfigPackageLocation}")

Also, as opposed to doing

niftyreg/CMakeLists.txt

Lines 173 to 174 in 6db8b16

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

It is now recommended to depend on OpenMP::OpenMP_C (or OpenMP::OpenMP_CXX). Linking and includes will then be automatically ok. Similar stuff for CUDA I guess.

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

No branches or pull requests

1 participant