From 33edbf9358bd8ef085487d8f90d39bb2a6167d26 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Fri, 22 Oct 2021 19:59:07 +0000 Subject: [PATCH 1/2] Upgrade to yaml-cpp 0.7.0 This includes a fix for macOS/Linux where newer yaml-cpp moved the cmake files from $prefix/opt/yaml_cpp_vendor/lib/cmake/yaml-cpp into $prefix/opt/yaml_cpp_vendor/share/cmake/yaml-cpp Signed-off-by: Chris Lalancette --- CMakeLists.txt | 19 +++++-------------- yaml_cpp_vendor-extras.cmake.in | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e0719f..1d8d85e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,8 +8,6 @@ option(FORCE_BUILD_VENDOR_PKG find_package(ament_cmake REQUIRED) -set(PACKAGE_VERSION "1.0.0") - macro(build_yaml_cpp) set(extra_cmake_args) @@ -24,9 +22,7 @@ macro(build_yaml_cpp) list(APPEND extra_cmake_args "-DYAML_CPP_BUILD_TESTS=OFF") list(APPEND extra_cmake_args "-DYAML_CPP_BUILD_TOOLS=OFF") list(APPEND extra_cmake_args "-DYAML_CPP_BUILD_CONTRIB=OFF") - list(APPEND extra_cmake_args "-DBUILD_SHARED_LIBS=ON") - list(APPEND extra_cmake_args "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}") - list(APPEND extra_cmake_args "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}") + list(APPEND extra_cmake_args "-DYAML_BUILD_SHARED_LIBS=ON") list(APPEND extra_cmake_args "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}") list(APPEND extra_cmake_args "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}") @@ -41,14 +37,9 @@ macro(build_yaml_cpp) endif() include(ExternalProject) - # This specific version (past the current latest release of 0.5.3) is required to make - # yaml-cpp relocatable, hopefully it is released again soon. - # See: https://github.com/jbeder/yaml-cpp/pull/538 - # Latest release fails to compile on recent visual studio (VS2017 v15.8.1) - # See: https://github.com/jbeder/yaml-cpp/pull/597 - ExternalProject_Add(yaml_cpp-0f9a586 - URL https://github.com/jbeder/yaml-cpp/archive/0f9a586ca1dc29c2ecb8dd715a315b93e3f40f79.zip - URL_MD5 ec76c27ebd07d5178cbe85b773df8e62 + ExternalProject_Add(yaml_cpp-0.7.0 + URL https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.7.0.tar.gz + URL_MD5 74d646a3cc1b5d519829441db96744f0 TIMEOUT 600 LOG_CONFIGURE ${should_log} LOG_BUILD ${should_log} @@ -71,7 +62,7 @@ endmacro() # 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 0.6 QUIET NO_CMAKE_PACKAGE_REGISTRY) +find_package(yaml-cpp QUIET NO_CMAKE_PACKAGE_REGISTRY) if(FORCE_BUILD_VENDOR_PKG OR NOT yaml-cpp_FOUND) build_yaml_cpp() diff --git a/yaml_cpp_vendor-extras.cmake.in b/yaml_cpp_vendor-extras.cmake.in index a09422d..dd99ce4 100644 --- a/yaml_cpp_vendor-extras.cmake.in +++ b/yaml_cpp_vendor-extras.cmake.in @@ -5,7 +5,7 @@ if(NOT yaml-cpp_FOUND) if(WIN32) set(yaml-cpp_DIR "${@PROJECT_NAME@_DIR}/../../../opt/yaml_cpp_vendor/CMake") else() - set(yaml-cpp_DIR "${@PROJECT_NAME@_DIR}/../../../opt/yaml_cpp_vendor/lib/cmake/yaml-cpp") + 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}'") From 0dc320d568db00863816b4124a6aff00a1984f1f Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Mon, 31 Jan 2022 18:11:30 +0000 Subject: [PATCH 2/2] Remove a specific version of yaml-cpp in the extras file. Signed-off-by: Chris Lalancette --- yaml_cpp_vendor-extras.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml_cpp_vendor-extras.cmake.in b/yaml_cpp_vendor-extras.cmake.in index dd99ce4..deac98c 100644 --- a/yaml_cpp_vendor-extras.cmake.in +++ b/yaml_cpp_vendor-extras.cmake.in @@ -1,4 +1,4 @@ -find_package(yaml-cpp 0.6 QUIET) +find_package(yaml-cpp QUIET) if(NOT yaml-cpp_FOUND) # add the local Modules directory to the modules path