-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
88 lines (66 loc) · 1.71 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# use c++11
set(CMAKE_CXX_COMPILER_ARG1 -std=c++11)
cmake_minimum_required(VERSION 2.8.3)
project(hanp_layer)
find_package(Boost REQUIRED COMPONENTS thread)
find_package(catkin REQUIRED COMPONENTS
roscpp
tf
costmap_2d
dynamic_reconfigure
hanp_msgs
)
# add dynamic reconfigure configs
generate_dynamic_reconfigure_options(
cfg/HANPLayer.cfg
)
## declare catkin package
catkin_package(
INCLUDE_DIRS
include
LIBRARIES
hanp_layer
CATKIN_DEPENDS
roscpp
tf
costmap_2d
dynamic_reconfigure
hanp_msgs
)
## build ##
include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
)
## declare a cpp library
add_library(hanp_layer
src/hanp_layer.cpp
)
## cmake target dependencies of the executable/library
# add_dependencies(hanp_layer_node hanp_layer_generate_messages_cpp)
# build config headers
add_dependencies(hanp_layer hanp_layer_gencfg)
## libraries to link a library or executable target against
target_link_libraries(hanp_layer
${catkin_LIBRARIES}
)
## install ##
## executables and/or libraries for installation
install(TARGETS hanp_layer
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## cpp-header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
)
## testing ##
## add catch based cpp test target
if(COMMAND catkin_add_catchtest)
catkin_add_catchtest(${PROJECT_NAME}-test src/test/test_hanp_layer.cpp)
if(TARGET ${PROJECT_NAME}-test)
target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME} ${catkin_LIBRARIES})
endif()
endif()