Skip to content

Commit

Permalink
[cmake] Adapt to yaml-cpp target name change in 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Aug 18, 2023
1 parent 22c5dde commit dad55fc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ add_project_dependency(SpaceVecAlg REQUIRED NO_MODULE)

if(BUILD_RBDYN_PARSERS)
add_project_dependency(yaml-cpp 0.5.0 REQUIRED NO_MODULE)
if(TARGET yaml-cpp::yaml-cpp)
set(YAML_CPP_TARGET yaml-cpp::yaml-cpp)
else()
set(YAML_CPP_TARGET yaml-cpp)
endif()

find_package(tinyxml2 QUIET NO_MODULE)
if(NOT ${tinyxml2_FOUND})
Expand Down
2 changes: 1 addition & 1 deletion binding/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(${BUILD_RBDYN_PARSERS})
tests/test_rbdyn_parsers.py)
list(APPEND RBDYN_BINDINGS_TARGETS RBDyn::Parsers)
if(NOT BUILD_SHARED_LIBS)
list(APPEND RBDYN_BINDINGS_TARGETS yaml-cpp tinyxml2::tinyxml2)
list(APPEND RBDYN_BINDINGS_TARGETS ${YAML_CPP_TARGET} tinyxml2::tinyxml2)
endif()
endif()

Expand Down
4 changes: 2 additions & 2 deletions src/parsers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ target_include_directories(
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
$<INSTALL_INTERFACE:include>)
target_link_libraries(RBDynParsers PUBLIC RBDyn tinyxml2::tinyxml2 yaml-cpp
Boost::boost)
target_link_libraries(RBDynParsers PUBLIC RBDyn tinyxml2::tinyxml2
${YAML_CPP_TARGET} Boost::boost)
if(BUILD_SHARED_LIBS)
set_target_properties(RBDynParsers PROPERTIES COMPILE_FLAGS
"-DRBDYN_PARSERS_EXPORTS")
Expand Down

0 comments on commit dad55fc

Please sign in to comment.