Skip to content

Commit

Permalink
Link privately to TinyXML2 (gazebosim#321)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored and scpeters committed Aug 7, 2020
1 parent f94626a commit 5e8387f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ if (BUILD_SDF_TEST)
if (NOT WIN32)
set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS XmlUtils.cc)
sdf_build_tests(XmlUtils_TEST.cc)
target_link_libraries(UNIT_XmlUtils_TEST PRIVATE
${TinyXML2_LIBRARIES})
endif()

if (NOT WIN32)
Expand All @@ -150,6 +152,8 @@ if (BUILD_SDF_TEST)
if (NOT WIN32)
set(SDF_BUILD_TESTS_EXTRA_EXE_SRCS Converter.cc EmbeddedSdf.cc XmlUtils.cc)
sdf_build_tests(Converter_TEST.cc)
target_link_libraries(UNIT_Converter_TEST PRIVATE
${TinyXML2_LIBRARIES})
endif()

if (NOT WIN32)
Expand All @@ -162,14 +166,18 @@ if (BUILD_SDF_TEST)
endif()
target_link_libraries(UNIT_parser_urdf_TEST PRIVATE ${URDF_LIBRARIES})
endif()
target_link_libraries(UNIT_parser_urdf_TEST PRIVATE
${TinyXML2_LIBRARIES})
endif()
endif()

sdf_add_library(${sdf_target} ${sources})
target_compile_features(${sdf_target} PUBLIC cxx_std_17)
target_link_libraries(${sdf_target} PUBLIC
${IGNITION-MATH_LIBRARIES}
${TinyXML2_LIBRARIES})
target_link_libraries(${sdf_target}
PUBLIC
${IGNITION-MATH_LIBRARIES}
PRIVATE
${TinyXML2_LIBRARIES})

if (WIN32)
target_compile_definitions(${sdf_target} PRIVATE URDFDOM_STATIC)
Expand Down

0 comments on commit 5e8387f

Please sign in to comment.