[osgearth] Change blend2d dependency to use the blend2d target (#21977)

* [osgearth] Change blend2d dependency to use the blend2d target and add missing dependency.

* Add quotes around 'dynamic', as requested by dg0yt

* Use CONFIG for blend2d, and combine with make-all-find-packages-required patch, as requested by @JackBoosY.
This commit is contained in:
Billy O'Neal 2021-12-13 17:21:14 -08:00 committed by GitHub
parent f9bcf2e650
commit d31efec576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 27 deletions

View File

@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7541c8d..b4076fe 100644
index 7541c8d07..cc14d2160 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,40 +122,54 @@ option(OSGEARTH_ENABLE_GEOCODER "Enable the geocoder (GDAL/OGR must be built wit
@ -48,7 +48,7 @@ index 7541c8d..b4076fe 100644
+find_package(WebP CONFIG REQUIRED)
+set(WEBP_LIBRARY WebP::webp)
+set(WEBP_FOUND 1)
+find_package(Blend2D REQUIRED)
+find_package(Blend2D CONFIG REQUIRED)
if(OSGEARTH_ENABLE_PROFILING)
- find_package(Tracy)
@ -93,3 +93,23 @@ index 7541c8d..b4076fe 100644
ENDIF (WITH_EXTERNAL_TINYXML)
# postfix settings for various configs
diff --git a/src/osgEarth/CMakeLists.txt b/src/osgEarth/CMakeLists.txt
index cd55c1164..4ecb61f0d 100644
--- a/src/osgEarth/CMakeLists.txt
+++ b/src/osgEarth/CMakeLists.txt
@@ -909,11 +909,11 @@ IF(FILEGDB_FOUND)
LINK_WITH_VARIABLES(${LIB_NAME} FILEGDB_LIBRARY)
ENDIF()
-IF(BLEND2D_FOUND)
+#IF(BLEND2D_FOUND)
add_definitions(-DOSGEARTH_HAVE_BLEND2D)
- include_directories(${BLEND2D_INCLUDES})
- link_with_variables(${LIB_NAME} BLEND2D_LIBRARY)
-ENDIF()
+# include_directories(${BLEND2D_INCLUDES})
+ target_link_libraries(${LIB_NAME} blend2d::blend2d)
+#ENDIF()
IF (WIN32)
LINK_EXTERNAL(${LIB_NAME} ${TARGET_EXTERNAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} )

View File

@ -1,6 +1,6 @@
# Only dynamic build need dlls
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(GLOB OSG_PLUGINS_SUBDIR ${CURRENT_INSTALLED_DIR}/tools/osg/osgPlugins-*)
file(GLOB OSG_PLUGINS_SUBDIR "${CURRENT_INSTALLED_DIR}/tools/osg/osgPlugins-*")
list(LENGTH OSG_PLUGINS_SUBDIR OSG_PLUGINS_SUBDIR_LENGTH)
if(NOT OSG_PLUGINS_SUBDIR_LENGTH EQUAL 1)
message(FATAL_ERROR "Could not determine osg version")
@ -14,7 +14,7 @@ vcpkg_from_github(
REF 15d5340f174212d6f93ae55c0d9af606c3d361c0 #version 3.2
SHA512 f922e8bbb041a498e948587f03e8dc8a07b92e641f38d50a8eafb8b3ce1e0c92bb1ee01360d57e794429912734b60cf05ba143445a442bc95af39e3dd9fc3670
HEAD_REF master
PATCHES
PATCHES
StaticOSG.patch # Fix port compilation in static-md module
make-all-find-packages-required.patch
fix-dependency-osg.patch
@ -24,7 +24,7 @@ vcpkg_from_github(
)
# Upstream bug, see https://github.com/gwaldron/osgearth/issues/1002
file(REMOVE ${SOURCE_PATH}/src/osgEarth/tinyxml.h)
file(REMOVE "${SOURCE_PATH}/src/osgEarth/tinyxml.h")
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
@ -33,9 +33,8 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
tools OSGEARTH_BUILD_TOOLS
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DOSGEARTH_BUILD_SHARED_LIBS=${BUILD_SHARED}
-DNRL_STATIC_LIBRARIES=${BUILD_STATIC}
@ -51,30 +50,30 @@ vcpkg_configure_cmake(
-DWITH_EXTERNAL_TINYXML=ON
)
vcpkg_install_cmake()
vcpkg_cmake_install()
if (WIN32 AND (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic))
if (WIN32 AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic"))
#Release
set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/${PORT})
set(OSGEARTH_TOOL_PLUGIN_PATH ${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR})
set(OSGEARTH_TOOL_PATH "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
set(OSGEARTH_TOOL_PLUGIN_PATH "${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}")
file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PLUGIN_PATH})
file(GLOB OSGDB_PLUGINS ${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll)
file(MAKE_DIRECTORY "${OSGEARTH_TOOL_PLUGIN_PATH}")
file(GLOB OSGDB_PLUGINS "${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll")
file(COPY ${OSGDB_PLUGINS} DESTINATION ${OSGEARTH_TOOL_PLUGIN_PATH})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR})
file(COPY ${OSGDB_PLUGINS} DESTINATION "${OSGEARTH_TOOL_PLUGIN_PATH}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR}")
#Debug
set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/${PORT})
set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH ${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR})
set(OSGEARTH_DEBUG_TOOL_PATH "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}")
set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH "${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}")
file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH})
file(MAKE_DIRECTORY "${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH}")
file(GLOB OSGDB_DEBUG_PLUGINS ${CURRENT_PACKAGES_DIR}/debug/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll)
file(GLOB OSGDB_DEBUG_PLUGINS "${CURRENT_PACKAGES_DIR}/debug/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll")
file(COPY ${OSGDB_DEBUG_PLUGINS} DESTINATION ${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH})
file(COPY ${OSGDB_DEBUG_PLUGINS} DESTINATION "${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH}")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/${OSG_PLUGINS_SUBDIR})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin/${OSG_PLUGINS_SUBDIR}")
endif()
if ("tools" IN_LIST FEATURES)
@ -84,7 +83,7 @@ if ("tools" IN_LIST FEATURES)
)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,12 +1,13 @@
{
"name": "osgearth",
"version": "3.2",
"port-version": 2,
"port-version": 3,
"description": "osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2021 Pelican Mapping.",
"homepage": "https://github.com/gwaldron/osgearth",
"supports": "!(x86 | wasm32)",
"dependencies": [
"basisu",
"blend2d",
"cfitsio",
"draco",
"geos",
@ -23,7 +24,11 @@
"protobuf",
"pthreads",
"sqlite3",
"tinyxml"
"tinyxml",
{
"name": "vcpkg-cmake",
"host": true
}
],
"default-features": [
"tools"

View File

@ -5094,7 +5094,7 @@
},
"osgearth": {
"baseline": "3.2",
"port-version": 2
"port-version": 3
},
"osi": {
"baseline": "0.108.6",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2e3d8cf49728cdb23060f31152768a2292c24ab8",
"version": "3.2",
"port-version": 3
},
{
"git-tree": "106a6da206a787832252687e41ad5ba3b102d062",
"version": "3.2",