2021-03-26 04:28:42 +08:00
|
|
|
# Only dynamic build need dlls
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2021-12-14 09:21:14 +08:00
|
|
|
file(GLOB OSG_PLUGINS_SUBDIR "${CURRENT_INSTALLED_DIR}/tools/osg/osgPlugins-*")
|
2021-03-26 04:28:42 +08:00
|
|
|
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")
|
|
|
|
endif()
|
|
|
|
string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/osg/" "" OSG_PLUGINS_SUBDIR "${OSG_PLUGINS_SUBDIR}")
|
2018-07-18 06:47:24 +08:00
|
|
|
endif()
|
|
|
|
|
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
|
2021-03-26 04:28:42 +08:00
|
|
|
StaticOSG.patch # Fix port compilation in static-md module
|
2021-01-22 00:58:11 +08:00
|
|
|
make-all-find-packages-required.patch
|
2021-03-26 04:28:42 +08:00
|
|
|
fix-dependency-osg.patch
|
|
|
|
remove-tool-debug-suffix.patch
|
2021-12-03 11:40:02 +08:00
|
|
|
fix-imgui.patch
|
|
|
|
fix-gcc11-compilation.patch
|
2022-03-29 04:35:15 +08:00
|
|
|
blend2d-fix.patch
|
2018-05-20 09:12:48 +08:00
|
|
|
)
|
|
|
|
|
2021-01-28 06:24:07 +08:00
|
|
|
# Upstream bug, see https://github.com/gwaldron/osgearth/issues/1002
|
2021-12-14 09:21:14 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/src/osgEarth/tinyxml.h")
|
2021-01-28 06:24:07 +08:00
|
|
|
|
2021-03-26 04:28:42 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
tools OSGEARTH_BUILD_TOOLS
|
|
|
|
)
|
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-03-26 04:28:42 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
|
|
|
-DOSGEARTH_BUILD_SHARED_LIBS=${BUILD_SHARED}
|
|
|
|
-DNRL_STATIC_LIBRARIES=${BUILD_STATIC}
|
|
|
|
-DOSG_IS_STATIC=${BUILD_STATIC}
|
|
|
|
-DGEOS_IS_STATIC=${BUILD_STATIC}
|
|
|
|
-DCURL_IS_STATIC=${BUILD_STATIC}
|
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
|
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
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
if (WIN32 AND (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic"))
|
2021-03-26 04:28:42 +08:00
|
|
|
#Release
|
2021-12-14 09:21:14 +08:00
|
|
|
set(OSGEARTH_TOOL_PATH "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
set(OSGEARTH_TOOL_PLUGIN_PATH "${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
file(MAKE_DIRECTORY "${OSGEARTH_TOOL_PLUGIN_PATH}")
|
|
|
|
file(GLOB OSGDB_PLUGINS "${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
file(COPY ${OSGDB_PLUGINS} DESTINATION "${OSGEARTH_TOOL_PLUGIN_PATH}")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR}")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-03-26 04:28:42 +08:00
|
|
|
#Debug
|
2021-12-14 09:21:14 +08:00
|
|
|
set(OSGEARTH_DEBUG_TOOL_PATH "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}")
|
|
|
|
set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH "${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR}")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
file(MAKE_DIRECTORY "${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH}")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
file(GLOB OSGDB_DEBUG_PLUGINS "${CURRENT_PACKAGES_DIR}/debug/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
file(COPY ${OSGDB_DEBUG_PLUGINS} DESTINATION "${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH}")
|
2018-05-20 09:12:48 +08:00
|
|
|
|
2021-12-14 09:21:14 +08:00
|
|
|
file(REMOVE_RECURSE "${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
|
|
|
|
2021-03-26 04:28:42 +08:00
|
|
|
if ("tools" IN_LIST FEATURES)
|
|
|
|
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)
|