diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e13bd5..5906f7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ ament_add_default_options() # NO_CMAKE_PACKAGE_REGISTRY used to avoid finding the library downloaded in WORKSPACE B # when building workspace A. # This should only find a system installed yaml-cpp and thus the environment hook isn't needed. -find_package(yaml-cpp QUIET NO_CMAKE_PACKAGE_REGISTRY) +find_package(yaml-cpp 0.8.0 QUIET NO_CMAKE_PACKAGE_REGISTRY) set(YAML_CPP_CXX_FLAGS "${CMAKE_CXX_FLAGS}") if(MSVC) @@ -19,8 +19,8 @@ endif() ament_vendor(yaml_cpp_vendor SATISFIED ${yaml-cpp_FOUND} VCS_URL https://github.com/jbeder/yaml-cpp.git - VCS_VERSION yaml-cpp-0.7.0 - PATCHES patches + VCS_VERSION 0.8.0 + GLOBAL_HOOK CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${YAML_CPP_CXX_FLAGS}" -DYAML_CPP_BUILD_CONTRIB:BOOL=OFF diff --git a/patches/0001-disable-shadow-warning.patch b/patches/0001-disable-shadow-warning.patch deleted file mode 100644 index 7b6debb..0000000 --- a/patches/0001-disable-shadow-warning.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/CMakeLists.txt 2023-12-01 16:47:18.388383723 +0000 -+++ b/CMakeLists.txt 2023-12-01 16:47:23.630353853 +0000 -@@ -93,7 +93,7 @@ endif() - - target_compile_options(yaml-cpp - PRIVATE -- $<${not-msvc}:-Wall -Wextra -Wshadow -Weffc++ -Wno-long-long> -+ $<${not-msvc}:-Wall -Wextra -Weffc++ -Wno-long-long> - $<${not-msvc}:-pedantic -pedantic-errors> - - $<$:-MTd> diff --git a/yaml_cpp_vendor-extras.cmake.in b/yaml_cpp_vendor-extras.cmake.in index d3bf920..2c09e7c 100644 --- a/yaml_cpp_vendor-extras.cmake.in +++ b/yaml_cpp_vendor-extras.cmake.in @@ -5,21 +5,3 @@ else() set(yaml-cpp_DIR "${@PROJECT_NAME@_DIR}/../../../opt/yaml_cpp_vendor/share/cmake/yaml-cpp") endif() message(STATUS "Setting yaml-cpp_DIR to: '${yaml-cpp_DIR}'") - -find_package(yaml-cpp REQUIRED) - -set(yaml_cpp_vendor_LIBRARIES ${YAML_CPP_LIBRARIES}) -set(yaml_cpp_vendor_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR}) - -# since yaml-cpp 0.8.0, yaml-cpp supports the yaml-cpp::yaml-cpp target -if(TARGET yaml-cpp::yaml-cpp) - list(APPEND yaml_cpp_vendor_TARGETS yaml-cpp::yaml-cpp) -else() - list(APPEND yaml_cpp_vendor_TARGETS yaml-cpp) - if(WIN32) - # On Windows, yaml-cpp 0.7.0 requires that downstream consumers set YAML_CPP_DLL and - # not yaml_cpp_EXPORT in order to set dllimport properly. - # This behavior will likely change in future versions of yaml-cpp. - set_target_properties(yaml-cpp PROPERTIES INTERFACE_COMPILE_DEFINITIONS YAML_CPP_DLL) - endif() -endif()