vcpkg/ports/osgearth/portfile.cmake
Victor Romero 050e71d01d
Remove references to CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS (#5937)
* [various ports] remove references to CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS

* [alac,benchmark,capnproto] Fix  check_linkage call

* [fastlz] Fix SHA512

* [coroutine] Fix dynamic build

* [folly] Find double-conversion

* [gamma] Use vcpkg_from_github

* [librsync] Enable static builds

* [netcdf-cxx4] Fix SHA512

* [octomap] Fix static build

* [tidy-html5] Fix static build

* [various ports] remove custom messages for shared/static builds, modernize some scripts in the meantime

* [folly] Use ras0219's fix for link paths

* [octomap] Fix exported targets

* [uvatlas] Set tool download SHA512

* [duktape+python2] fix portfile to call configure with correct python version, manage python2 also outside win32

* [suitesparse] osx fix

* [gtkmm] Call vcpkg_check_linkage after including vcpkg functions

* [duktape] Resolve conflicts

* [duktape] FIxed typo in Python paths

* [wangle] Find zlib

* [openssl-uwp] Fix SHA512

* [glib] Allow static builds on non-Windows

* [suitesparse] Fix build on Windows

* [multiple ports] Bump CONTROL version

* [multiple ports] Fix description indent

* [directxtk] Fix CONTROL file

* [bde,duktape,qpid-proton] Build packages with python2 installed

* [binn] remove CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS

* [gdal,live555,uriparser] Fix regressions

* [live555] Update to 2019.04.24
2019-05-02 22:57:43 -07:00

73 lines
2.6 KiB
CMake

include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
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")
endif()
string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/osg/" "" OSG_PLUGINS_SUBDIR "${OSG_PLUGINS_SUBDIR}")
vcpkg_download_distfile(
VS2017PATCH
URLS "https://github.com/remoe/osgearth/commit/f7081cc4f9991c955c6a0ef7b7b50e48360d14fd.diff"
FILENAME "osgearth-f7081cc4f9991c955c6a0ef7b7b50e48360d14fd.patch"
SHA512 eadb47a5713c00c05add8627e5cad22844db041da34081d59104151a1a1e2d5ac9552909d67171bfc0449a3e4d2930dd3a7914d3ec7ef7ff1015574e9c9a6105
)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gwaldron/osgearth
REF osgearth-2.10
SHA512 ba742f4fc8dbbdaee65e413d477b713cad8da313a1dc68327997359aca88dadc871b03ad4b09172e3e048164989c2797108db67f14edff8ee5a0c63a8fe1bb0c
HEAD_REF master
PATCHES ${VS2017PATCH}
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
#Release
set(OSGEARTH_TOOL_PATH ${CURRENT_PACKAGES_DIR}/tools/osgearth)
set(OSGEARTH_TOOL_PLUGIN_PATH ${OSGEARTH_TOOL_PATH}/${OSG_PLUGINS_SUBDIR})
file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PATH})
file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PLUGIN_PATH})
file(GLOB OSGEARTH_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe)
file(GLOB OSGDB_PLUGINS ${CURRENT_PACKAGES_DIR}/bin/osgdb*.dll)
file(COPY ${OSGEARTH_TOOLS} DESTINATION ${OSGEARTH_TOOL_PATH})
file(COPY ${OSGDB_PLUGINS} DESTINATION ${OSGEARTH_TOOL_PLUGIN_PATH})
file(REMOVE_RECURSE ${OSGEARTH_TOOLS})
file(REMOVE_RECURSE ${OSGDB_PLUGINS})
#Debug
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
set(OSGEARTH_DEBUG_TOOL_PATH ${CURRENT_PACKAGES_DIR}/debug/tools/osgearth)
set(OSGEARTH_DEBUG_TOOL_PLUGIN_PATH ${OSGEARTH_DEBUG_TOOL_PATH}/${OSG_PLUGINS_SUBDIR})
file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PATH})
file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH})
file(GLOB OSGEARTH_DEBUG_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(GLOB OSGDB_DEBUG_PLUGINS ${CURRENT_PACKAGES_DIR}/debug/bin/osgdb*.dll)
file(COPY ${OSGEARTH_DEBUG_TOOLS} DESTINATION ${OSGEARTH_DEBUG_TOOL_PATH})
file(COPY ${OSGDB_DEBUG_PLUGINS} DESTINATION ${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH})
file(REMOVE_RECURSE ${OSGEARTH_DEBUG_TOOLS})
file(REMOVE_RECURSE ${OSGDB_DEBUG_PLUGINS})
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/osgearth)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/osgearth/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/osgearth/copyright)