forked from SwiftGust/ardupilot_gazebo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
64 lines (48 loc) · 1.72 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
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(ardupilot_sitl_gazebo)
#######################
## Find Dependencies ##
#######################
find_package(gazebo REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
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}
)
link_libraries(
${CMAKE_CURRENT_BINARY_DIR}
${GAZEBO_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})
add_library(ArduCopterPlugin SHARED src/ArduCopterPlugin.cc)
target_link_libraries(ArduCopterPlugin ${GAZEBO_LIBRARIES})
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})