2017-06-10 11:38:25 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mosra/magnum
|
2020-07-14 23:38:18 +08:00
|
|
|
REF v2020.06
|
|
|
|
SHA512 65b0c8a4520d1d282420c30ecd7c8525525d4dbb6e562e1e2e93d110f4eb686af43f098bf02460727fab1e1f9446dd00a99051e150c05ea40b1486a44fea1042
|
2017-06-10 11:38:25 +08:00
|
|
|
HEAD_REF master
|
2017-06-13 20:20:29 +08:00
|
|
|
PATCHES
|
2020-07-14 23:38:18 +08:00
|
|
|
001-tools-path.patch
|
|
|
|
002-sdl-includes.patch
|
2017-06-13 17:35:54 +08:00
|
|
|
)
|
|
|
|
|
2017-06-08 07:48:04 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
set(BUILD_STATIC 1)
|
2017-06-22 18:29:00 +08:00
|
|
|
set(BUILD_PLUGINS_STATIC 1)
|
2017-06-08 07:48:04 +08:00
|
|
|
else()
|
|
|
|
set(BUILD_STATIC 0)
|
2017-06-22 18:29:00 +08:00
|
|
|
set(BUILD_PLUGINS_STATIC 0)
|
2017-06-08 07:48:04 +08:00
|
|
|
endif()
|
|
|
|
|
2020-07-14 23:38:18 +08:00
|
|
|
# Remove platform-specific feature that are not available
|
|
|
|
# on current target platform from all features.
|
|
|
|
|
|
|
|
# For documentation on VCPKG_CMAKE_SYSTEM_NAME see
|
|
|
|
# https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#vcpkg_cmake_system_name
|
|
|
|
|
|
|
|
set(ALL_SUPPORTED_FEATURES ${ALL_FEATURES})
|
|
|
|
# Windows Desktop
|
|
|
|
if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "")
|
|
|
|
list(REMOVE_ITEM ALL_SUPPORTED_FEATURES wglcontext windowlesswglapplication)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Universal Windows Platform
|
|
|
|
if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
|
|
|
|
# No UWP specific features
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Mac OSX
|
|
|
|
if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
|
|
|
list(REMOVE_ITEM ALL_SUPPORTED_FEATURES cglcontext windowlesscglapplication)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Linux
|
|
|
|
if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
|
|
|
list(REMOVE_ITEM ALL_SUPPORTED_FEATURES glxcontext windowlessglxapplication)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# WebAssembly / Linux
|
|
|
|
if(NOT "${VCPKG_CMAKE_SYSTEM_NAME}" MATCHES "(Emscripten|Linux)")
|
|
|
|
list(REMOVE_ITEM ALL_SUPPORTED_FEATURES eglcontext windowlesseglapplication)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(_COMPONENTS "")
|
|
|
|
# Generate cmake parameters from feature names
|
|
|
|
foreach(_feature IN LISTS ALL_SUPPORTED_FEATURES)
|
|
|
|
# Uppercase the feature name and replace "-" with "_"
|
|
|
|
string(TOUPPER "${_feature}" _FEATURE)
|
|
|
|
string(REPLACE "-" "_" _FEATURE "${_FEATURE}")
|
|
|
|
|
|
|
|
# Final feature is empty, ignore it
|
|
|
|
if(_feature)
|
|
|
|
list(APPEND _COMPONENTS ${_feature} WITH_${_FEATURE})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS ${_COMPONENTS})
|
2018-02-17 13:25:30 +08:00
|
|
|
|
2017-06-08 03:08:08 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA # Disable this option if project cannot be built with Ninja
|
2017-06-10 11:38:25 +08:00
|
|
|
OPTIONS
|
2020-05-20 05:47:19 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2017-06-10 11:38:25 +08:00
|
|
|
-DBUILD_STATIC=${BUILD_STATIC}
|
2017-06-22 18:29:00 +08:00
|
|
|
-DBUILD_PLUGINS_STATIC=${BUILD_PLUGINS_STATIC}
|
2017-06-13 20:20:29 +08:00
|
|
|
-DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d
|
|
|
|
-DMAGNUM_PLUGINS_RELEASE_DIR=${CURRENT_INSTALLED_DIR}/bin/magnum
|
2017-06-08 03:08:08 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2020-05-20 05:47:19 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2017-06-15 22:49:43 +08:00
|
|
|
# Drop a copy of tools
|
2018-07-04 22:12:51 +08:00
|
|
|
if(NOT VCPKG_CMAKE_SYSTEM_NAME)
|
|
|
|
set(EXE_SUFFIX .exe)
|
|
|
|
else()
|
|
|
|
set(EXE_SUFFIX)
|
|
|
|
endif()
|
|
|
|
|
2020-07-14 23:38:18 +08:00
|
|
|
# Copy tools into vcpkg's tools directory
|
|
|
|
set(_TOOL_EXEC_NAMES "")
|
|
|
|
set(_TOOLS
|
|
|
|
al-info
|
|
|
|
distancefieldconverter
|
|
|
|
fontconverter
|
|
|
|
gl-info
|
|
|
|
imageconverter
|
|
|
|
sceneconverter)
|
|
|
|
foreach(_tool IN LISTS _TOOLS)
|
|
|
|
if("${_tool}" IN_LIST FEATURES)
|
|
|
|
list(APPEND _TOOL_EXEC_NAMES magnum-${_tool})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
message(STATUS ${_TOOL_EXEC_NAMES})
|
|
|
|
if(_TOOL_EXEC_NAMES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES "${_TOOL_EXEC_NAMES}" AUTO_CLEAN)
|
2018-02-17 13:25:30 +08:00
|
|
|
endif()
|
2017-06-15 22:49:43 +08:00
|
|
|
|
2017-06-08 03:08:08 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
|
2018-07-04 22:12:51 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2017-06-08 07:48:04 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2017-06-22 18:29:00 +08:00
|
|
|
# move plugin libs to conventional place
|
|
|
|
file(GLOB_RECURSE LIB_TO_MOVE ${CURRENT_PACKAGES_DIR}/lib/magnum/*)
|
|
|
|
file(COPY ${LIB_TO_MOVE} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/magnum)
|
|
|
|
file(GLOB_RECURSE LIB_TO_MOVE_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/magnum/*)
|
|
|
|
file(COPY ${LIB_TO_MOVE_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/magnum)
|
|
|
|
else()
|
2018-04-19 10:33:12 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/bin/magnum)
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/magnum-d)
|
2017-06-08 07:48:04 +08:00
|
|
|
endif()
|
2017-06-08 03:08:08 +08:00
|
|
|
|
2020-07-14 23:38:18 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
|
|
|
|
RENAME copyright)
|