forked from ros2/rosidl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (42 loc) · 1.57 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
cmake_minimum_required(VERSION 3.5)
project(rosidl_runtime_cpp)
find_package(ament_cmake REQUIRED)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
ament_export_include_directories(include)
ament_export_targets(${PROJECT_NAME})
ament_index_register_resource("rosidl_runtime_packages")
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
find_package(performance_test_fixture REQUIRED)
# Give cppcheck hints about macro definitions coming from outside this package
get_target_property(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS
performance_test_fixture::performance_test_fixture INTERFACE_INCLUDE_DIRECTORIES)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)
# 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()
ament_add_gtest(test_bounded_vector test/test_bounded_vector.cpp)
if(TARGET test_bounded_vector)
target_include_directories(test_bounded_vector PUBLIC include)
endif()
add_performance_test(benchmark_bounded_vector test/benchmark/benchmark_bounded_vector.cpp)
if(TARGET benchmark_bounded_vector)
target_link_libraries(benchmark_bounded_vector ${PROJECT_NAME})
endif()
endif()
install(
DIRECTORY include/
DESTINATION include
)
install(
TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
)
ament_package()