This repository has been archived by the owner on Oct 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
94 lines (77 loc) · 2.81 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
89
90
91
92
93
cmake_minimum_required(VERSION 2.8.3)
project(control_fsm)
add_compile_options(-std=c++11 -Wall)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
geometry_msgs
mavros_msgs
actionlib_msgs
actionlib
ascend_msgs
tf2
tf2_ros
tf2_geometry_msgs
roslaunch
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
CATKIN_DEPENDS message_runtime ascend_msgs
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
)
file(GLOB control_fsm_SRC "src/fsm/*.cpp")
file(GLOB control_tools_SRC "src/tools/*.cpp")
## Declare a C++ library
#State machine
add_library(control_fsm_lib
${control_fsm_SRC}
)
#Control tools not directly related to the FSM
add_library(control_tools_lib
${control_tools_SRC}
)
target_link_libraries(control_tools_lib
${catkin_LIBRARIES}
)
target_link_libraries(control_fsm_lib
${catkin_LIBRARIES}
control_tools_lib
)
## Declare a C++ executable
add_executable(control_fsm_main src/nodes/control_fsm_main)
add_executable(action_interface_client src/nodes/action_interface_client.cpp)
## Specify libraries to link a library or executable target against
target_link_libraries(control_fsm_main control_fsm_lib)
target_link_libraries(action_interface_client ${catkin_LIBRARIES})
## Add cmake target dependencies of the executable
## same as for the library above
add_dependencies(control_fsm_main ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(control_fsm_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(control_tools_lib ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(action_interface_client ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest_gtest(utest test/launch_test.test test/utest.cpp)
target_link_libraries(utest control_fsm_lib)
target_link_libraries(utest ${catkin_LIBRARIS})
roslaunch_add_file_check(launch)
endif()