-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
65 lines (54 loc) · 2.11 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
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.8)
project(dr_util)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
add_link_options(LINKER:--as-needed)
find_package(catkin REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem date_time)
include_directories(
"include/${PROJECT_NAME}"
SYSTEM "${Boost_INCLUDE_DIRS}"
)
catkin_package(
LIBRARIES ${PROJECT_NAME}
INCLUDE_DIRS include
DEPENDS Boost
)
add_library(${PROJECT_NAME}
src/environment.cpp
src/expand.cpp
src/file_system.cpp
src/timestamp.cpp
src/polynomial.cpp
)
target_link_libraries(${PROJECT_NAME} PRIVATE ${catkin_LIBRARIES} ${Boost_LIBRARIES})
if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(${PROJECT_NAME}_test_bitwise test/bitwise.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_button_filter test/button_filter.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_environment test/environment.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_expand test/expand.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_functional test/functional.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_geometry test/geometry.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_integer_sequence test/integer_sequence.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_polynomial test/polynomial.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_timestamp test/timestamp.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_tuple test/tuple.cpp)
catkin_add_gtest(${PROJECT_NAME}_test_voidt_t test/void_t.cpp)
target_link_libraries(${PROJECT_NAME}_test_environment ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_test_expand ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_test_polynomial ${PROJECT_NAME})
endif()
install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION "${CATKIN_PACKAGE_LIB_DESTINATION}"
LIBRARY DESTINATION "${CATKIN_PACKAGE_LIB_DESTINATION}"
RUNTIME DESTINATION "${CATKIN_PACKAGE_BIN_DESTINATION}"
COMPONENT runtime
)
install(
DIRECTORY "include/${PROJECT_NAME}/"
DESTINATION "${CATKIN_PACKAGE_INCLUDE_DESTINATION}"
COMPONENT development
)