diff --git a/CMakeLists.txt b/CMakeLists.txt index dd4c81bd24..cec2bc9fa4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,6 +260,17 @@ if( yaml-cpp_FOUND INTERFACE_INCLUDE_DIRECTORIES "${YAML_CPP_INCLUDE_DIR}" ) endif() +# Workaround to fix a problem with the imported target name +# The target name includes the namespace yaml-cpp begining +# from version 0.8.0. So the new exported target is now +# yaml-cpp::yaml-cpp. +if(yaml-cpp_FOUND) + if(TARGET yaml-cpp::yaml-cpp) + set(YAMLCPPLIB yaml-cpp::yaml-cpp) + else() + set(YAMLCPPLIB yaml-cpp) + endif() +endif() configure_file(${CMAKE_SOURCE_DIR}/cmake/private/FairRootConfigVersion.cmake.in "${CMAKE_BINARY_DIR}/FairRootConfigVersion.cmake" @ONLY) diff --git a/fairtools/MCConfigurator/CMakeLists.txt b/fairtools/MCConfigurator/CMakeLists.txt index 46d60475a1..508e4a7499 100644 --- a/fairtools/MCConfigurator/CMakeLists.txt +++ b/fairtools/MCConfigurator/CMakeLists.txt @@ -30,7 +30,7 @@ target_include_directories(${target} SYSTEM PUBLIC target_link_libraries(${target} PUBLIC FairRoot::Base # FairGenericVMCConfig - yaml-cpp + ${YAMLCPPLIB} PRIVATE FairRoot::Tools