Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 112 additions & 18 deletions ports/gazebo/0001-Fix-deps.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,120 @@
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
index 4085b5aaeb..f89ac88333 100644
diff --git a/cmake/FindFreeimage.cmake b/cmake/FindFreeimage.cmake
--- a/cmake/FindFreeimage.cmake
+++ b/cmake/FindFreeimage.cmake
@@ -2,16 +2,19 @@
include (${gazebo_cmake_dir}/GazeboUtils.cmake)

########################################
# Find packages
+if(false)
if (PKG_CONFIG_FOUND)
pkg_check_modules(freeimage freeimage>=${MIN_FREEIMAGE_VERSION})
if (NOT freeimage_FOUND)
message (STATUS " freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.")
endif (NOT freeimage_FOUND)
endif (PKG_CONFIG_FOUND)
+endif()

if (NOT freeimage_FOUND)
+ if (false)
find_path(freeimage_INCLUDE_DIRS FreeImage.h)
if (NOT freeimage_INCLUDE_DIRS)
message (STATUS " Looking for FreeImage.h - not found")
BUILD_ERROR("Missing: Unable to find FreeImage.h")
@@ -32,8 +35,13 @@
message (STATUS " Looking for FreeImage.h - found")
endif (NOT FREEIMAGE_RUNS)
endif (NOT freeimage_INCLUDE_DIRS)

+ endif()
+
+ find_package(freeimage CONFIG REQUIRED)
+ set(freeimage_LIBRARIES freeimage::FreeImage)
+ if (0)
if (WIN32)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
find_library(freeimage_LIBRARIES FreeImaged)
else()
@@ -48,5 +56,6 @@
else (NOT freeimage_LIBRARIES)
message (STATUS " Looking for libfreeimage - found")
include_directories(${freeimage_INCLUDE_DIRS})
endif (NOT freeimage_LIBRARIES)
+ endif()
endif (NOT freeimage_FOUND)
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
index 9777a46..be03eb8 100644
--- a/cmake/SearchForStuff.cmake
+++ b/cmake/SearchForStuff.cmake
@@ -179,7 +179,7 @@ if (PKG_CONFIG_FOUND)
# (needed, at least, for MacOS)
@@ -32,7 +32,9 @@
########################################
# The Google Protobuf library for message generation + serialization
-find_package(Protobuf REQUIRED)
+find_package(PROTOBUF NAMES protobuf REQUIRED)
+set(GZ_PROTOBUF_LIBRARY protobuf::libprotobuf protobuf::libprotobuf-lite)
+set(GZ_PROTOBUF_PROTOC_LIBRARY protobuf::libprotoc)
if (NOT PROTOBUF_FOUND)
BUILD_ERROR ("Missing: Google Protobuf (libprotobuf-dev)")
endif()
if (NOT PROTOBUF_PROTOC_EXECUTABLE)
@@ -45,9 +43,11 @@
+if(0)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set (GZ_PROTOBUF_LIBRARY ${PROTOBUF_LIBRARY_DEBUG})
set (GZ_PROTOBUF_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY_DEBUG})
else()
set (GZ_PROTOBUF_LIBRARY ${PROTOBUF_LIBRARY})
set (GZ_PROTOBUF_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY})
endif()
+endif()

########################################
@@ -144,7 +148,12 @@ if (PKG_CONFIG_FOUND)
# Find Simbody
set(SimTK_INSTALL_DIR ${SimTK_INSTALL_PREFIX})
#list(APPEND CMAKE_MODULE_PATH ${SimTK_INSTALL_PREFIX}/share/cmake)
- find_package(Simbody)
+ find_package(Simbody CONFIG REQUIRED)
+ if (TARGET SimTKmath_static)
+ set(Simbody_LIBRARIES SimTKmath_static SimTKcommon_static SimTKsimbody_static)
+ else()
+ set(Simbody_LIBRARIES SimTKmath SimTKcommon SimTKsimbody)
+ endif()
if (Simbody_FOUND)
message (STATUS "Looking for Simbody - found")
set (HAVE_SIMBODY TRUE)
@@ -188,4 +190,4 @@ if (PKG_CONFIG_FOUND)
# Use system installation on UNIX and Apple, and internal copy on Windows
- if (UNIX OR APPLE)
+ if (true)
message (STATUS "Using system tinyxml.")
set (USE_EXTERNAL_TINYXML True)
set (USE_EXTERNAL_TINYXML_DEFAULT_VALUE ON)
elseif(WIN32)
@@ -225,7 +225,7 @@ if (PKG_CONFIG_FOUND)
# (needed, at least, for MacOS)

@@ -237,4 +239,4 @@ if (PKG_CONFIG_FOUND)
# Use system installation on UNIX and Apple, and internal copy on Windows
- if (UNIX OR APPLE)
+ if (true)
message (STATUS "Using system tinyxml2.")
set (USE_EXTERNAL_TINYXML2 True)
set (USE_EXTERNAL_TINYXML2_DEFAULT_VALUE ON)
elseif(WIN32)
@@ -513,7 +513,7 @@ if (PKG_CONFIG_FOUND)
@@ -341,6 +350,7 @@ if (PKG_CONFIG_FOUND)
#################################################
# Find OGRE

+ if (false)
pkg_check_modules(OGRE-RTShaderSystem
OGRE-RTShaderSystem>=${MIN_OGRE_VERSION})

@@ -387,8 +397,8 @@ if (PKG_CONFIG_FOUND)
set (OGRE_PLUGINDIR ${_pkgconfig_invoke_result})
endif()
endif()
-
- if (NOT OGRE_FOUND)
+ endif()
+ if (true)
# Workaround for CMake bug https://gitlab.kitware.com/cmake/cmake/issues/17135,
# that prevents to successfully run a find_package(<package>) call if before there
# was a failed call to pkg_check_modules(<package> <package>)
@@ -525,7 +535,7 @@ if (PKG_CONFIG_FOUND)
endif ()

if (libavutil_FOUND AND libavformat_FOUND AND libavcodec_FOUND AND
Expand All @@ -29,7 +123,7 @@ index 4085b5aaeb..f89ac88333 100644
set (HAVE_FFMPEG TRUE)
else ()
set (HAVE_FFMPEG FALSE)
@@ -538,7 +538,7 @@ if (PKG_CONFIG_FOUND)
@@ -550,7 +560,7 @@ if (PKG_CONFIG_FOUND)
########################################
# Find GNU Triangulation Surface Library
pkg_check_modules(gts gts)
Expand All @@ -38,7 +132,7 @@ index 4085b5aaeb..f89ac88333 100644
message (STATUS "Looking for GTS - found")
set (HAVE_GTS TRUE)
else ()
@@ -551,13 +551,14 @@ if (PKG_CONFIG_FOUND)
@@ -563,13 +573,14 @@ if (PKG_CONFIG_FOUND)
# First and preferred option is to look for bullet standard pkgconfig,
# so check it first. if it is not present, check for the OSRF
# custom bullet2.82.pc file
Expand All @@ -54,7 +148,7 @@ index 4085b5aaeb..f89ac88333 100644
add_definitions( -DLIBBULLET_VERSION=${BULLET_VERSION} )
else()
set (HAVE_BULLET FALSE)
@@ -572,7 +573,7 @@ if (PKG_CONFIG_FOUND)
@@ -584,7 +595,7 @@ if (PKG_CONFIG_FOUND)
########################################
# Find libusb
pkg_check_modules(libusb-1.0 libusb-1.0)
Expand All @@ -63,7 +157,7 @@ index 4085b5aaeb..f89ac88333 100644
BUILD_WARNING ("libusb-1.0 not found. USB peripherals support will be disabled.")
set (HAVE_USB OFF CACHE BOOL "HAVE USB" FORCE)
else()
@@ -648,7 +649,7 @@ endif ()
@@ -660,7 +671,7 @@ endif ()
########################################
# Find gdal
include (FindGDAL)
Expand All @@ -72,7 +166,7 @@ index 4085b5aaeb..f89ac88333 100644
message (STATUS "Looking for libgdal - not found")
BUILD_WARNING ("GDAL not found, Digital elevation terrains support will be disabled.")
set (HAVE_GDAL OFF CACHE BOOL "HAVE GDAL" FORCE)
@@ -718,7 +719,7 @@ endif()
@@ -744,7 +755,7 @@ endif()
########################################
# Find graphviz
include (${gazebo_cmake_dir}/FindGraphviz.cmake)
Expand All @@ -82,7 +176,7 @@ index 4085b5aaeb..f89ac88333 100644
BUILD_WARNING ("Graphviz not found, Model editor's schematic view will be disabled.")
set (HAVE_GRAPHVIZ OFF CACHE BOOL "HAVE GRAPHVIZ" FORCE)
diff --git a/cmake/gazebo-config.cmake.in b/cmake/gazebo-config.cmake.in
index b57a90dd76..63ce97095e 100644
index b57a90d..63ce970 100644
--- a/cmake/gazebo-config.cmake.in
+++ b/cmake/gazebo-config.cmake.in
@@ -99,12 +99,13 @@ list(APPEND @PKG_NAME@_CFLAGS -I${GAZEBO_INSTALL_INCLUDE_DIR}/gazebo-@GAZEBO_MAJ
Expand Down
39 changes: 39 additions & 0 deletions ports/gazebo/add-features.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e0ae3d..eeb1ba7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -384,16 +384,18 @@ else (build_errors)
set(TEST_TYPE "UNIT")
add_subdirectory(gazebo)
add_subdirectory(media)
+ if (BUILD_TOOLS)
add_subdirectory(tools)
+ endif()
+ if (BUILD_PLUGINS)
add_subdirectory(plugins)
+ endif()
add_subdirectory(interfaces)
add_subdirectory(worlds)
add_subdirectory(models)

if (BUILD_TESTING)
add_subdirectory(test)
- else()
- add_subdirectory(test EXCLUDE_FROM_ALL)
endif()

endif (BUILD_GAZEBO)
diff --git a/gazebo/CMakeLists.txt b/gazebo/CMakeLists.txt
index 9ad9d02..5c45753 100644
--- a/gazebo/CMakeLists.txt
+++ b/gazebo/CMakeLists.txt
@@ -41,7 +41,9 @@ add_subdirectory(gui)
add_subdirectory(physics)
add_subdirectory(sensors)
add_subdirectory(util)
+if (BUILD_TESTING)
add_subdirectory(test)
+endif()

add_dependencies(gazebo_physics gazebo_msgs)
add_dependencies(gazebo_gui gazebo_msgs)
18 changes: 18 additions & 0 deletions ports/gazebo/fix-build-type.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/cmake/GazeboUtils.cmake b/cmake/GazeboUtils.cmake
index f1710e9..ace50f9 100644
--- a/cmake/GazeboUtils.cmake
+++ b/cmake/GazeboUtils.cmake
@@ -146,13 +146,11 @@ endmacro ()
#################################################
macro (gz_setup_unix)
# Using dynamic linking in UNIX by default
- set(BUILD_SHARED_LIBS TRUE)
endmacro()

#################################################
macro (gz_setup_windows)
# Using dynamic linking in Windows by default
- set(BUILD_SHARED_LIBS TRUE)
add_definitions(-DWIN32_LEAN_AND_MEAN)

# Need for M_PI constant
13 changes: 13 additions & 0 deletions ports/gazebo/fix-msgs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/gazebo/msgs/msgs.cc b/gazebo/msgs/msgs.cc
--- a/gazebo/msgs/msgs.cc
+++ b/gazebo/msgs/msgs.cc
@@ -16,8 +16,9 @@
*/

#include <google/protobuf/descriptor.h>
#include <algorithm>
+#include <array>
#include <ignition/math/MassMatrix3.hh>
#include <ignition/math/Rand.hh>

#include "gazebo/common/CommonIface.hh"
13 changes: 13 additions & 0 deletions ports/gazebo/fix-opengl-def.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/gazebo/rendering/RenderEngine.cc b/gazebo/rendering/RenderEngine.cc
index 87d78ea95d..bd90493266 100644
--- a/gazebo/rendering/RenderEngine.cc
+++ b/gazebo/rendering/RenderEngine.cc
@@ -22,6 +22,8 @@

// Not Apple or Windows
#if not defined(__APPLE__) && not defined(_WIN32)
+#define GL_GLEXT_LEGACY
+#define GLX_GLXEXT_LEGACY
# include <X11/Xlib.h>
# include <X11/Xutil.h>
# include <GL/glx.h>
32 changes: 17 additions & 15 deletions ports/gazebo/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
vcpkg_download_distfile(gazebo3211
URLS "https://patch-diff.githubusercontent.com/raw/osrf/gazebo/pull/3211.diff"
FILENAME "gazebo3211.diff"
SHA512 761e254866d4705acc0b81479285f979c436b3b611739a207a575031d8a8daba48de4fc0c8de5edb9a9f89725586c5caeef9e6e1e3d63a2d961ca09df974f7de
)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO osrf/gazebo
REF 382dcc3f36095a8d79b5bc9c8b8ad346e867c51d
SHA512 57638cd0b23b5f2bfd32fdc159d6cd77ca34e3bd695c225591979aef4b7271eac93d3706fa1ffa2340f90013267a4171bebe1e4c142f19ad2bf67963dfed627e
HEAD_REF gazebo11
REPO gazebosim/gazebo-classic
REF gazebo11_${VERSION}
SHA512 50a5160dc1fb30cd517bf6937675359e2db01a46eeacad5e1ca5cf61ee36bcb4a9d425d6dabe32fecb705989fb54f2ad807b43b7f39f88a871e1bec9d3f6c70a
PATCHES
0001-Fix-deps.patch
"${gazebo3211}"
fix-tbb.patch # Effectively https://github.com/osrf/gazebo/pull/3174 with merge conflict resolutions
fix-build-type.patch
fix-opengl-def.patch
add-features.patch
fix-msgs.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
openal HAVE_OPENAL
ffmpeg FFMPEG_FEATURE
gts GTS_FEATURE
plugins BUILD_PLUGINS
tools BUILD_TOOLS
INVERTED_FEATURES
simbody CMAKE_DISABLE_FIND_PACKAGE_Simbody
dart CMAKE_DISABLE_FIND_PACKAGE_DART
Expand All @@ -33,9 +30,10 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DUSE_EXTERNAL_TINY_PROCESS_LIBRARY=ON
"-DPKG_CONFIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf${VCPKG_HOST_EXECUTABLE_SUFFIX}"
${FEATURE_OPTIONS}
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
-DBUILD_TESTING=OFF # Not enabled by default, but to be sure
)

Expand All @@ -50,11 +48,15 @@ foreach(postfix "" "-11")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}${postfix}/setup.sh" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../..")
endforeach()

set(BINARIES_LIST gazebo gzclient gzserver)
if (BUILD_TOOLS)
set(BINARIES_LIST ${BINARIES_LIST} gz)
endif()
vcpkg_copy_tools(
TOOL_NAMES gazebo gz gzclient gzserver
TOOL_NAMES ${BINARIES_LIST}
AUTO_CLEAN
)
set(EXTRA_OGRE_LIBS Codec_EXR Codec_FreeImage Codec_STBI OgreBites OgreMain OgreMeshLodGenerator OgreOverlay OgrePaging OgreProperty OgreRTShaderSystem OgreTerrain OgreVolume Plugin_BSPSceneManager Plugin_DotScene Plugin_OctreeSceneManager Plugin_OctreeZone Plugin_ParticleFX Plugin_PCZSceneManager RenderSystem_Direct3D11 RenderSystem_GL RenderSystem_GL3Plus)
set(EXTRA_OGRE_LIBS Codec_FreeImage Codec_STBI OgreBites OgreMain OgreMeshLodGenerator OgreOverlay OgrePaging OgreProperty OgreRTShaderSystem OgreTerrain OgreVolume Plugin_BSPSceneManager Plugin_DotScene Plugin_OctreeSceneManager Plugin_OctreeZone Plugin_ParticleFX Plugin_PCZSceneManager RenderSystem_Direct3D11 RenderSystem_GL RenderSystem_GL3Plus)
foreach(LIB IN LISTS EXTRA_OGRE_LIBS)
set(FILE_NAME "${CMAKE_SHARED_LIBRARY_PREFIX}${LIB}${CMAKE_SHARED_LIBRARY_SUFFIX}")
file(COPY "${CURRENT_INSTALLED_DIR}/bin/${FILE_NAME}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
Expand Down
Loading