forked from marcelinomalmeidan/px4_control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
91 lines (77 loc) · 2.96 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
cmake_minimum_required(VERSION 2.8.3)
project(px4_control)
option(USE_KINETIC "Use kinetic version instead of indigo version" FALSE) # TRUE/FALSE
## Add support for C++11, supported in ROS Kinetic and newer
add_definitions(-std=c++11)
## 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
actionlib_msgs
geometry_msgs
mavros_msgs
nav_msgs
roscpp
std_msgs
visualization_msgs
message_generation
tf
cmake_modules
mg_msgs
)
find_package(Eigen REQUIRED)
catkin_package(
DEPENDS Eigen
CATKIN_DEPENDS mg_msgs
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${Eigen_INCLUDE_DIRS}
)
if(USE_KINETIC)
add_executable(px4_control_node
src/px4_control.cpp
src/HelperFunctions/helper.cpp
src/HelperFunctions/QuatRotEuler.cpp
src/HelperFunctions/visualization_functions.cpp
src/Callbacks/callbacks.cpp
src/Threads/FSMTaskKinetic.cpp
src/Threads/joyTask.cpp
src/Threads/commPubKinetic.cpp
src/Threads/watchdogs.cpp
src/Threads/visualization_thread.cpp
src/PosControl/PosControlKinetic.cpp
src/JoyDrivers/joyDrivers.cpp
src/pevents/pevents.cpp
src/Services/services.cpp
src/structs.cpp)
target_link_libraries(px4_control_node ${catkin_LIBRARIES})
#This makes sure that messages and services are compiled before the rest
add_dependencies(px4_control_node px4_control_generate_messages_cpp)
add_dependencies(px4_control_node ${catkin_EXPORTED_TARGETS})
add_dependencies(px4_control_node mg_msgs_gencpp)
else()
add_executable(px4_control_node
src/px4_control.cpp
src/HelperFunctions/helper.cpp
src/HelperFunctions/QuatRotEuler.cpp
src/HelperFunctions/visualization_functions.cpp
src/Callbacks/callbacks.cpp
src/Threads/FSMTask.cpp
src/Threads/joyTask.cpp
src/Threads/commPub.cpp
src/Threads/watchdogs.cpp
src/Threads/visualization_thread.cpp
src/JoyDrivers/joyDrivers.cpp
src/PosControl/PosControl.cpp
src/pevents/pevents.cpp
src/Services/services.cpp
src/structs.cpp)
target_link_libraries(px4_control_node ${catkin_LIBRARIES})
#This makes sure that messages and services are compiled before the rest
add_dependencies(px4_control_node px4_control_generate_messages_cpp)
add_dependencies(px4_control_node ${catkin_EXPORTED_TARGETS})
add_dependencies(px4_control_node mg_msgs_gencpp)
endif(USE_KINETIC)
unset(USE_KINETIC CACHE)