Skip to content

enable building a static library #163

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

Merged
merged 1 commit into from
Aug 13, 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
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<build_depend>libconsole-bridge-dev</build_depend>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_ros</buildtool_depend>

<exec_depend>console_bridge_vendor</exec_depend>
<exec_depend>libconsole-bridge-dev</exec_depend>
Expand Down