Merge pull request #106 from ros2/use_rmw_impl

use rmw implementation
This commit is contained in:
Dirk Thomas 2017-01-09 08:54:15 -08:00 committed by GitHub
commit c429f2e18c
9 changed files with 54 additions and 289 deletions

View file

@ -5,7 +5,6 @@ project(rcl_lifecycle)
find_package(ament_cmake REQUIRED)
find_package(rcl REQUIRED)
find_package(rmw REQUIRED)
find_package(rmw_implementation_cmake REQUIRED)
find_package(lifecycle_msgs REQUIRED)
include_directories(include)
@ -19,30 +18,24 @@ set_source_files_properties(
${rcl_lifecycle_sources}
PROPERTIES language "C")
macro(targets)
get_rcl_information("${rmw_implementation}" "rcl${target_suffix}")
### C-Library depending only on RCL
add_library(
rcl_lifecycle
SHARED
${rcl_lifecycle_sources})
### C-Library depending only on RCL
add_library(
rcl_lifecycle${target_suffix}
SHARED
${rcl_lifecycle_sources})
ament_target_dependencies(rcl_lifecycle
"lifecycle_msgs"
"rcl")
ament_target_dependencies(rcl_lifecycle${target_suffix}
"lifecycle_msgs"
"rcl${target_suffix}")
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(rcl_lifecycle PRIVATE "RCL_LIFECYCLE_BUILDING_DLL")
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(rcl_lifecycle${target_suffix} PRIVATE "RCL_LIFECYCLE_BUILDING_DLL")
install(TARGETS rcl_lifecycle${target_suffix}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
endmacro()
call_for_each_rmw_implementation(targets GENERATE_DEFAULT)
install(TARGETS rcl_lifecycle
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
if(BUILD_TESTING)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@ -83,12 +76,7 @@ ament_export_dependencies(ament_cmake)
ament_export_dependencies(lifecycle_msgs)
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_package(
CONFIG_EXTRAS rcl_lifecycle-extras.cmake)
install(
DIRECTORY cmake
DESTINATION share/${PROJECT_NAME})
ament_package()
install(
DIRECTORY include/