You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current version does not properly find yaml-cpp when using CMake config files.
When dependencies are found by config instead by module (Find.cmake) the typical variables are not necessarily set. Instead specifying link libraries are done by imported targets.
Here's a minimal patch used to build on Fedora Rawhide:
Index: dcm2niix-1.0.20220720/console/CMakeLists.txt
===================================================================
--- dcm2niix-1.0.20220720.orig/console/CMakeLists.txt
+++ dcm2niix-1.0.20220720/console/CMakeLists.txt
@@ -210,7 +210,13 @@ if(BATCH_VERSION)
set(YAML-CPP_DIR ${YAML-CPP_DIR} CACHE PATH "Path to yaml-cpp configuration file" FORCE)
find_package(YAML-CPP REQUIRED)
- target_include_directories(dcm2niibatch PRIVATE ${YAML_CPP_INCLUDE_DIR})
+ if(YAML-CPP_FOUND AND NOT YAML_CPP_LIBRARIES)
+ # Assume yaml was found by config instead of by moudle
+ set(YAML_CPP_LIBRARIES yaml-cpp)
+ endif()
+ if(YAML_CPP_INCLUDE_DIR)
+ target_include_directories(dcm2niibatch PRIVATE ${YAML_CPP_INCLUDE_DIR})
+ endif()
target_link_libraries(dcm2niibatch ${YAML_CPP_LIBRARIES})
if(ZLIB_FOUND)
Note: Since on Fedora the headers are installed into the default directory, YAML_CPP_INCLUDE_DIR = "" so we only need to add them to the target include directories if that's not the case.
The text was updated successfully, but these errors were encountered:
@hobbes1069 while we can workaround this by set YAML_CPP_LIBRARIES, I believe this is a bug in yaml-cpp-devel-0.7.0-1.fc38. The variable is not set properly in /usr/lib64/cmake/yaml-cpp/yaml-cpp-config.cmake. The issue only happens on Fedora Rawhide with yaml-cpp-devel-0.7.0-1.fc38 installed. Guess it will be fixed in the upstream soon.
ningfei
added a commit
to ningfei/dcm2niix
that referenced
this issue
Dec 18, 2022
Describe the bug
Current version does not properly find yaml-cpp when using CMake config files.
When dependencies are found by config instead by module (Find.cmake) the typical variables are not necessarily set. Instead specifying link libraries are done by imported targets.
Here's a minimal patch used to build on Fedora Rawhide:
Note: Since on Fedora the headers are installed into the default directory,
YAML_CPP_INCLUDE_DIR = ""
so we only need to add them to the target include directories if that's not the case.The text was updated successfully, but these errors were encountered: