forked from SwiftGust/ardupilot_gazebo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
69 lines (52 loc) · 2.35 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
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(ardupilot_gazebo)
find_package(
catkin REQUIRED
COMPONENTS roscpp
rospy
std_msgs
dynamic_reconfigure
sensor_msgs
mav_msgs)
# ##############################################################################
# Find Dependencies ##
# ##############################################################################
find_package(gazebo REQUIRED)
set(CMAKE_CXX_FLAGS "-std=c++17")
if("${GAZEBO_VERSION}" VERSION_LESS "7.0")
message(
FATAL_ERROR "You need at least Gazebo 7.0. Your version: ${GAZEBO_VERSION}")
else()
message("Gazebo version: ${GAZEBO_VERSION}")
endif()
# ##############################################################################
# Build ##
# ##############################################################################
include_directories(${PROJECT_SOURCE_DIR} include ${GAZEBO_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS})
link_libraries(${CMAKE_CURRENT_BINARY_DIR} ${GAZEBO_LIBRARIES}
${catkin_LIBRARIES})
link_directories(${GAZEBO_LIBRARY_DIRS})
set(plugins_single_header
ArduPilotPlugin ArduCopterIRLockPlugin ArduCopterPlugin
# GimbalSmall2dPlugin
# WindPlugin
)
add_library(ArduCopterIRLockPlugin SHARED src/ArduCopterIRLockPlugin.cc)
target_link_libraries(ArduCopterIRLockPlugin ${GAZEBO_LIBRARIES})
add_library(ArduPilotPlugin SHARED src/ArduPilotPlugin.cc)
target_link_libraries(ArduPilotPlugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES})
add_library(ArduCopterPlugin SHARED src/ArduCopterPlugin.cc)
target_link_libraries(ArduCopterPlugin ${GAZEBO_LIBRARIES})
add_library(GazeboGimbalPlugin src/GazeboGimbal.cpp)
target_link_libraries(GazeboGimbalPlugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(GazeboGimbalPlugin ${catkin_EXPORTED_TARGETS})
if("${GAZEBO_VERSION}" VERSION_LESS "8.0")
add_library(GimbalSmall2dPlugin SHARED src/GimbalSmall2dPlugin.cc)
target_link_libraries(GimbalSmall2dPlugin ${GAZEBO_LIBRARIES})
install(TARGETS GimbalSmall2dPlugin DESTINATION ${GAZEBO_PLUGIN_PATH})
endif()
install(TARGETS ArduCopterIRLockPlugin DESTINATION ${GAZEBO_PLUGIN_PATH})
install(TARGETS ArduPilotPlugin DESTINATION ${GAZEBO_PLUGIN_PATH})
install(TARGETS ArduCopterPlugin DESTINATION ${GAZEBO_PLUGIN_PATH})
install(TARGETS GazeboGimbalPlugin DESTINATION ${GAZEBO_PLUGIN_PATH})