diff options
Diffstat (limited to 'vcpkg/ports/osgearth')
| -rw-r--r-- | vcpkg/ports/osgearth/namespace-gdal.diff | 39 | ||||
| -rw-r--r-- | vcpkg/ports/osgearth/portfile.cmake | 74 | ||||
| -rw-r--r-- | vcpkg/ports/osgearth/vcpkg.json | 43 |
3 files changed, 156 insertions, 0 deletions
diff --git a/vcpkg/ports/osgearth/namespace-gdal.diff b/vcpkg/ports/osgearth/namespace-gdal.diff new file mode 100644 index 0000000..047fa46 --- /dev/null +++ b/vcpkg/ports/osgearth/namespace-gdal.diff @@ -0,0 +1,39 @@ +diff --git a/src/osgEarth/GDAL.cpp b/src/osgEarth/GDAL.cpp +index 9f1e7b67b..a9590a6be 100644 +--- a/src/osgEarth/GDAL.cpp ++++ b/src/osgEarth/GDAL.cpp +@@ -49,8 +49,6 @@ + #include <cpl_string.h> + #include <gdal_alg_priv.h> + +-using namespace osgEarth; +-using namespace osgEarth::GDAL; + + #undef LC + #define LC "[GDAL] " +@@ -59,7 +57,7 @@ using namespace osgEarth::GDAL; + + namespace osgEarth + { +- namespace GDAL ++ namespace + { + // From easyrgb.com + inline float Hue_2_RGB(float v1, float v2, float vH) +@@ -417,7 +415,6 @@ namespace osgEarth + return (err == CE_None); + } + } +-} // namespace osgEarth::GDAL + + //................................................................... + +@@ -2244,6 +2241,8 @@ GDALElevationLayer::createHeightFieldImplementation(const TileKey& key, Progress + return GeoHeightField::INVALID; + } + ++} // namespace osgearth ++ + //................................................................... + + diff --git a/vcpkg/ports/osgearth/portfile.cmake b/vcpkg/ports/osgearth/portfile.cmake new file mode 100644 index 0000000..cc0bbb6 --- /dev/null +++ b/vcpkg/ports/osgearth/portfile.cmake @@ -0,0 +1,74 @@ +vcpkg_download_distfile( + gdal_3_11_diff + URLS "https://github.com/gwaldron/osgearth/commit/f17898acd34656144936ea7d00e980a89a2c5215.diff?full_index=1" + FILENAME "gwaldron-osgearth-3.7.2-gdal-3.11-f17898acd34656144936ea7d00e980a89a2c5215.diff" + SHA512 9c316a951cb2ba506221d3c07a7a31d2f95e7ceef20a94c555ce0f399882cabe547e99eb404d43187328085b57de48f737694da808cad71ccc5f7274f89df8a8 +) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO gwaldron/osgearth + REF "osgearth-${VERSION}" + SHA512 4a2b80c907ebf2b56966598f9e134ad910d3271757496fb1d906cc413eb2ad09da366a96635f0195696efe16ef1a649e13b6ec1d901a39ced0465be797f14221 + HEAD_REF master + PATCHES + "${gdal_3_11_diff}" + namespace-gdal.diff +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + controls OSGEARTH_BUILD_LEGACY_CONTROLS_API + tools OSGEARTH_BUILD_TOOLS +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DOSGEARTH_BUILD_SHARED_LIBS=${BUILD_SHARED} + -DOSGEARTH_BUILD_EXAMPLES=OFF + -DOSGEARTH_BUILD_TESTS=OFF + -DOSGEARTH_BUILD_DOCS=OFF + -DOSGEARTH_BUILD_PROCEDURAL_NODEKIT=OFF + -DOSGEARTH_BUILD_TRITON_NODEKIT=OFF + -DOSGEARTH_BUILD_SILVERLINING_NODEKIT=OFF + -DOSGEARTH_BUILD_ZIP_PLUGIN=OFF + -DBUILDING_VCPKG_PORT=ON + -DCMAKE_JOB_POOL_LINK=console # Serialize linking to avoid OOM + OPTIONS_DEBUG + -DOSGEARTH_BUILD_TOOLS=OFF +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup() + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/osgEarth/Export" "defined( OSGEARTH_LIBRARY_STATIC )" "1") +endif() + +set(osg_plugin_pattern "${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}osgdb*${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}") +if("tools" IN_LIST FEATURES) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + file(GLOB osg_plugins "${CURRENT_PACKAGES_DIR}/plugins/${osg_plugins_subdir}/${osg_plugin_pattern}") + file(INSTALL ${osg_plugins} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/${osg_plugins_subdir}") + if(NOT VCPKG_BUILD_TYPE) + file(GLOB osg_plugins "${CURRENT_PACKAGES_DIR}/debug/plugins/${osg_plugins_subdir}/${osg_plugin_pattern}") + file(INSTALL ${osg_plugins} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/${osg_plugins_subdir}") + endif() + endif() + vcpkg_copy_tools(TOOL_NAMES osgearth_3pv osgearth_atlas osgearth_bakefeaturetiles osgearth_boundarygen + osgearth_clamp osgearth_conv osgearth_imgui osgearth_tfs osgearth_version osgearth_viewer + AUTO_CLEAN + ) + if(OSGEARTH_BUILD_LEGACY_CONTROLS_API) + vcpkg_copy_tools(TOOL_NAMES osgearth_createtile AUTO_CLEAN) + endif() + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/vcpkg/ports/osgearth/vcpkg.json b/vcpkg/ports/osgearth/vcpkg.json new file mode 100644 index 0000000..9e37afe --- /dev/null +++ b/vcpkg/ports/osgearth/vcpkg.json @@ -0,0 +1,43 @@ +{ + "name": "osgearth", + "version": "3.7.2", + "port-version": 4, + "description": "osgEarth - 3D Maps for OpenSceneGraph / C++14", + "homepage": "https://github.com/gwaldron/osgearth", + "license": "LGPL-3.0-or-later", + "supports": "!(arm32 | x86 | wasm32 | xbox) & !(windows & arm64)", + "dependencies": [ + "blend2d", + "draco", + "geos", + "glew", + "libwebp", + "opengl", + { + "name": "osg", + "default-features": false, + "features": [ + "plugins" + ] + }, + "protobuf", + "pthreads", + "sqlite3", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "controls": { + "description": "Support for the old Controls API (superceded by imgui)" + }, + "tools": { + "description": "Build command-line tools" + } + } +} |