Skip to content

exported CONFIG.cmake problems #106

@KrisThielemans

Description

@KrisThielemans

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions