2014-07-30 17:57:21 -07:00
|
|
|
cmake_minimum_required(VERSION 2.8.3)
|
|
|
|
|
|
|
|
project(rclcpp)
|
|
|
|
|
|
|
|
find_package(ament_cmake REQUIRED)
|
2015-08-18 18:41:40 -07:00
|
|
|
find_package(rcl_interfaces REQUIRED)
|
2015-11-05 18:55:52 -08:00
|
|
|
find_package(rmw REQUIRED)
|
2015-12-07 18:04:19 -08:00
|
|
|
find_package(rmw_implementation REQUIRED)
|
|
|
|
find_package(rmw_implementation_cmake REQUIRED)
|
2015-11-05 18:55:52 -08:00
|
|
|
find_package(rosidl_generator_cpp REQUIRED)
|
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include_directories(include)
|
|
|
|
|
|
|
|
set(${PROJECT_NAME}_SRCS
|
|
|
|
src/rclcpp/any_executable.cpp
|
|
|
|
src/rclcpp/callback_group.cpp
|
|
|
|
src/rclcpp/client.cpp
|
|
|
|
src/rclcpp/context.cpp
|
|
|
|
src/rclcpp/contexts/default_context.cpp
|
|
|
|
src/rclcpp/executor.cpp
|
|
|
|
src/rclcpp/executors.cpp
|
|
|
|
src/rclcpp/executors/multi_threaded_executor.cpp
|
|
|
|
src/rclcpp/executors/single_threaded_executor.cpp
|
|
|
|
src/rclcpp/intra_process_manager.cpp
|
2015-12-01 11:45:52 -08:00
|
|
|
src/rclcpp/intra_process_manager_impl.cpp
|
2015-11-05 18:55:52 -08:00
|
|
|
src/rclcpp/memory_strategies.cpp
|
|
|
|
src/rclcpp/memory_strategy.cpp
|
|
|
|
src/rclcpp/parameter.cpp
|
|
|
|
src/rclcpp/parameter_client.cpp
|
|
|
|
src/rclcpp/parameter_service.cpp
|
|
|
|
src/rclcpp/publisher.cpp
|
|
|
|
src/rclcpp/node.cpp
|
|
|
|
src/rclcpp/service.cpp
|
|
|
|
src/rclcpp/subscription.cpp
|
|
|
|
src/rclcpp/timer.cpp
|
2015-12-07 18:04:19 -08:00
|
|
|
src/rclcpp/type_support.cpp
|
2015-11-05 18:55:52 -08:00
|
|
|
src/rclcpp/utilities.cpp
|
|
|
|
)
|
2015-12-07 18:04:19 -08:00
|
|
|
|
|
|
|
macro(target)
|
|
|
|
add_library(${PROJECT_NAME}${target_suffix} SHARED
|
|
|
|
${${PROJECT_NAME}_SRCS})
|
|
|
|
ament_target_dependencies(${PROJECT_NAME}${target_suffix}
|
|
|
|
"rcl_interfaces"
|
|
|
|
"rmw"
|
|
|
|
"rosidl_generator_cpp"
|
|
|
|
"${rmw_implementation}")
|
|
|
|
|
|
|
|
# Causes the visibility macros to use dllexport rather than dllimport,
|
|
|
|
# which is appropriate when building the dll but not consuming it.
|
|
|
|
target_compile_definitions(${PROJECT_NAME}${target_suffix}
|
|
|
|
PRIVATE "RCLCPP_BUILDING_LIBRARY")
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS ${PROJECT_NAME}${target_suffix}
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
)
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
call_for_each_rmw_implementation(target GENERATE_DEFAULT)
|
2014-07-30 17:57:21 -07:00
|
|
|
|
2016-02-11 08:24:30 -08:00
|
|
|
ament_export_dependencies(ament_cmake)
|
2015-04-28 16:12:01 -07:00
|
|
|
ament_export_dependencies(rcl_interfaces)
|
2015-11-05 18:55:52 -08:00
|
|
|
ament_export_dependencies(rmw)
|
2015-12-07 18:04:19 -08:00
|
|
|
ament_export_dependencies(rmw_implementation)
|
2015-11-05 18:55:52 -08:00
|
|
|
ament_export_dependencies(rosidl_generator_cpp)
|
2014-08-01 16:59:55 -07:00
|
|
|
|
2014-07-30 17:57:21 -07:00
|
|
|
ament_export_include_directories(include)
|
|
|
|
|
2015-11-05 18:55:52 -08:00
|
|
|
ament_export_libraries(${PROJECT_NAME})
|
|
|
|
|
2015-03-07 01:24:52 +01:00
|
|
|
if(AMENT_ENABLE_TESTING)
|
|
|
|
find_package(ament_lint_auto REQUIRED)
|
|
|
|
ament_lint_auto_find_test_dependencies()
|
2015-08-18 18:41:40 -07:00
|
|
|
|
2015-10-12 11:55:33 -07:00
|
|
|
ament_add_gtest(test_function_traits test/test_function_traits.cpp)
|
2015-11-05 18:55:52 -08:00
|
|
|
if(TARGET test_function_traits)
|
|
|
|
target_include_directories(test_function_traits PUBLIC
|
|
|
|
${rcl_interfaces_INCLUDE_DIRS}
|
|
|
|
${rmw_INCLUDE_DIRS}
|
|
|
|
${rosidl_generator_cpp_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
endif()
|
2015-08-18 18:41:40 -07:00
|
|
|
ament_add_gtest(test_mapped_ring_buffer test/test_mapped_ring_buffer.cpp)
|
2015-11-05 18:55:52 -08:00
|
|
|
if(TARGET test_mapped_ring_buffer)
|
|
|
|
target_include_directories(test_mapped_ring_buffer PUBLIC
|
|
|
|
${rcl_interfaces_INCLUDE_DIRS}
|
|
|
|
${rmw_INCLUDE_DIRS}
|
|
|
|
${rosidl_generator_cpp_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
endif()
|
2015-08-18 18:42:00 -07:00
|
|
|
ament_add_gtest(test_intra_process_manager test/test_intra_process_manager.cpp)
|
2015-08-19 13:10:15 -07:00
|
|
|
if(TARGET test_intra_process_manager)
|
2015-08-27 14:07:18 -07:00
|
|
|
target_include_directories(test_intra_process_manager PUBLIC
|
2015-11-05 18:55:52 -08:00
|
|
|
${rcl_interfaces_INCLUDE_DIRS}
|
|
|
|
${rmw_INCLUDE_DIRS}
|
|
|
|
${rosidl_generator_cpp_INCLUDE_DIRS}
|
|
|
|
)
|
2015-08-19 13:10:15 -07:00
|
|
|
endif()
|
2015-12-15 00:27:46 -08:00
|
|
|
ament_add_gtest(test_rate test/test_rate.cpp)
|
|
|
|
if(TARGET test_rate)
|
|
|
|
target_include_directories(test_rate PUBLIC
|
|
|
|
${rcl_interfaces_INCLUDE_DIRS}
|
|
|
|
${rmw_INCLUDE_DIRS}
|
|
|
|
${rosidl_generator_cpp_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
target_link_libraries(test_rate
|
|
|
|
${PROJECT_NAME}${target_suffix}
|
|
|
|
)
|
|
|
|
endif()
|
2015-03-07 01:24:52 +01:00
|
|
|
endif()
|
|
|
|
|
2014-09-08 14:37:52 -07:00
|
|
|
ament_package(
|
|
|
|
CONFIG_EXTRAS rclcpp-extras.cmake
|
|
|
|
)
|
2014-07-30 17:57:21 -07:00
|
|
|
|
2015-12-07 18:04:19 -08:00
|
|
|
install(
|
|
|
|
DIRECTORY cmake
|
|
|
|
DESTINATION share/${PROJECT_NAME}
|
|
|
|
)
|
|
|
|
|
2014-07-30 17:57:21 -07:00
|
|
|
install(
|
|
|
|
DIRECTORY include/
|
|
|
|
DESTINATION include
|
|
|
|
)
|