-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
96 lines (80 loc) · 2.46 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
94
95
96
cmake_minimum_required(VERSION 2.8.3)
project(rosflight_plugins)
set(CMAKE_CXX_STANDARD 11)
if (NOT CMAKE_BUILD_TYPE)
# Options: Debug, Release, MinSizeRel, RelWithDebInfo
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
set(CMAKE_CXX_FLAGS "-fopenmp")
find_package(gazebo)
IF(gazebo_FOUND)
# To enable assertions when compiled in release mode.
add_definitions(-DROS_ASSERT_ENABLED)
find_package(catkin REQUIRED COMPONENTS
roscpp
tf
rosflight_msgs
rosflight_utils
std_msgs
nav_msgs
geometry_msgs
sensor_msgs
std_srvs
gazebo_ros
gazebo_plugins
)
find_package(Eigen3 REQUIRED)
link_directories(${GAZEBO_LIBRARY_DIRS})
catkin_package(
INCLUDE_DIRS include ${EIGEN3_INCLUDE_DIRS}
CATKIN_DEPENDS roscpp tf rosflight_msgs rosflight_utils std_msgs nav_msgs geometry_msgs sensor_msgs std_srvs gazebo_ros gazebo_plugins
DEPENDS EIGEN3 GAZEBO
)
###########
## Build ##
###########
include_directories(
include ${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${GAZEBO_INCLUDE_DIRS}
)
add_library(magnetometer_plugin
src/magnetometer.cpp)
target_link_libraries(magnetometer_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(magnetometer_plugin ${catkin_EXPORTED_TARGETS})
add_library(odometry_plugin
src/odometry_plugin.cpp)
target_link_libraries(odometry_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(odometry_plugin ${catkin_EXPORTED_TARGETS})
add_library(imu_plugin
src/imu_plugin.cpp)
target_link_libraries(imu_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(imu_plugin ${catkin_EXPORTED_TARGETS})
add_library(barometer_plugin
src/barometer_plugin.cpp)
target_link_libraries(barometer_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(barometer_plugin ${catkin_EXPORTED_TARGETS})
add_library(airspeed_plugin
src/airspeed_plugin.cpp)
target_link_libraries(airspeed_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(airspeed_plugin ${catkin_EXPORTED_TARGETS})
add_library(GPS_plugin
src/GPS_plugin.cpp)
target_link_libraries(GPS_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(GPS_plugin ${catkin_EXPORTED_TARGETS})
#############
## Install ##
#############
install(
TARGETS
odometry_plugin
imu_plugin
barometer_plugin
GPS_plugin
airspeed_plugin
magnetometer_plugin
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
ENDIF()