From 72c4853f1dc5a1240b04b85bbfb0304b1450901b Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 29 Dec 2021 12:46:07 -0800 Subject: [PATCH] Support compilation with static libraries (#808) Restore functionality of #394. Submitted a fix upstream in ignitionrobotics/ign-cmake#203. Signed-off-by: Steve Peters --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6c54a2175..b9bd18467 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -121,6 +121,10 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME} TINYXML2::TINYXML2 using_parser_urdf) +if (NOT BUILD_SHARED_LIBS) + target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PUBLIC IGNITION_SDFORMAT_STATIC_DEFINE) +endif() + if (WIN32) target_compile_definitions(${PROJECT_LIBRARY_TARGET_NAME} PRIVATE URDFDOM_STATIC) endif()