2018-05-20 09:12:48 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO gwaldron/osgearth
|
2021-09-28 10:39:25 +08:00
|
|
|
REF 15d5340f174212d6f93ae55c0d9af606c3d361c0 #version 3.2
|
|
|
|
SHA512 f922e8bbb041a498e948587f03e8dc8a07b92e641f38d50a8eafb8b3ce1e0c92bb1ee01360d57e794429912734b60cf05ba143445a442bc95af39e3dd9fc3670
|
2018-05-20 09:12:48 +08:00
|
|
|
HEAD_REF master
|
2021-12-14 09:21:14 +08:00
|
|
|
PATCHES
|
2022-06-21 04:49:37 +08:00
|
|
|
osgearth-library-static.patch
|
|
|
|
link-libraries.patch
|
|
|
|
use-unofficial-osg-config.patch
|
|
|
|
find-package.patch
|
2021-03-26 04:28:42 +08:00
|
|
|
remove-tool-debug-suffix.patch
|
2021-12-03 11:40:02 +08:00
|
|
|
fix-gcc11-compilation.patch
|
2022-03-29 04:35:15 +08:00
|
|
|
blend2d-fix.patch
|
2018-05-20 09:12:48 +08:00
|
|
|
)
|
|
|
|
|
2022-06-21 04:49:37 +08:00
|
|
|
file(REMOVE
|
|
|
|
"${SOURCE_PATH}/CMakeModule/FindGEOS.cmake"
|
|
|
|
"${SOURCE_PATH}/CMakeModule/FindLibZip.cmake"
|
|
|
|
"${SOURCE_PATH}/CMakeModule/FindOSG.cmake"
|
|
|
|
"${SOURCE_PATH}/CMakeModule/FindSqlite3.cmake"
|
|
|
|
"${SOURCE_PATH}/CMakeModule/FindWEBP.cmake"
|
|
|
|
"${SOURCE_PATH}/src/osgEarth/tinyxml.h" # https://github.com/gwaldron/osgearth/issues/1002
|
|
|
|
)
|
2021-01-28 06:24:07 +08:00
|
|
|
|
2021-03-26 04:28:42 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2022-06-21 04:49:37 +08:00
|
|
|
FEATURES
|
|
|
|
tools OSGEARTH_BUILD_TOOLS
|
|
|
|
blend2d CMAKE_REQUIRE_FIND_PACKAGE_BLEND2D
|
2021-03-26 04:28:42 +08:00
|
|
|
)
|
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2022-06-21 04:49:37 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
-DLIB_POSTFIX=
|
2021-03-26 04:28:42 +08:00
|
|
|
-DOSGEARTH_BUILD_SHARED_LIBS=${BUILD_SHARED}
|
2020-12-18 03:53:17 +08:00
|
|
|
-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
|
2021-01-22 00:58:11 +08:00
|
|
|
-DWITH_EXTERNAL_TINYXML=ON
|
2022-06-21 04:49:37 +08:00
|
|
|
-DCMAKE_JOB_POOL_LINK=console # Serialize linking to avoid OOM
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DOSGEARTH_BUILD_TOOLS=OFF
|
2018-05-20 09:12:48 +08:00
|
|
|
)
|
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
vcpkg_cmake_install()
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2022-06-21 04:49:37 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/osgEarth/Export" "defined( OSGEARTH_LIBRARY_STATIC )" "1")
|
|
|
|
endif()
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2022-06-21 04:49:37 +08:00
|
|
|
# Merge osgearth plugins into [/debug]/plugins/osgPlugins-${OSG_VER},
|
|
|
|
# as a staging area for later deployment.
|
|
|
|
set(osg_plugin_pattern "${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}osgdb*${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
file(GLOB osg_plugins_subdir RELATIVE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/bin/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 plugins directory.")
|
|
|
|
endif()
|
|
|
|
file(GLOB osgearth_plugins "${CURRENT_PACKAGES_DIR}/bin/${osg_plugins_subdir}/${osg_plugin_pattern}")
|
|
|
|
file(INSTALL ${osgearth_plugins} DESTINATION "${CURRENT_PACKAGES_DIR}/plugins/${osg_plugins_subdir}")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
file(GLOB osgearth_plugins "${CURRENT_PACKAGES_DIR}/debug/bin/${osg_plugins_subdir}/${osg_plugin_pattern}")
|
|
|
|
file(INSTALL ${osgearth_plugins} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/plugins/${osg_plugins_subdir}")
|
|
|
|
endif()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/${osg_plugins_subdir}" "${CURRENT_PACKAGES_DIR}/debug/bin/${osg_plugins_subdir}")
|
2021-03-26 04:28:42 +08:00
|
|
|
endif()
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2022-06-21 04:49:37 +08:00
|
|
|
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()
|
2021-03-26 04:28:42 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES osgearth_3pv osgearth_atlas osgearth_boundarygen osgearth_clamp
|
2021-09-28 10:39:25 +08:00
|
|
|
osgearth_conv osgearth_imgui osgearth_overlayviewer osgearth_tfs osgearth_toc osgearth_version osgearth_viewer
|
2021-03-26 04:28:42 +08:00
|
|
|
AUTO_CLEAN
|
|
|
|
)
|
|
|
|
endif()
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2021-12-14 09:21:14 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|