Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to yaml-cpp 0.7.0 #25

Merged
merged 2 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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}")

Expand All @@ -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}
Expand All @@ -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)
clalancette marked this conversation as resolved.
Show resolved Hide resolved
if(FORCE_BUILD_VENDOR_PKG OR NOT yaml-cpp_FOUND)
build_yaml_cpp()

Expand Down
4 changes: 2 additions & 2 deletions yaml_cpp_vendor-extras.cmake.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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
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")
clalancette marked this conversation as resolved.
Show resolved Hide resolved
endif()
message(STATUS "Setting yaml-cpp_DIR to: '${yaml-cpp_DIR}'")

Expand Down