-
Notifications
You must be signed in to change notification settings - Fork 58
/
CMakeLists.txt
117 lines (93 loc) · 4.12 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
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(ignition-sensors6 VERSION 6.8.1)
#============================================================================
# Find ignition-cmake
#============================================================================
find_package(ignition-cmake2 2.13 REQUIRED)
#============================================================================
# Configure the project
#============================================================================
ign_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/sensors
VERSION_SUFFIX
)
#============================================================================
# Set project-specific options
#============================================================================
set (DRI_TESTS TRUE CACHE BOOL "True to enable DRI tests")
option(ENABLE_PROFILER "Enable Gazebo Profiler" FALSE)
if(ENABLE_PROFILER)
add_definitions("-DIGN_PROFILER_ENABLE=1")
else()
add_definitions("-DIGN_PROFILER_ENABLE=0")
endif()
#============================================================================
# Search for project-specific dependencies
#============================================================================
message(STATUS "\n\n-- ====== Finding Dependencies ======")
#--------------------------------------
# Find Protobuf
ign_find_package(IgnProtobuf
REQUIRED
PRETTY Protobuf)
#--------------------------------------
# Find ignition-math
ign_find_package(ignition-math6 REQUIRED VERSION 6.6)
set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR})
#--------------------------------------
# Find ignition-common
ign_find_package(ignition-common4
COMPONENTS profiler
REQUIRED)
set(IGN_COMMON_VER ${ignition-common4_VERSION_MAJOR})
#--------------------------------------
# Find ignition-transport
ign_find_package(ignition-transport11 REQUIRED)
set(IGN_TRANSPORT_VER ${ignition-transport11_VERSION_MAJOR})
#--------------------------------------
# Find ignition-rendering
# See CMP0072 for more details (cmake --help-policy CMP0072)
if ((NOT ${CMAKE_VERSION} VERSION_LESS 3.11) AND (NOT OpenGL_GL_PREFERENCE))
set(OpenGL_GL_PREFERENCE "GLVND")
endif()
ign_find_package(ignition-rendering6 REQUIRED VERSION 6.5 OPTIONAL_COMPONENTS ogre ogre2)
set(IGN_RENDERING_VER ${ignition-rendering6_VERSION_MAJOR})
if (TARGET ignition-rendering${IGN_RENDERING_VER}::ogre)
set(HAVE_OGRE TRUE)
add_definitions(-DWITH_OGRE)
endif()
if (TARGET ignition-rendering${IGN_RENDERING_VER}::ogre2)
set(HAVE_OGRE2 TRUE)
add_definitions(-DWITH_OGRE2)
endif()
#--------------------------------------
# Find ignition-msgs
ign_find_package(ignition-msgs8 REQUIRED VERSION 8.2)
set(IGN_MSGS_VER ${ignition-msgs8_VERSION_MAJOR})
#--------------------------------------
# Find SDFormat
ign_find_package(sdformat12 REQUIRED VERSION 12.6.0)
set(SDF_VER ${sdformat12_VERSION_MAJOR})
set(IGN_SENSORS_PLUGIN_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
#============================================================================
# Configure the build
#============================================================================
ign_configure_build(QUIT_IF_BUILD_ERRORS)
#============================================================================
# Create package information
#============================================================================
ign_create_packages()
#============================================================================
# Configure documentation
#============================================================================
configure_file(${CMAKE_SOURCE_DIR}/api.md.in ${CMAKE_BINARY_DIR}/api.md)
configure_file(${CMAKE_SOURCE_DIR}/tutorials.md.in ${CMAKE_BINARY_DIR}/tutorials.md)
ign_create_docs(
API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md"
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md")
if(TARGET doc)
file(COPY ${CMAKE_SOURCE_DIR}/tutorials/files/ DESTINATION ${CMAKE_BINARY_DIR}/doxygen/html/files/)
endif()