rcl/rcl/CMakeLists.txt
M. M 461ad9cd71 New interfaces and their implementations for QoS features (#408)
* implement rcl_wait and rcl_take for rcl_event_t

Signed-off-by: Miaofei <miaofei@amazon.com>

* address feedback regarding formatting issues

Signed-off-by: Miaofei <miaofei@amazon.com>

* Remove dependency on sleep in test_events

Signed-off-by: Ross Desmond <44277324+ross-desmond@users.noreply.github.com>

* update total max wait time for setting up publisher and subscriber to 10 seconds

Signed-off-by: Miaofei <miaofei@amazon.com>

* Fix test_events for rmw_connext

Signed-off-by: Ross Desmond <44277324+ross-desmond@users.noreply.github.com>

* Refactor out timed loop from tests to function

Signed-off-by: Miaofei <miaofei@amazon.com>

* address additional feedback from pull request

Signed-off-by: Miaofei <miaofei@amazon.com>

* update comment regarding difference between connext and opensplice

Signed-off-by: Miaofei <miaofei@amazon.com>

* fix uncrustify issues

Signed-off-by: Miaofei <miaofei@amazon.com>

* update test_events for compatibility with API changes

Signed-off-by: Miaofei <miaofei@amazon.com>

* temporarily disable test_events for macOS

Signed-off-by: Miaofei <miaofei@amazon.com>
2019-05-03 10:17:27 -07:00

119 lines
3.1 KiB
CMake

cmake_minimum_required(VERSION 3.5)
project(rcl)
find_package(ament_cmake_ros REQUIRED)
find_package(rcl_interfaces REQUIRED)
find_package(rcutils REQUIRED)
find_package(rmw REQUIRED)
find_package(rmw_implementation REQUIRED)
find_package(rosidl_generator_c REQUIRED)
find_package(tinydir_vendor REQUIRED)
include_directories(include)
include(cmake/rcl_set_symbol_visibility_hidden.cmake)
include(cmake/get_default_rcl_logging_implementation.cmake)
get_default_rcl_logging_implementation(RCL_LOGGING_IMPL)
# Default to C11
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
set(${PROJECT_NAME}_sources
src/rcl/arguments.c
src/rcl/client.c
src/rcl/common.c
src/rcl/context.c
src/rcl/event.c
src/rcl/expand_topic_name.c
src/rcl/graph.c
src/rcl/guard_condition.c
src/rcl/init.c
src/rcl/init_options.c
src/rcl/lexer.c
src/rcl/lexer_lookahead.c
src/rcl/logging_rosout.c
src/rcl/logging.c
src/rcl/node.c
src/rcl/node_options.c
src/rcl/publisher.c
src/rcl/remap.c
src/rcl/rmw_implementation_identifier_check.c
src/rcl/service.c
src/rcl/subscription.c
src/rcl/time.c
src/rcl/timer.c
src/rcl/validate_topic_name.c
src/rcl/wait.c
src/rcl/security_directory.c
)
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_sources})
# specific order: dependents before dependencies
ament_target_dependencies(${PROJECT_NAME}
"rcl_interfaces"
"rmw_implementation"
"rmw"
"rcutils"
"rosidl_generator_c"
${RCL_LOGGING_IMPL}
"tinydir_vendor"
)
# 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} PRIVATE "RCL_BUILDING_DLL")
rcl_set_symbol_visibility_hidden(${PROJECT_NAME} LANGUAGE "C")
install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
# rcl_lib_dir is passed as APPEND_LIBRARY_DIRS for each ament_add_gtest call so
# the librcl that they link against is on the library path.
# This is especially important on Windows.
# This is overwritten each loop, but which one it points to doesn't really matter.
set(rcl_lib_dir "$<TARGET_FILE_DIR:${PROJECT_NAME}>")
# specific order: dependents before dependencies
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_export_dependencies(ament_cmake)
ament_export_dependencies(rcl_interfaces)
ament_export_dependencies(rmw_implementation)
ament_export_dependencies(rmw)
ament_export_dependencies(rcutils)
ament_export_dependencies(rosidl_generator_c)
ament_export_dependencies(${RCL_LOGGING_IMPL})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
add_subdirectory(test)
endif()
ament_package(CONFIG_EXTRAS "rcl-extras.cmake")
install(
DIRECTORY cmake
DESTINATION share/${PROJECT_NAME}
)
install(
DIRECTORY include/
DESTINATION include
)