Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
2edc4ee
fix pkgconf for linux
talregev May 28, 2022
66e829c
Fix dependency ogre
May 30, 2022
aa79376
add port libtar
May 30, 2022
c4e7c38
remove unnecessary dependencies
May 30, 2022
64559fd
version
May 30, 2022
7f59993
Fix freeimage
May 30, 2022
1f2be0b
Add dependency freeimage
May 30, 2022
bf46d3b
Re-fix dependency freeimage
May 31, 2022
fd9b1d9
Add dependency simbody on non-Windows
May 31, 2022
f9d49bb
Fix dependency simbody
May 31, 2022
560c29e
Merge branch 'master' of https://github.com/microsoft/vcpkg into TalR…
Jun 17, 2022
6ce4a85
Merge branch 'master' of https://github.com/microsoft/vcpkg into TalR…
Jun 24, 2022
db22d08
Fix dependency simdbody and protobuf
Jun 29, 2022
27669ab
Fix build type
Jun 29, 2022
247eea0
Add dependency opengl for tool gazebo
Jun 29, 2022
f1fb243
Add support value !linux temporary
Jul 1, 2022
954941b
versopm
Jul 1, 2022
f1eb05e
fix pkgconf for linux
talregev Jul 7, 2022
cdc066a
Fix dependency ogre
May 30, 2022
d0cea5b
add port libtar
May 30, 2022
3e1225f
remove unnecessary dependencies
May 30, 2022
5a1341a
version
May 30, 2022
5f7ca2c
Fix freeimage
May 30, 2022
3d822c4
Add dependency freeimage
May 30, 2022
4f6e799
Re-fix dependency freeimage
May 31, 2022
1694553
Add dependency simbody on non-Windows
May 31, 2022
3f01142
Fix dependency simbody
May 31, 2022
8e3db63
Fix dependency simdbody and protobuf
Jun 29, 2022
d1bba35
Fix build type
Jun 29, 2022
2c10644
Add dependency opengl for tool gazebo
Jun 29, 2022
513c471
Add support value !linux temporary
Jul 1, 2022
5995a55
versopm
Jul 1, 2022
5f2216f
fix libtar vcpkg.json file.
talregev Jul 2, 2022
7dc9f7f
Fix gazebo version
talregev Jul 2, 2022
ca66961
fix opengl def
talregev Jul 2, 2022
6aa9b5a
Merge branch 'TalR/fix_gazebo' of https://github.com/talregev/vcpkg i…
Jul 11, 2022
f8e8342
Merge branch 'master' of https://github.com/microsoft/vcpkg into TalR…
Jul 11, 2022
487219f
Update
Jul 11, 2022
efcda83
Merge branch 'master' of https://github.com/microsoft/vcpkg into TalR…
Jul 12, 2022
30902c2
Remove supports expression
Jul 12, 2022
9c81851
Fix find dependencies using pkgconfig
Jul 13, 2022
f44ae79
fix libtar description
talregev Jul 13, 2022
38c0aa1
Fix test and plugin
Jul 14, 2022
93128d8
./vcpkg x-add-version --all --overwrite-version
talregev Jul 16, 2022
aa120cb
fix freeimage dependency
talregev Jul 16, 2022
feb8d37
revert fix freeimage dependency
talregev Jul 16, 2022
278c5f2
Add feature tools, re-generate patches, fix feature tool condition
Jul 20, 2022
fbcb869
Merge branch 'master' of https://github.com/microsoft/vcpkg into TalR…
Jul 21, 2022
489ea98
Merge branch 'master' into TalR/fix_gazebo
JackBoosY Aug 4, 2022
7f42da1
Merge branch 'master' into TalR/fix_gazebo
talregev Aug 22, 2022
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
114 changes: 103 additions & 11 deletions ports/gazebo/0001-Fix-deps.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,81 @@
diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
index 4085b5aaeb..f89ac88333 100644
diff --git a/cmake/FindFreeimage.cmake b/cmake/FindFreeimage.cmake
index a989ec7..7cc6f44 100644
--- a/cmake/FindFreeimage.cmake
+++ b/cmake/FindFreeimage.cmake
@@ -3,7 +3,7 @@ include (${gazebo_cmake_dir}/GazeboUtils.cmake)

########################################
# Find packages
-if (PKG_CONFIG_FOUND)
+if (false)
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.")
@@ -11,6 +11,7 @@ if (PKG_CONFIG_FOUND)
endif (PKG_CONFIG_FOUND)

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")
@@ -32,7 +33,11 @@ if (NOT freeimage_FOUND)
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)
@@ -49,4 +54,5 @@ if (NOT freeimage_FOUND)
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)
@@ -31,7 +31,10 @@ endif()

########################################
# The Google Protobuf library for message generation + serialization
-find_package(Protobuf REQUIRED)
+find_package(protobuf CONFIG REQUIRED)
+set(GZ_PROTOBUF_LIBRARY protobuf::libprotobuf protobuf::libprotobuf-lite)
+set(GZ_PROTOBUF_PROTOC_LIBRARY protobuf::libprotoc)
+if (0)
if (NOT PROTOBUF_FOUND)
BUILD_ERROR ("Missing: Google Protobuf (libprotobuf-dev)")
endif()
@@ -49,6 +52,7 @@ else()
set (GZ_PROTOBUF_LIBRARY ${PROTOBUF_LIBRARY})
set (GZ_PROTOBUF_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY})
endif()
+endif()

########################################
include (FindOpenGL)
@@ -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)
@@ -179,7 +188,7 @@ if (PKG_CONFIG_FOUND)
# (needed, at least, for MacOS)

# Use system installation on UNIX and Apple, and internal copy on Windows
Expand All @@ -11,7 +84,7 @@ index 4085b5aaeb..f89ac88333 100644
message (STATUS "Using system tinyxml.")
set (USE_EXTERNAL_TINYXML True)
elseif(WIN32)
@@ -225,7 +225,7 @@ if (PKG_CONFIG_FOUND)
@@ -225,7 +234,7 @@ if (PKG_CONFIG_FOUND)
# (needed, at least, for MacOS)

# Use system installation on UNIX and Apple, and internal copy on Windows
Expand All @@ -20,7 +93,26 @@ index 4085b5aaeb..f89ac88333 100644
message (STATUS "Using system tinyxml2.")
set (USE_EXTERNAL_TINYXML2 True)
elseif(WIN32)
@@ -513,7 +513,7 @@ if (PKG_CONFIG_FOUND)
@@ -329,6 +338,7 @@ if (PKG_CONFIG_FOUND)
#################################################
# Find OGRE

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

@@ -375,8 +385,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>)
@@ -513,7 +523,7 @@ if (PKG_CONFIG_FOUND)
endif ()

if (libavutil_FOUND AND libavformat_FOUND AND libavcodec_FOUND AND
Expand All @@ -29,7 +121,7 @@ index 4085b5aaeb..f89ac88333 100644
set (HAVE_FFMPEG TRUE)
else ()
set (HAVE_FFMPEG FALSE)
@@ -538,7 +538,7 @@ if (PKG_CONFIG_FOUND)
@@ -538,7 +548,7 @@ if (PKG_CONFIG_FOUND)
########################################
# Find GNU Triangulation Surface Library
pkg_check_modules(gts gts)
Expand All @@ -38,7 +130,7 @@ index 4085b5aaeb..f89ac88333 100644
message (STATUS "Looking for GTS - found")
set (HAVE_GTS TRUE)
else ()
@@ -551,13 +551,14 @@ if (PKG_CONFIG_FOUND)
@@ -551,13 +561,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 +146,7 @@ index 4085b5aaeb..f89ac88333 100644
add_definitions( -DLIBBULLET_VERSION=${BULLET_VERSION} )
else()
set (HAVE_BULLET FALSE)
@@ -572,7 +573,7 @@ if (PKG_CONFIG_FOUND)
@@ -572,7 +583,7 @@ if (PKG_CONFIG_FOUND)
########################################
# Find libusb
pkg_check_modules(libusb-1.0 libusb-1.0)
Expand All @@ -63,7 +155,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 ()
@@ -648,7 +659,7 @@ endif ()
########################################
# Find gdal
include (FindGDAL)
Expand All @@ -72,7 +164,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()
@@ -732,7 +743,7 @@ endif()
########################################
# Find graphviz
include (${gazebo_cmake_dir}/FindGraphviz.cmake)
Expand All @@ -82,7 +174,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-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>
22 changes: 10 additions & 12 deletions ports/gazebo/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
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
REF gazebo11_11.11.0
SHA512 0f625f71ce9c6a875ac4d694cc767735243ed20922282fb1f0ef614ddeadf35e8e08e1d8484f9dbf3c873259fae93b550742deab7954c00b055890bad2b22dff
PATCHES
0001-Fix-deps.patch
${gazebo3211}
fix-build-type.patch
fix-opengl-def.patch
add-features.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 @@ -32,9 +29,10 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DUSE_EXTERNAL_TINY_PROCESS_LIBRARY=ON
-DPKG_CONFIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf${VCPKG_HOST_EXECUTABLE_SUFFIX}
${FEATURE_OPTIONS}
-DUSE_EXTERNAL_TINY_PROCESS_LIBRARY=ON
"-DPKG_CONFIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf${VCPKG_HOST_EXECUTABLE_SUFFIX}"
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Neumann-A @dg0yt
According to the cmake doc:

If this variable is not set, this behavior is enabled by default if [CMAKE_MINIMUM_REQUIRED_VERSION](https://cmake.org/cmake/help/latest/variable/CMAKE_MINIMUM_REQUIRED_VERSION.html#variable:CMAKE_MINIMUM_REQUIRED_VERSION) is 3.1 or later, disabled otherwise.

Since the minimum cmake version for some ports is lower than 3.1, CMAKE_PREFIX_PATH will not be used as PKG_CONFIG_PATH, which will cause finding dependencies to fail.
Should we always set it ON in vcpkg_cmake_configure and vcpkg toolchain?

This issue struck me twice! Total debug cost: 3 day and 1.5 hour.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to use it before (openscap, wxwidgets).
It probably should be in vcpkg_cmake_configure. But it may change the behaviour of Find modules. I didn't want to open another can of worms ;-) (I guess that's why Kitware made it depend on CMake version.) And it easily becomes a transitive usage requirements for user projects.

At least a port could opt out of a vcpkg_cmake_configure default by passing the opposite OPTION.

-DBUILD_TESTING=OFF # Not enabled by default, but to be sure
)

Expand Down
21 changes: 19 additions & 2 deletions ports/gazebo/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "gazebo",
"version-date": "2022-01-20",
"port-version": 3,
"version": "11.11.0",
"description": "Open source robotics simulator.",
"homepage": "http://gazebosim.org",
"license": "Apache-2.0",
Expand All @@ -19,6 +18,7 @@
"boost-thread",
"boost-uuid",
"ccd",
"freeimage",
{
"name": "hdf5",
"features": [
Expand All @@ -30,14 +30,23 @@
"ignition-math6",
"ignition-msgs5",
"ignition-transport8",
{
"name": "libtar",
"platform": "!windows"
},
"ogre",
"opengl",
{
"name": "pkgconf",
"host": true
},
"protobuf",
"qwt",
"sdformat9",
{
"name": "simbody",
"platform": "!windows"
},
"tbb",
"tiny-process-library",
{
Expand Down Expand Up @@ -116,11 +125,19 @@
"openal-soft"
]
},
"plugins": {
"description": "Build gazebo plugins",
"supports": "!linux"
},
"simbody": {
"description": "Use the simbody physics engine",
"dependencies": [
"simbody"
]
},
"tools": {
"description": "Build gazebo tools",
"supports": "!(linux & static)"
}
}
}
16 changes: 16 additions & 0 deletions ports/libtar/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(VCPKG_USE_HEAD_VERSION ON)
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL https://repo.or.cz/libtar.git
HEAD_REF v1.2.20
)

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_install_make()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL "${SOURCE_PATH}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
7 changes: 7 additions & 0 deletions ports/libtar/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "libtar",
"version": "1.2.20",
"description": "libtar - C library for manipulating tar files",
"homepage": "https://repo.or.cz/libtar.git",
"supports": "!windows"
}
3 changes: 0 additions & 3 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,6 @@ ftgl:arm-uwp=fail
# https://github.com/GoogleCloudPlatform/functions-framework-cpp/issues/207
functions-framework-cpp:x64-uwp=fail

# VS 2022 Update 3 seems to have broken Gazebo: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/1522474
gazebo:x64-windows=fail
gazebo:x64-linux=fail
# gsoap does not offer stable public source downloads
gsoap:x64-windows = skip
gsoap:x86-windows = skip
Expand Down
Loading