diff --git a/CMakeLists.txt b/CMakeLists.txt index de9a6e84..e507688f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,10 @@ set(CLASS_LOADER_IGNORE_AMENT FALSE CACHE BOOL "Do not use ament when building this package.") if(NOT CLASS_LOADER_IGNORE_AMENT) find_package(ament_cmake) + find_package(ament_cmake_ros REQUIRED) + set(explicit_library_type "") +else() + set(explicit_library_type "SHARED") endif() find_package(console_bridge_vendor REQUIRED) # Provides console_bridge 0.4.0 on platforms without it. @@ -33,7 +37,7 @@ set(${PROJECT_NAME}_SRCS src/meta_object.cpp src/multi_library_class_loader.cpp ) -add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SRCS}) +add_library(${PROJECT_NAME} ${explicit_library_type} ${${PROJECT_NAME}_SRCS}) target_include_directories(${PROJECT_NAME} PUBLIC "$" "$") diff --git a/package.xml b/package.xml index 35d11800..2068df5a 100644 --- a/package.xml +++ b/package.xml @@ -17,6 +17,7 @@ libconsole-bridge-dev ament_cmake + ament_cmake_ros console_bridge_vendor libconsole-bridge-dev