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

Revert "Use system installed yaml-cpp 0.6 if available" #15

Merged
merged 1 commit into from
Aug 25, 2020
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
29 changes: 12 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,22 @@ macro(build_yaml_cpp)
)
endmacro()

find_package(yaml-cpp 0.6 QUIET)
if(NOT yaml-cpp_FOUND)
build_yaml_cpp()
build_yaml_cpp()

if(WIN32)
ament_environment_hooks(env_hook/yaml_cpp_vendor_library_path.bat)
set(ENV_VAR_NAME "PATH")
set(ENV_VAR_VALUE "opt\\yaml_cpp_vendor\\bin")
if(WIN32)
ament_environment_hooks(env_hook/yaml_cpp_vendor_library_path.bat)
set(ENV_VAR_NAME "PATH")
set(ENV_VAR_VALUE "opt\\yaml_cpp_vendor\\bin")
else()
ament_environment_hooks(env_hook/yaml_cpp_vendor_library_path.sh)
if(APPLE)
set(ENV_VAR_NAME "DYLD_LIBRARY_PATH")
else()
ament_environment_hooks(env_hook/yaml_cpp_vendor_library_path.sh)
if(APPLE)
set(ENV_VAR_NAME "DYLD_LIBRARY_PATH")
else()
set(ENV_VAR_NAME "LD_LIBRARY_PATH")
endif()
set(ENV_VAR_VALUE "opt/yaml_cpp_vendor/lib")
set(ENV_VAR_NAME "LD_LIBRARY_PATH")
endif()
ament_environment_hooks(env_hook/yaml_cpp_vendor_library_path.dsv.in)
else()
message(STATUS "Found yaml-cpp ${yaml-cpp_VERSION}")
set(ENV_VAR_VALUE "opt/yaml_cpp_vendor/lib")
endif()
ament_environment_hooks(env_hook/yaml_cpp_vendor_library_path.dsv.in)

ament_package(
CONFIG_EXTRAS "yaml_cpp_vendor-extras.cmake.in"
Expand Down
10 changes: 6 additions & 4 deletions yaml_cpp_vendor-extras.cmake.in
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
find_package(yaml-cpp 0.6 QUIET)
## mjbogusz: find_package() and if() disabled until ament can handle complex paths resolving to /usr/include
## always use locally built yaml-cpp for now
# find_package(yaml-cpp QUIET)

if(NOT yaml-cpp_FOUND)
# 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")
endif()
message(STATUS "Setting yaml-cpp_DIR to: '${yaml-cpp_DIR}'")
# endif()

find_package(yaml-cpp CONFIG REQUIRED QUIET)
endif()
find_package(yaml-cpp CONFIG REQUIRED QUIET)

set(yaml_cpp_vendor_LIBRARIES ${YAML_CPP_LIBRARIES})
set(yaml_cpp_vendor_INCLUDE_DIRS ${YAML_CPP_INCLUDE_DIR})
Expand Down