1
1
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
2
- index 4085b5aaeb..f89ac88333 100644
2
+ index 732cbb4..d9d4c0c 100644
3
3
--- a/cmake/SearchForStuff.cmake
4
4
+++ b/cmake/SearchForStuff.cmake
5
- @@ -179,7 +179,7 @@ if (PKG_CONFIG_FOUND)
5
+ @@ -3,11 +3,9 @@ include (CheckCXXSourceCompiles)
6
+
7
+ include (${gazebo_cmake_dir}/FindOS.cmake)
8
+ find_package(PkgConfig)
9
+ - include (${gazebo_cmake_dir}/FindFreeimage.cmake)
10
+ -
11
+ - execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --modversion protobuf
12
+ - OUTPUT_VARIABLE PROTOBUF_VERSION
13
+ - RESULT_VARIABLE protobuf_modversion_failed)
14
+ + find_package(freeimage CONFIG REQUIRED)
15
+ + set(freeimage_LIBRARIES freeimage::FreeImage)
16
+ + get_target_property(freeimage_INCLUDE_DIRS freeimage::FreeImage INTERFACE_INCLUDE_DIRECTORIES)
17
+
18
+ ########################################
19
+ # 1. can not use GAZEBO_BUILD_TYPE_PROFILE is defined after include this module
20
+ @@ -25,6 +23,8 @@ if (CMAKE_BUILD_TYPE)
21
+ endif()
22
+
23
+ ########################################
24
+ + find_package(Protobuf CONFIG REQUIRED)
25
+ +
26
+ if (PROTOBUF_VERSION LESS 2.3.0)
27
+ BUILD_ERROR("Incorrect version: Gazebo requires protobuf version 2.3.0 or greater")
28
+ endif()
29
+ @@ -35,6 +35,7 @@ endif()
30
+ # Protobuf >= 22 requires to link abseil, so we are constrained to use
31
+ # find_package(Protobuf) and link to protobuf::libprotobuf,
32
+ # see https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/4075#issuecomment-1569242816
33
+ +
34
+ if (DEFINED PROTOBUF_VERSION AND PROTOBUF_VERSION GREATER_EQUAL 22.0)
35
+ set(GZ_PROTOBUF_USE_CMAKE_CONFIG_DEFAULT ON)
36
+ else()
37
+ @@ -62,7 +63,6 @@ if(NOT GZ_PROTOBUF_USE_CMAKE_CONFIG)
38
+ set (GZ_PROTOBUF_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY})
39
+ endif()
40
+ else()
41
+ - find_package(Protobuf CONFIG REQUIRED)
42
+ set (GZ_PROTOBUF_LIBRARY protobuf::libprotobuf)
43
+ set (GZ_PROTOBUF_PROTOC_LIBRARY protobuf::libprotoc)
44
+ if(NOT DEFINED PROTOBUF_PROTOC_EXECUTABLE)
45
+ @@ -203,7 +203,7 @@ if (PKG_CONFIG_FOUND)
6
46
# (needed, at least, for MacOS)
7
47
8
48
# Use system installation on UNIX and Apple, and internal copy on Windows
9
49
- if (UNIX OR APPLE)
10
50
+ if (true)
11
- message (STATUS "Using system tinyxml.")
12
- set (USE_EXTERNAL_TINYXML True)
51
+ set (USE_EXTERNAL_TINYXML_DEFAULT_VALUE ON)
13
52
elseif(WIN32)
14
- @@ -225,7 +225,7 @@ if (PKG_CONFIG_FOUND)
53
+ set (USE_EXTERNAL_TINYXML_DEFAULT_VALUE OFF)
54
+ @@ -252,7 +252,7 @@ if (PKG_CONFIG_FOUND)
15
55
# (needed, at least, for MacOS)
16
56
17
57
# Use system installation on UNIX and Apple, and internal copy on Windows
18
58
- if (UNIX OR APPLE)
19
59
+ if (true)
20
- message (STATUS "Using system tinyxml2.")
21
- set (USE_EXTERNAL_TINYXML2 True)
60
+ set (USE_EXTERNAL_TINYXML2_DEFAULT_VALUE ON)
22
61
elseif(WIN32)
23
- @@ -513,7 +513,7 @@ if (PKG_CONFIG_FOUND)
62
+ set (USE_EXTERNAL_TINYXML2_DEFAULT_VALUE OFF)
63
+ @@ -331,8 +331,7 @@ if (PKG_CONFIG_FOUND)
64
+
65
+ #################################################
66
+ # Find TBB
67
+ - pkg_check_modules(TBB tbb)
68
+ - set (TBB_PKG_CONFIG "tbb")
69
+ + find_package(TBB CONFIG REQUIRED)
70
+ if (NOT TBB_FOUND)
71
+ message(STATUS "TBB not found, attempting to detect manually")
72
+ set (TBB_PKG_CONFIG "")
73
+ @@ -365,23 +364,20 @@ if (PKG_CONFIG_FOUND)
74
+ #################################################
75
+ # Find OGRE
76
+
77
+ - pkg_check_modules(OGRE-RTShaderSystem
78
+ - OGRE-RTShaderSystem>=${MIN_OGRE_VERSION})
79
+ + find_package(OGRE CONFIG REQUIRED)
80
+
81
+ - if (OGRE-RTShaderSystem_FOUND)
82
+ - set(ogre_ldflags ${OGRE-RTShaderSystem_LDFLAGS})
83
+ - set(ogre_include_dirs ${OGRE-RTShaderSystem_INCLUDE_DIRS})
84
+ - set(ogre_libraries ${OGRE-RTShaderSystem_LIBRARIES})
85
+ - set(ogre_library_dirs ${OGRE-RTShaderSystem_LIBRARY_DIRS})
86
+ - set(ogre_cflags ${OGRE-RTShaderSystem_CFLAGS})
87
+ + if (OGRE_RTShaderSystem_FOUND)
88
+ + set(ogre_ldflags ${OGRE_RTShaderSystem_LDFLAGS})
89
+ + set(ogre_include_dirs ${OGRE_RTShaderSystem_INCLUDE_DIRS})
90
+ + set(ogre_libraries ${OGRE_RTShaderSystem_LIBRARIES})
91
+ + set(ogre_library_dirs ${OGRE_RTShaderSystem_LIBRARY_DIRS})
92
+ + set(ogre_cflags ${OGRE_RTShaderSystem_CFLAGS})
93
+
94
+ set (INCLUDE_RTSHADER ON CACHE BOOL "Enable GPU shaders")
95
+ else ()
96
+ set (INCLUDE_RTSHADER OFF CACHE BOOL "Enable GPU shaders")
97
+ endif ()
98
+
99
+ - pkg_check_modules(OGRE OGRE>=${MIN_OGRE_VERSION})
100
+ -
101
+ if (PKG_CONFIG_EXECUTABLE AND OGRE_FOUND AND NOT DEFINED OGRE_VERSION)
102
+ execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --modversion OGRE
103
+ OUTPUT_VARIABLE OGRE_VERSION)
104
+ @@ -451,25 +447,22 @@ if (PKG_CONFIG_FOUND)
105
+ set(ogre_cflags ${ogre_cflags} ${OGRE_CFLAGS})
106
+ endif ()
107
+
108
+ - pkg_check_modules(OGRE-Terrain OGRE-Terrain)
109
+ - if (OGRE-Terrain_FOUND)
110
+ - set(ogre_ldflags ${ogre_ldflags} ${OGRE-Terrain_LDFLAGS})
111
+ - set(ogre_include_dirs ${ogre_include_dirs} ${OGRE-Terrain_INCLUDE_DIRS})
112
+ - set(ogre_libraries ${ogre_libraries};${OGRE-Terrain_LIBRARIES})
113
+ - set(ogre_library_dirs ${ogre_library_dirs} ${OGRE-Terrain_LIBRARY_DIRS})
114
+ - set(ogre_cflags ${ogre_cflags} ${OGRE-Terrain_CFLAGS})
115
+ + if (OGRE_Terrain_FOUND)
116
+ + set(ogre_ldflags ${ogre_ldflags} ${OGRE_Terrain_LDFLAGS})
117
+ + set(ogre_include_dirs ${ogre_include_dirs} ${OGRE_Terrain_INCLUDE_DIRS})
118
+ + set(ogre_libraries ${ogre_libraries};${OGRE_Terrain_LIBRARIES})
119
+ + set(ogre_library_dirs ${ogre_library_dirs} ${OGRE_Terrain_LIBRARY_DIRS})
120
+ + set(ogre_cflags ${ogre_cflags} ${OGRE_Terrain_CFLAGS})
121
+ endif()
122
+
123
+ - pkg_check_modules(OGRE-Overlay OGRE-Overlay)
124
+ - if (OGRE-Overlay_FOUND)
125
+ - set(ogre_ldflags ${ogre_ldflags} ${OGRE-Overlay_LDFLAGS})
126
+ - set(ogre_include_dirs ${ogre_include_dirs} ${OGRE-Overlay_INCLUDE_DIRS})
127
+ - set(ogre_libraries ${ogre_libraries};${OGRE-Overlay_LIBRARIES})
128
+ - set(ogre_library_dirs ${ogre_library_dirs} ${OGRE-Overlay_LIBRARY_DIRS})
129
+ - set(ogre_cflags ${ogre_cflags} ${OGRE-Overlay_CFLAGS})
130
+ + if (OGRE_Overlay_FOUND)
131
+ + set(ogre_ldflags ${ogre_ldflags} ${OGRE_Overlay_LDFLAGS})
132
+ + set(ogre_include_dirs ${ogre_include_dirs} ${OGRE_Overlay_INCLUDE_DIRS})
133
+ + set(ogre_libraries ${ogre_libraries};${OGRE_Overlay_LIBRARIES})
134
+ + set(ogre_library_dirs ${ogre_library_dirs} ${OGRE_Overlay_LIBRARY_DIRS})
135
+ + set(ogre_cflags ${ogre_cflags} ${OGRE_Overlay_CFLAGS})
136
+ endif()
137
+
138
+ -
139
+ set (OGRE_INCLUDE_DIRS ${ogre_include_dirs}
140
+ CACHE INTERNAL "Ogre include path")
141
+
142
+ @@ -549,7 +542,7 @@ if (PKG_CONFIG_FOUND)
24
143
endif ()
25
144
26
145
if (libavutil_FOUND AND libavformat_FOUND AND libavcodec_FOUND AND
@@ -29,7 +148,7 @@ index 4085b5aaeb..f89ac88333 100644
29
148
set (HAVE_FFMPEG TRUE)
30
149
else ()
31
150
set (HAVE_FFMPEG FALSE)
32
- @@ -538 ,7 +538 ,7 @@ if (PKG_CONFIG_FOUND)
151
+ @@ -574 ,7 +567 ,7 @@ if (PKG_CONFIG_FOUND)
33
152
########################################
34
153
# Find GNU Triangulation Surface Library
35
154
pkg_check_modules(gts gts)
@@ -38,7 +157,7 @@ index 4085b5aaeb..f89ac88333 100644
38
157
message (STATUS "Looking for GTS - found")
39
158
set (HAVE_GTS TRUE)
40
159
else ()
41
- @@ -551,13 +551,14 @@ if (PKG_CONFIG_FOUND)
160
+ @@ -587,7 +580,7 @@ if (PKG_CONFIG_FOUND)
42
161
# First and preferred option is to look for bullet standard pkgconfig,
43
162
# so check it first. if it is not present, check for the OSRF
44
163
# custom bullet2.82.pc file
@@ -47,14 +166,15 @@ index 4085b5aaeb..f89ac88333 100644
47
166
if (NOT BULLET_FOUND)
48
167
pkg_check_modules(BULLET bullet2.82>=2.82)
49
168
endif()
50
-
169
+ @@ -596,6 +589,7 @@ if (PKG_CONFIG_FOUND)
170
+ endif()
51
171
if (BULLET_FOUND)
52
172
set (HAVE_BULLET TRUE)
53
173
+ set(BULLET_VERSION ${BULLET_VERSION_STRING})
54
- add_definitions( -DLIBBULLET_VERSION= ${BULLET_VERSION} )
55
- else( )
56
- set (HAVE_BULLET FALSE )
57
- @@ -572 ,7 +573 ,7 @@ if (PKG_CONFIG_FOUND)
174
+ if ( ${BULLET_VERSION} STREQUAL "" )
175
+ set (BULLET_VERSION ${BULLET_VERSION_STRING} )
176
+ endif( )
177
+ @@ -614 ,7 +608 ,7 @@ if (PKG_CONFIG_FOUND)
58
178
########################################
59
179
# Find libusb
60
180
pkg_check_modules(libusb-1.0 libusb-1.0)
@@ -63,7 +183,7 @@ index 4085b5aaeb..f89ac88333 100644
63
183
BUILD_WARNING ("libusb-1.0 not found. USB peripherals support will be disabled.")
64
184
set (HAVE_USB OFF CACHE BOOL "HAVE USB" FORCE)
65
185
else()
66
- @@ -648 ,7 +649 ,7 @@ endif ()
186
+ @@ -690 ,7 +684 ,7 @@ endif ()
67
187
########################################
68
188
# Find gdal
69
189
include (FindGDAL)
@@ -72,7 +192,7 @@ index 4085b5aaeb..f89ac88333 100644
72
192
message (STATUS "Looking for libgdal - not found")
73
193
BUILD_WARNING ("GDAL not found, Digital elevation terrains support will be disabled.")
74
194
set (HAVE_GDAL OFF CACHE BOOL "HAVE GDAL" FORCE)
75
- @@ -718 ,7 +719 ,7 @@ endif()
195
+ @@ -774 ,7 +768 ,7 @@ endif()
76
196
########################################
77
197
# Find graphviz
78
198
include (${gazebo_cmake_dir}/FindGraphviz.cmake)
@@ -82,10 +202,17 @@ index 4085b5aaeb..f89ac88333 100644
82
202
BUILD_WARNING ("Graphviz not found, Model editor's schematic view will be disabled.")
83
203
set (HAVE_GRAPHVIZ OFF CACHE BOOL "HAVE GRAPHVIZ" FORCE)
84
204
diff --git a/cmake/gazebo-config.cmake.in b/cmake/gazebo-config.cmake.in
85
- index b57a90dd76..63ce97095e 100644
205
+ index ac1de2c..05cdc02 100644
86
206
--- a/cmake/gazebo-config.cmake.in
87
207
+++ b/cmake/gazebo-config.cmake.in
88
- @@ -99,12 +99,13 @@ list(APPEND @PKG_NAME@_CFLAGS -I${GAZEBO_INSTALL_INCLUDE_DIR}/gazebo-@GAZEBO_MAJ
208
+ @@ -1,3 +1,6 @@
209
+ + include(CMakeFindDependencyMacro)
210
+ + find_dependency(freeimage CONFIG)
211
+ +
212
+ if (@PKG_NAME@_CONFIG_INCLUDED)
213
+ return()
214
+ endif()
215
+ @@ -99,12 +102,13 @@ list(APPEND @PKG_NAME@_CFLAGS -I${GAZEBO_INSTALL_INCLUDE_DIR}/gazebo-@GAZEBO_MAJ
89
216
90
217
if (GAZEBO_HAS_BULLET)
91
218
if (PKG_CONFIG_FOUND)
@@ -100,3 +227,16 @@ index b57a90dd76..63ce97095e 100644
100
227
add_definitions(-DLIBBULLET_VERSION=${BULLET_VERSION})
101
228
else()
102
229
message(FATAL_ERROR "Error: Bullet > 2.82 not found, please install libbullet2.82-dev.")
230
+ diff --git a/gazebo/rendering/ogre_gazebo.h b/gazebo/rendering/ogre_gazebo.h
231
+ index a171782..c390d14 100644
232
+ --- a/gazebo/rendering/ogre_gazebo.h
233
+ +++ b/gazebo/rendering/ogre_gazebo.h
234
+ @@ -66,7 +66,7 @@
235
+ #if OGRE_VERSION_MAJOR > 1 || OGRE_VERSION_MINOR >= 7
236
+ #include <OGRE/RTShaderSystem/OgreRTShaderSystem.h>
237
+ #include <OGRE/RTShaderSystem/OgreShaderProgramSet.h>
238
+ - #include <OGRE/RTShaderSystem/OgreShaderGLSLProgramWriter.h>
239
+ + #include <OGRE/RTShaderSystem/OgreShaderProgramWriter.h>
240
+ #include <OGRE/RTShaderSystem/OgreShaderProgramWriterManager.h>
241
+ #include <OGRE/RTShaderSystem/OgreShaderFunction.h>
242
+ #include <OGRE/RTShaderSystem/OgreShaderProgram.h>
0 commit comments