[vcpkg-ci-gz-common, gz-*,spdlog] New test port, fixes (#44389)

This commit is contained in:
Kai Pastor 2025-03-24 18:28:31 +01:00 committed by GitHub
parent e4e0ab6b59
commit 16f700e5db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 307 additions and 220 deletions

View File

@ -1,70 +0,0 @@
diff --git a/cmake/FindAVCODEC.cmake b/cmake/FindAVCODEC.cmake
--- a/cmake/FindAVCODEC.cmake
+++ b/cmake/FindAVCODEC.cmake
@@ -15,9 +15,9 @@
#
########################################
# Find avcodec
include(GzPkgConfig)
-gz_pkg_check_modules_quiet(AVCODEC libavcodec)
+gz_pkg_check_modules_quiet(AVCODEC libavcodec INTERFACE)
if(NOT AVCODEC_FOUND)
include(GzManualSearch)
gz_manual_search(AVCODEC
diff --git a/cmake/FindAVDEVICE.cmake b/cmake/FindAVDEVICE.cmake
--- a/cmake/FindAVDEVICE.cmake
+++ b/cmake/FindAVDEVICE.cmake
@@ -19,9 +19,9 @@
set(av_minor ${AVDEVICE_FIND_VERSION_MINOR})
set(av_patch ${AVDEVICE_FIND_VERSION_PATCH})
include(GzPkgConfig)
-gz_pkg_check_modules_quiet(AVDEVICE "libavdevice >= ${av_major}.${av_minor}.${av_patch}")
+gz_pkg_check_modules_quiet(AVDEVICE "libavdevice >= ${av_major}.${av_minor}.${av_patch}" INTERFACE)
if(NOT AVDEVICE_FOUND)
include(GzManualSearch)
gz_manual_search(AVDEVICE
diff --git a/cmake/FindAVFORMAT.cmake b/cmake/FindAVFORMAT.cmake
--- a/cmake/FindAVFORMAT.cmake
+++ b/cmake/FindAVFORMAT.cmake
@@ -15,9 +15,9 @@
#
########################################
# Find AV format
include(GzPkgConfig)
-gz_pkg_check_modules_quiet(AVFORMAT libavformat)
+gz_pkg_check_modules_quiet(AVFORMAT libavformat INTERFACE)
if(NOT AVFORMAT_FOUND)
include(GzManualSearch)
gz_manual_search(AVFORMAT
diff --git a/cmake/FindAVUTIL.cmake b/cmake/FindAVUTIL.cmake
--- a/cmake/FindAVUTIL.cmake
+++ b/cmake/FindAVUTIL.cmake
@@ -15,9 +15,9 @@
#
########################################
# Find avutil
include(GzPkgConfig)
-gz_pkg_check_modules_quiet(AVUTIL libavutil)
+gz_pkg_check_modules_quiet(AVUTIL libavutil INTERFACE)
if(NOT AVUTIL_FOUND)
include(GzManualSearch)
gz_manual_search(AVUTIL
diff --git a/cmake/FindSWSCALE.cmake b/cmake/FindSWSCALE.cmake
--- a/cmake/FindSWSCALE.cmake
+++ b/cmake/FindSWSCALE.cmake
@@ -15,9 +15,9 @@
#
########################################
# Find libswscale format
include(GzPkgConfig)
-gz_pkg_check_modules_quiet(SWSCALE libswscale)
+gz_pkg_check_modules_quiet(SWSCALE libswscale INTERFACE)
if(NOT SWSCALE_FOUND)
include(GzManualSearch)
gz_manual_search(SWSCALE

View File

@ -1,28 +1,34 @@
diff --git a/cmake/FindFreeImage.cmake b/cmake/FindFreeImage.cmake
index 8a5836e..7f926cc 100644
index 8a5836e..d7e41d2 100644
--- a/cmake/FindFreeImage.cmake
+++ b/cmake/FindFreeImage.cmake
@@ -23,7 +23,17 @@ set(minor_version ${FreeImage_FIND_VERSION_MINOR})
@@ -23,7 +23,23 @@ set(minor_version ${FreeImage_FIND_VERSION_MINOR})
# Set the full version number
set(full_version ${major_version}.${minor_version})
-if (NOT WIN32)
+if(FreeImage_FOUND)
+ # done
+elseif(1)
+ find_package(freeimage CONFIG)
+if(1)
+ find_package(freeimage CONFIG) # not using NAMES to avoid version check
+ if(freeimage_FOUND)
+ set(FreeImage_FOUND 1)
+ set(FreeImage_LIBRARIES freeimage::FreeImage)
+ include(GzImportTarget)
+ gz_import_target(FreeImage INTERFACE)
+ # sorry, no transitive link libs for pkgconfig
+ include(GzPkgConfig)
+ find_library(FreeImage_LIBRARY NAMES FreeImage FreeImaged NAMES_PER_DIR)
+ if(FreeImage_LIBRARY MATCHES "FreeImaged[^/]*\$")
+ gz_pkg_config_library_entry(FreeImage "FreeImaged")
+ else()
+ gz_pkg_config_library_entry(FreeImage "FreeImage")
+ endif()
+ endif()
+elseif(0)
include(GzPkgConfig)
gz_pkg_config_library_entry(FreeImage freeimage)
diff --git a/cmake/FindGTS.cmake b/cmake/FindGTS.cmake
index b400483..77f1247 100644
index b400483..48cf9f7 100644
--- a/cmake/FindGTS.cmake
+++ b/cmake/FindGTS.cmake
@@ -16,7 +16,7 @@
@ -30,12 +36,12 @@ index b400483..77f1247 100644
# Find GNU Triangulation Surface Library
-if (NOT WIN32)
+if (1)
+if(1)
# Configuration using pkg-config modules
include(GzPkgConfig)
gz_pkg_check_modules(GTS gts)
diff --git a/cmake/FindGzBullet.cmake b/cmake/FindGzBullet.cmake
index 70f7a76..4a334d9 100644
index 70f7a76..e39a3fd 100644
--- a/cmake/FindGzBullet.cmake
+++ b/cmake/FindGzBullet.cmake
@@ -31,7 +31,7 @@ endif()
@ -43,28 +49,17 @@ index 70f7a76..4a334d9 100644
# CMake. Otherwise, we may end up using the BulletConfig.cmake file distributed
# with Bullet, which uses relative paths and may break transitive dependencies.
-find_package(Bullet MODULE ${gz_quiet_arg})
+find_package(Bullet CONFIG REQUIRED)
+find_package(BULLET NAMES Bullet ${gz_quiet_arg})
set(GzBullet_FOUND false)
# create Bullet target
@@ -39,6 +39,7 @@ if(BULLET_FOUND)
set(GzBullet_FOUND true)
gz_import_target(GzBullet
+ INTERFACE
TARGET_NAME GzBullet::GzBullet
LIB_VAR BULLET_LIBRARIES
INCLUDE_VAR BULLET_INCLUDE_DIRS
diff --git a/cmake/FindGzOGRE2.cmake b/cmake/FindGzOGRE2.cmake
index 2decd84..3b71698 100644
index 2decd84..dd2c2c2 100644
--- a/cmake/FindGzOGRE2.cmake
+++ b/cmake/FindGzOGRE2.cmake
@@ -144,9 +144,9 @@ macro(get_preprocessor_entry CONTENTS KEYWORD VARIABLE)
endmacro()
@@ -146,7 +146,7 @@ endmacro()
find_package(PkgConfig QUIET)
-if (PkgConfig_FOUND)
+if (UNIX AND NOT APPLE)
if (PkgConfig_FOUND)
set(PKG_CONFIG_PATH_ORIGINAL $ENV{PKG_CONFIG_PATH})
- foreach (GZ_OGRE2_PROJECT_NAME "OGRE2" "OGRE-Next")
+ foreach (GZ_OGRE2_PROJECT_NAME "OGRE-Next")
@ -79,33 +74,49 @@ index 2decd84..3b71698 100644
set(OGRE2_LIBRARIES ${${GZ_OGRE2_PROJECT_NAME}_LIBRARIES}) # sync possible Ogre-Next ot OGRE2
else()
# look for OGRE2 installed from source
@@ -309,6 +310,8 @@ if (PkgConfig_FOUND)
@@ -264,10 +265,10 @@ if (PkgConfig_FOUND)
get_filename_component(dir_name "${dir}" NAME)
if ("${dir_name}" STREQUAL ${GZ_PKG_NAME})
set(dir_include "${dir}/RenderSystems/GL3Plus")
- else()
- set(dir_include "${dir}")
+ if(EXISTS "${dir_include}")
+ list(APPEND OGRE2_INCLUDE_DIRS "${dir_include}")
+ endif()
endif()
- list(APPEND OGRE2_INCLUDE_DIRS ${dir_include})
endforeach()
file(READ ${OGRE2_INCLUDE}/OgrePrerequisites.h OGRE_TEMP_VERSION_CONTENT)
@@ -309,6 +310,9 @@ if (PkgConfig_FOUND)
"${OGRE2LIBNAME}${component}_d"
"${OGRE2LIBNAME}${component}.${OGRE2_VERSION}"
"${OGRE2LIBNAME}${component}"
+ "${OGRE2LIBNAME}${component}Static"
+ "${OGRE2LIBNAME}${component}Static_d"
+ "${OGRE2LIBNAME}${component}Static_d"
+ NAMES_PER_DIR
HINTS ${OGRE2_LIBRARY_DIRS})
if (NOT "${OGRE2-${component}}" STREQUAL "OGRE2-${component}-NOTFOUND")
message(STATUS " + component ${component}: found")
@@ -404,13 +407,21 @@ else() #PkgConfig_FOUND
@@ -400,17 +404,22 @@ else() #PkgConfig_FOUND
set(OGRE2_VERSION_MINOR "")
set(OGRE2_RESOURCE_PATH "")
- set(OGRE2_SEARCH_VER "OGRE-${GzOGRE2_FIND_VERSION_MAJOR}.${GzOGRE2_FIND_VERSION_MINOR}")
+ set(OGRE2_SEARCH_VER "OGRE-Next")
set(OGRE2_PATHS "")
set(OGRE2_INC_PATHS "")
foreach(_rootPath ${VCPKG_CMAKE_FIND_ROOT_PATH})
- list(APPEND OGRE2_PATHS "${_rootPath}/lib/${OGRE2_SEARCH_VER}/")
- list(APPEND OGRE2_PATHS "${_rootPath}/lib/${OGRE2_SEARCH_VER}/manual-link/")
- list(APPEND OGRE2_INC_PATHS "${_rootPath}/include/${OGRE2_SEARCH_VER}")
+ get_filename_component(debug_dir "${_rootPath}" NAME)
+ if(debug_dir MATCHES "debug" AND CMAKE_BUILD_TYPE MATCHES Debug OR NOT debug_dir MATCHES "debug" AND CMAKE_BUILD_TYPE MATCHES Release)
+ list(APPEND OGRE2_PATHS "${_rootPath}/lib/")
+ list(APPEND OGRE2_PATHS "${_rootPath}/lib/manual-link/")
+ endif()
+ list(APPEND OGRE2_INC_PATHS "${_rootPath}/include/OGRE-Next")
+ list(APPEND OGRE2_PATHS "${_rootPath}/lib")
+ list(APPEND OGRE2_PATHS "${_rootPath}/lib/manual-link")
list(APPEND OGRE2_INC_PATHS "${_rootPath}/include/${OGRE2_SEARCH_VER}")
endforeach()
find_library(OGRE2_LIBRARY
- NAMES "OgreMain"
+ NAMES
+ NAMES
+ "OgreNextMain"
+ "OgreNextMainStatic"
+ "OgreNextMain_d"
@ -114,7 +125,7 @@ index 2decd84..3b71698 100644
HINTS ${OGRE2_PATHS}
NO_DEFAULT_PATH)
@@ -450,8 +461,11 @@ else() #PkgConfig_FOUND
@@ -450,8 +459,11 @@ else() #PkgConfig_FOUND
find_library(${PREFIX}_LIBRARY
NAMES
@ -124,19 +135,19 @@ index 2decd84..3b71698 100644
+ "OgreNext${COMPONENT}_d"
+ "OgreNext${COMPONENT}Static"
+ "OgreNext${COMPONENT}Static_d"
+ NAMES_PER_DIR
+ NAMES_PER_DIR
HINTS
${OGRE2_LIBRARY_DIRS}
NO_DEFAULT_PATH)
@@ -510,6 +524,7 @@ else() #PkgConfig_FOUND
ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include)
ogre_find_plugin(RenderSystem_GL3Plus OgreGL3PlusRenderSystem.h RenderSystems/GL3Plus/include)
ogre_find_plugin(RenderSystem_Direct3D11 OgreD3D11RenderSystem.h RenderSystems/Direct3D11/include)
@@ -506,6 +518,7 @@ else() #PkgConfig_FOUND
ogre_find_component(Overlay OgreOverlaySystem.h "Overlay")
ogre_find_component(HlmsPbs OgreHlmsPbs.h Hlms/Pbs/)
ogre_find_component(HlmsUnlit OgreHlmsUnlit.h Hlms/Unlit)
+ ogre_find_component(PlanarReflections OgrePlanarReflections.h PlanarReflections)
foreach(component ${GzOGRE2_FIND_COMPONENTS})
set(PREFIX OGRE2_${component})
@@ -521,7 +536,7 @@ else() #PkgConfig_FOUND
ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include)
ogre_find_plugin(RenderSystem_GL3Plus OgreGL3PlusRenderSystem.h RenderSystems/GL3Plus/include)
@@ -521,7 +534,7 @@ else() #PkgConfig_FOUND
if(${HLMS_POS} GREATER -1)
foreach (dir ${OGRE2_INCLUDE_DIRS})
get_filename_component(dir_name "${dir}" NAME)
@ -145,56 +156,3 @@ index 2decd84..3b71698 100644
set(dir_include "${dir}/Hlms/Common")
if (EXISTS ${dir_include})
list(APPEND component_INCLUDE_DIRS ${dir_include})
diff --git a/cmake/FindTINYXML2.cmake b/cmake/FindTINYXML2.cmake
index 5a5a147..68ba2a3 100644
--- a/cmake/FindTINYXML2.cmake
+++ b/cmake/FindTINYXML2.cmake
@@ -18,11 +18,16 @@
include(GzPkgConfig)
-# Use pkg_check_modules to start
-gz_pkg_check_modules_quiet(TINYXML2 tinyxml2)
# If that failed, then fall back to manual detection (necessary for MacOS)
if(NOT TINYXML2_FOUND)
+ find_package(TINYXML2 NAMES tinyxml2)
+ if(TINYXML2_FOUND)
+ set(TINYXML2_LIBRARIES tinyxml2::tinyxml2)
+ include(GzImportTarget)
+ gz_import_target(TINYXML2 INTERFACE)
+ endif()
+elseif(0)
if(NOT TINYXML2_FIND_QUIETLY)
message(STATUS "Attempting manual search for tinyxml2")
diff --git a/cmake/GzFindPackage.cmake b/cmake/GzFindPackage.cmake
index 93da803..22fdec8 100644
--- a/cmake/GzFindPackage.cmake
+++ b/cmake/GzFindPackage.cmake
@@ -163,6 +163,7 @@ macro(gz_find_package PACKAGE_NAME_)
# Parse the arguments
_gz_cmake_parse_arguments(gz_find_package "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ include("${CMAKE_CURRENT_LIST_DIR}/vcpkg/${PACKAGE_NAME}.cmake" OPTIONAL)
#------------------------------------
# Construct the arguments to pass to find_package
set(${PACKAGE_NAME}_find_package_args ${PACKAGE_NAME})
@@ -177,6 +178,8 @@ macro(gz_find_package PACKAGE_NAME_)
if(gz_find_package_EXACT)
list(APPEND ${PACKAGE_NAME}_find_package_args EXACT)
+ elseif(gz_find_package_VERSION AND NOT gz_find_package_PKGCONFIG_VER_COMPARISON)
+ set(gz_find_package_PKGCONFIG_VER_COMPARISON >=)
endif()
if(gz_find_package_CONFIG)
@@ -344,7 +347,7 @@ macro(gz_find_package PACKAGE_NAME_)
# ${component}_CMAKE_DEPENDENCIES variables that are specific to those
# componenets
foreach(component ${gz_find_package_REQUIRED_BY})
- if(NOT ${component}_${PACKAGE_NAME}_PRIVATE)
+ if(NOT ${component}_${PACKAGE_NAME}_PRIVATE OR NOT BUILD_SHARED_LIBS)
gz_string_append(${component}_CMAKE_DEPENDENCIES "${${PACKAGE_NAME}_find_dependency}" DELIM "\n")
endif()
endforeach()

View File

@ -0,0 +1,22 @@
diff --git a/cmake/GzFindPackage.cmake b/cmake/GzFindPackage.cmake
index 93da803..c16e3ba 100644
--- a/cmake/GzFindPackage.cmake
+++ b/cmake/GzFindPackage.cmake
@@ -177,6 +177,8 @@ macro(gz_find_package PACKAGE_NAME_)
if(gz_find_package_EXACT)
list(APPEND ${PACKAGE_NAME}_find_package_args EXACT)
+ elseif(gz_find_package_VERSION AND NOT gz_find_package_PKGCONFIG_VER_COMPARISON)
+ set(gz_find_package_PKGCONFIG_VER_COMPARISON >=)
endif()
if(gz_find_package_CONFIG)
@@ -344,7 +346,7 @@ macro(gz_find_package PACKAGE_NAME_)
# ${component}_CMAKE_DEPENDENCIES variables that are specific to those
# componenets
foreach(component ${gz_find_package_REQUIRED_BY})
- if(NOT ${component}_${PACKAGE_NAME}_PRIVATE)
+ if(NOT ${component}_${PACKAGE_NAME}_PRIVATE OR NOT BUILD_SHARED_LIBS)
gz_string_append(${component}_CMAKE_DEPENDENCIES "${${PACKAGE_NAME}_find_dependency}" DELIM "\n")
endif()
endforeach()

View File

@ -0,0 +1,20 @@
diff --git a/cmake/GzImportTarget.cmake b/cmake/GzImportTarget.cmake
index 934df6d..aba4129 100644
--- a/cmake/GzImportTarget.cmake
+++ b/cmake/GzImportTarget.cmake
@@ -83,6 +83,15 @@ macro(gz_import_target package)
set(gz_import_target_CFLAGS_VAR ${package}_CFLAGS)
endif()
+ # In vcpkg, some <Pkg>_LIBRARIES carry targets. Example: BULLET_LIBRARIES
+ # Targets must not be used for IMPORTED_LOCATION or IMPORTED_IMPLIB.
+ if(NOT gz_import_target_INTERFACE)
+ list(GET "${gz_import_target_LIB_VAR}" 0 gz_import_target_first_item)
+ if(TARGET "${gz_import_target_first_item}")
+ set(gz_import_target_INTERFACE TRUE)
+ endif()
+ endif()
+
#------------------------------------
# Link against this "imported" target by saying
# target_link_libraries(mytarget package::package), instead of linking

View File

@ -0,0 +1,18 @@
diff --git a/cmake/GzConfigureBuild.cmake b/cmake/GzConfigureBuild.cmake
index 3122c15..f64d695 100644
--- a/cmake/GzConfigureBuild.cmake
+++ b/cmake/GzConfigureBuild.cmake
@@ -265,6 +265,13 @@ macro(gz_configure_build)
gz_string_append(skip_msg "by user request")
elseif(${component}_MISSING_DEPS)
gz_string_append(skip_msg "because the following packages are missing: ${${component}_MISSING_DEPS}")
+ if(NOT DEFINED GZ_LOCK_DEPENDENCIES OR "${GZ_LOCK_DEPENDENCIES}")
+ message(SEND_ERROR "Vcpkg ports must lock dependencies."
+ " To enable ${component}, provide missing dependencies."
+ " To disable ${component}, pass -DSKIP_${component}=true."
+ " To disable this check, pass -DGZ_LOCK_DEPENDENCIES=OFF."
+ )
+ endif()
endif()
message(STATUS "${skip_msg}")

View File

@ -0,0 +1,35 @@
diff --git a/cmake/GzPkgConfig.cmake b/cmake/GzPkgConfig.cmake
index 5fcdb76..9ff169c 100644
--- a/cmake/GzPkgConfig.cmake
+++ b/cmake/GzPkgConfig.cmake
@@ -105,6 +105,7 @@ macro(gz_pkg_check_modules_quiet package signature)
unset(${package}_LIBRARIES)
pkg_check_modules(${package}
+ IMPORTED_TARGET
${gz_pkg_check_modules_quiet_arg}
${gz_pkg_check_modules_no_cmake_environment_path_arg}
${signature})
@@ -155,15 +156,13 @@ macro(gz_pkg_check_modules_quiet package signature)
#
# TODO: How would we deal with multiple modules that are in different
# directories? How does cmake-3.6+ handle that situation?
- _gz_pkgconfig_find_libraries(
- ${package}_LIBRARIES
- ${package}
- "${${package}_LIBRARIES}"
- "${${package}_LIBRARY_DIRS}")
-
- include(GzImportTarget)
- gz_import_target(${package} ${_gz_pkg_check_modules_interface_option}
- TARGET_NAME ${gz_pkg_check_modules_TARGET_NAME})
+
+ if(NOT TARGET ${gz_pkg_check_modules_TARGET_NAME})
+ add_library(${gz_pkg_check_modules_TARGET_NAME} INTERFACE IMPORTED)
+ set_target_properties(${gz_pkg_check_modules_TARGET_NAME} PROPERTIES
+ INTERFACE_LINK_LIBRARIES PkgConfig::${package}
+ )
+ endif()
endif()

View File

@ -8,8 +8,11 @@ ignition_modular_library(
VERSION ${VERSION}
SHA512 d761aba28fc79af6bbb021215367e48e1b7449885d0410a0cabd09674a59b17132810ebb796fe0e1ddefc1510aba832fb192cc908156d8eae15e35c1afe464c7
PATCHES
dependencies.patch
ffempg_depends_interface.patch
find-modules.diff
gz-find-package.diff
gz-import-target.diff
lock-dependencies.diff
pkg-check-modules.diff
)
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)

View File

@ -1,3 +1,4 @@
The package @PORT@@VERSION_MAJOR@ provides CMake integration:
gz-cmake provides CMake integration:
find_package(@PORT@@VERSION_MAJOR@ CONFIG REQUIRED)
find_package(gz-cmake@VERSION_MAJOR@ REQUIRED)
gz_configure_project(...)

View File

@ -1,8 +1,9 @@
{
"name": "gz-cmake",
"version": "4.1.1",
"port-version": 1,
"description": "CMake helper functions for building robotic applications",
"homepage": "https://ignitionrobotics.org/libs/cmake",
"homepage": "https://gazebosim.org/libs/cmake/",
"license": null,
"dependencies": [
{

View File

@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,9 +49,8 @@
#--------------------------------------
# Find Tinyxml2
gz_find_package(TINYXML2 PRETTY tinyxml2
- VERSION 6.0
REQUIRED_BY graphics
PRIVATE_FOR graphics)
#--------------------------------------

View File

@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae68cb7..9c5f952 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,6 +45,7 @@ set(GZ_MATH_VER ${gz-math8_VERSION_MAJOR})
#--------------------------------------
# Find gz-utils
gz_find_package(gz-utils3 REQUIRED COMPONENTS log)
+list(APPEND PROJECT_PKGCONFIG_REQUIRES_PRIVATE gz-utils3-log)
set(GZ_UTILS_VER ${gz-utils3_VERSION_MAJOR})
#--------------------------------------

View File

@ -7,17 +7,9 @@ ignition_modular_library(
REF ${PORT}${VERSION_MAJOR}_${VERSION}
VERSION ${VERSION}
SHA512 0c652285b32d2d2f781595416fd80d6e52a6b765ba968d0018accc3688f4ee9d6ce62dbea74b98fa43ea40641c47020246e13645eac7940aa483057c958d3807
OPTIONS
-DBUILD_TESTING=OFF
"-DPKG_CONFIG_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/pkgconf/pkgconf${VCPKG_HOST_EXECUTABLE_SUFFIX}"
PATCHES
gz-utils3-log.diff
gz_remotery_vis.patch
pthread.diff
003-include-chrono.patch
detect_tinyxml.patch
)
foreach(component IN ITEMS av events geospatial graphics io profiler testing)
if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/share/${PORT}${VERSION_MAJOR}-${component}/${PORT}${VERSION_MAJOR}-${component}-config.cmake")
message(FATAL_ERROR "Failed to install component ${component}. Check configuration logs for missing dependencies.")
endif()
endforeach()

View File

@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c5f952..d44132e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,10 @@ endif()
#============================================================================
message(STATUS "\n\n-- ====== Finding Dependencies ======")
+gz_find_package(Threads REQUIRED IGNORE_PKGCONFIG)
+add_library(pthread ALIAS Threads::Threads)
+list(APPEND PROJECT_PKGCONFIG_LIBS_PRIVATE "${CMAKE_THREAD_LIBS_INIT}")
+
#--------------------------------------
# Find gz-math
gz_find_package(gz-math8 REQUIRED_BY geospatial graphics events)

View File

@ -1,8 +1,9 @@
{
"name": "gz-common",
"version": "6.0.2",
"port-version": 1,
"description": "Common libraries for robotics applications",
"homepage": "https://ignitionrobotics.org/libs/common",
"homepage": "https://gazebosim.org/libs/common/",
"license": "Apache-2.0",
"dependencies": [
"assimp",
@ -10,9 +11,21 @@
"name": "dlfcn-win32",
"platform": "windows | uwp"
},
"ffmpeg",
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avdevice",
"avformat",
"swscale"
]
},
"freeimage",
"gdal",
{
"name": "gdal",
"default-features": false
},
"gz-cmake",
"gz-math",
"gz-utils",
@ -24,11 +37,6 @@
"name": "libuuid",
"platform": "!windows & !osx"
},
{
"name": "pkgconf",
"host": true,
"default-features": false
},
"tinyxml2"
]
}

View File

@ -1,12 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b16b4dd1..0f5e2771 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,7 +88,6 @@ gz_find_package(DART
gz_find_package(GzBullet
VERSION 2.87
REQUIRED_BY bullet bullet-featherstone
- PKGCONFIG bullet
PKGCONFIG_VER_COMPARISON >=)
message(STATUS "-------------------------------------------\n")
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b16b4dd..3c44e8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,10 +85,14 @@ gz_find_package(DART
#--------------------------------------
# Find bullet for the bullet plugin wrapper
+set(bullet_pkgconfig PKGCONFIG bullet)
+if(WIN32)
+ set(bullet_pkgconfig PKGCONFIG_IGNORE)
+endif()
gz_find_package(GzBullet
VERSION 2.87
REQUIRED_BY bullet bullet-featherstone
- PKGCONFIG bullet
+ ${bullet_pkgconfig}
PKGCONFIG_VER_COMPARISON >=)
message(STATUS "-------------------------------------------\n")

View File

@ -7,7 +7,6 @@ ignition_modular_library(
REF ${PORT}${VERSION_MAJOR}_${VERSION}
VERSION ${VERSION}
SHA512 8f62af3838e9189c3a93fea87991c390ddd4fa0d5c0ecb80f8347bfb2f5892ec73c4bca1ac05d083d2a5adcbbd698e76215d56498bd648834a46af7784e8ce57
OPTIONS
PATCHES
dependencies.patch
)

View File

@ -1,6 +1,7 @@
{
"name": "gz-physics",
"version": "8.0.0",
"port-version": 1,
"description": "component of Gazebo, provides an abstract physics interface designed to support simulation and rapid development of robot applications.",
"homepage": "https://gazebosim.org/libs/physics",
"license": "Apache-2.0",

View File

@ -38,6 +38,10 @@ vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/spdlog)
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/spdlog.pc" " -lspdlog" " -lspdlogd")
endif()
# add support for integration other than cmake
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h
"// #define SPDLOG_FMT_EXTERNAL"

View File

@ -1,6 +1,7 @@
{
"name": "spdlog",
"version-semver": "1.15.1",
"port-version": 1,
"description": "Very fast, header-only/compiled, C++ logging library.",
"homepage": "https://github.com/gabime/spdlog",
"license": "MIT",

View File

@ -0,0 +1,10 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_cmake_configure(
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
OPTIONS
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
)
vcpkg_cmake_build()

View File

@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.30)
project(gz-common-test)
find_package(gz-common6 QUIET REQUIRED COMPONENTS av)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE gz-common6::gz-common6-av)
find_package(PkgConfig REQUIRED)
pkg_check_modules(gz-common_pc gz-common6-av REQUIRED IMPORTED_TARGET)
add_executable(main-pkconfig main.cpp)
target_link_libraries(main-pkconfig PRIVATE PkgConfig::gz-common_pc)
if(MSVC)
target_compile_features(main-pkconfig PRIVATE cxx_std_17)
endif()

View File

@ -0,0 +1,9 @@
#include <gz/common/Console.hh>
#include <gz/common/VideoEncoder.hh>
int main()
{
gz::common::VideoEncoder v{};
gzwarn << "Hello vcpkg" << std::endl;
return 0;
}

View File

@ -0,0 +1,17 @@
{
"name": "vcpkg-ci-gz-common",
"version-string": "ci",
"description": "Port to force features of gz-common within CI",
"homepage": "https://github.com/microsoft/vcpkg",
"license": "MIT",
"dependencies": [
{
"name": "gz-common",
"default-features": false
},
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -3398,7 +3398,7 @@
},
"gz-cmake": {
"baseline": "4.1.1",
"port-version": 0
"port-version": 1
},
"gz-cmake3": {
"baseline": "3.4.1",
@ -3406,7 +3406,7 @@
},
"gz-common": {
"baseline": "6.0.2",
"port-version": 0
"port-version": 1
},
"gz-common5": {
"baseline": "5.4.1",
@ -3446,7 +3446,7 @@
},
"gz-physics": {
"baseline": "8.0.0",
"port-version": 0
"port-version": 1
},
"gz-physics6": {
"baseline": "6.5.1",
@ -8746,7 +8746,7 @@
},
"spdlog": {
"baseline": "1.15.1",
"port-version": 0
"port-version": 1
},
"spectra": {
"baseline": "1.0.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1eb4fdbb46a9e20c9fe8f4e90d273d8ece5b6ceb",
"version": "4.1.1",
"port-version": 1
},
{
"git-tree": "d24fcae6f5ec151961b1d1c5d51a052ea1a4819a",
"version": "4.1.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bacea98222ace160cdc057f292b53ab9aedb1d6b",
"version": "6.0.2",
"port-version": 1
},
{
"git-tree": "dae3f816596200c7cf0075dedf823028c0f458a2",
"version": "6.0.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "45bbc49168b3dde36bb6b3ab8ea8387505ee3fcb",
"version": "8.0.0",
"port-version": 1
},
{
"git-tree": "d5ca21bcf78d4d0beea10b31b3f96d774b2db7ee",
"version": "8.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0897c1cad98251e9bf2b04124d1daf522b2697e5",
"version-semver": "1.15.1",
"port-version": 1
},
{
"git-tree": "7eecd9f58a522cf0ed8f081356617dbd7b4947de",
"version-semver": "1.15.1",