-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
118 lines (82 loc) · 2.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
project(simslides)
# If Fortress is chosen, skip Gazebo classic and require Fortress
if("$ENV{IGNITION_VERSION}" STREQUAL "fortress")
message(STATUS "Looking for Ignition Fortress...")
set(IGN_GUI_VER 6)
find_package(ignition-gui${IGN_GUI_VER} REQUIRED)
set(SDFORMAT_VER 12)
find_package(sdformat${SDFORMAT_VER} REQUIRED)
set(IGN_COMMON_VER 4)
find_package(ignition-common${IGN_COMMON_VER} REQUIRED)
set(IGN_GAZEBO_VER 6)
find_package(ignition-gazebo${IGN_GAZEBO_VER} REQUIRED COMPONENTS gui)
set(IGN_RENDERING_VER 6)
find_package(ignition-rendering${IGN_RENDERING_VER} REQUIRED)
set(IGNITION_FOUND true)
# If Edifice is chosen, skip Gazebo classic and require Edifice
elseif("$ENV{IGNITION_VERSION}" STREQUAL "edifice")
message(STATUS "Looking for Ignition Edifice...")
set(IGN_GUI_VER 5)
find_package(ignition-gui${IGN_GUI_VER} REQUIRED)
set(SDFORMAT_VER 11)
find_package(sdformat${SDFORMAT_VER} REQUIRED)
set(IGN_COMMON_VER 4)
find_package(ignition-common${IGN_COMMON_VER} REQUIRED)
set(IGN_GAZEBO_VER 5)
find_package(ignition-gazebo${IGN_GAZEBO_VER} REQUIRED COMPONENTS gui)
set(IGN_RENDERING_VER 5)
find_package(ignition-rendering${IGN_RENDERING_VER} REQUIRED)
set(IGNITION_FOUND true)
# Default to Citadel + Gazebo 11
# If one simulator isn't found, only use the other
else()
message(STATUS "Looking for Gazebo 11 and Ignition Citadel...")
find_package(gazebo QUIET)
find_package(Protobuf REQUIRED)
set(IGN_GUI_VER 3)
find_package(ignition-gui${IGN_GUI_VER} QUIET)
set(SDFORMAT_VER 9)
find_package(sdformat${SDFORMAT_VER} REQUIRED)
if (${ignition-gui${IGN_GUI_VER}_FOUND})
set(IGN_COMMON_VER 3)
find_package(ignition-common${IGN_COMMON_VER} REQUIRED)
set(IGN_GAZEBO_VER 3)
find_package(ignition-gazebo${IGN_GAZEBO_VER} REQUIRED COMPONENTS gui)
set(IGN_RENDERING_VER 3)
find_package(ignition-rendering${IGN_RENDERING_VER} REQUIRED)
set(IGNITION_FOUND true)
endif()
endif()
# Common
add_subdirectory(common)
# Gazebo-classic
if (${gazebo_FOUND})
message (STATUS "Gazebo classic found")
add_subdirectory(classic)
else()
message (STATUS "Gazebo classic not found, skipping this simulator")
endif()
# Ignition
if (${IGNITION_FOUND})
message (STATUS "Ignition found")
add_subdirectory(ignition)
else()
message (STATUS "Ignition not found, skipping this simulator")
endif()
install(DIRECTORY
models
DESTINATION share/${PROJECT_NAME}/
)
install(DIRECTORY
worlds
DESTINATION share/${PROJECT_NAME}/
)
configure_file(
"setup.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/share/setup.sh" @ONLY
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/share/setup.sh
DESTINATION share/${PROJECT_NAME}
)