diff --git a/docs/users/triplets.md b/docs/users/triplets.md index 9aa500d76..10ac31fd5 100644 --- a/docs/users/triplets.md +++ b/docs/users/triplets.md @@ -47,7 +47,9 @@ Specifies the target platform. Valid options include any CMake system name, such as: - Empty (Windows Desktop for legacy reasons) - `WindowsStore` (Universal Windows Platform) +- `MinGW` (Minimalist GNU for Windows) - `Darwin` (Mac OSX) +- `iOS` (iOS) - `Linux` (Linux) - `Emscripten` (WebAssembly) @@ -127,7 +129,7 @@ Valid settings: * The Visual Studio 2015 platform toolset is `v140`. ### VCPKG_LOAD_VCVARS_ENV -If `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` is used, VCPKG will not setup the Visual Studio environment. +If `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` is used, VCPKG will not setup the Visual Studio environment. Setting `VCPKG_LOAD_VCVARS_ENV` to (true|1|on) changes this behavior so that the Visual Studio environment is setup following the same rules as if `VCPKG_CHAINLOAD_TOOLCHAIN_FILE` was not set. ## MacOS Variables diff --git a/ports/corrade/CONTROL b/ports/corrade/CONTROL index 091144941..d59fa6f0a 100644 --- a/ports/corrade/CONTROL +++ b/ports/corrade/CONTROL @@ -1,5 +1,5 @@ Source: corrade -Version: 2019.10-1 +Version: 2020.06 Description: C++11/C++14 multiplatform utility library Homepage: https://magnum.graphics/corrade/ Default-Features: interconnect, pluginmanager, testsuite, utility diff --git a/ports/corrade/portfile.cmake b/ports/corrade/portfile.cmake index 3c82bd94b..78c7a2a04 100644 --- a/ports/corrade/portfile.cmake +++ b/ports/corrade/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/corrade - REF v2019.10 - SHA512 5d161f78844b06e1a9979c7e244968a691012e7212e05df3ee3572f5df9aa69e86309f426a89f356f483f6de3871366a8e11b1701a578f865ea738cc8eee515b + REF v2020.06 + SHA512 94cc8959b0ee43ecd8d13a25307e7829d53dc6601628d97c32288d1704e2c0835b755bffc06b2105e6aa5a612f119a60e83cb475860b51e6a35999215c100227 HEAD_REF master ) @@ -31,7 +31,6 @@ vcpkg_configure_cmake( OPTIONS -DUTILITY_USE_ANSI_COLORS=ON -DBUILD_STATIC=${BUILD_STATIC} - ${_CUSTOM_BUILD_FLAGS} ${_COMPONENT_FLAGS} ) @@ -43,21 +42,8 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) # Install tools if("utility" IN_LIST FEATURES) - file(GLOB EXES - ${CURRENT_PACKAGES_DIR}/bin/corrade-rc - ${CURRENT_PACKAGES_DIR}/bin/corrade-rc.exe - ) - # Drop a copy of tools - file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/corrade) - - # Tools require dlls - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/corrade) - - file(GLOB TO_REMOVE - ${CURRENT_PACKAGES_DIR}/bin/corrade-rc* - ${CURRENT_PACKAGES_DIR}/debug/bin/corrade-rc*) - file(REMOVE ${TO_REMOVE}) + vcpkg_copy_tools(TOOL_NAMES "corrade-rc" AUTO_CLEAN) endif() # Ensure no empty folders are left behind @@ -78,10 +64,9 @@ elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING - DESTINATION ${CURRENT_PACKAGES_DIR}/share/corrade) -file(RENAME - ${CURRENT_PACKAGES_DIR}/share/corrade/COPYING - ${CURRENT_PACKAGES_DIR}/share/corrade/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) + vcpkg_copy_pdbs() diff --git a/ports/magnum-extras/CONTROL b/ports/magnum-extras/CONTROL index d1d889d20..b9583b5f1 100644 --- a/ports/magnum-extras/CONTROL +++ b/ports/magnum-extras/CONTROL @@ -1,5 +1,5 @@ Source: magnum-extras -Version: 2019.10 +Version: 2020.06 Build-Depends: magnum[core] Description: Extras for magnum, C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ diff --git a/ports/magnum-extras/portfile.cmake b/ports/magnum-extras/portfile.cmake index f5075fdaa..d2a0af3d4 100644 --- a/ports/magnum-extras/portfile.cmake +++ b/ports/magnum-extras/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum-extras - REF v2019.10 - SHA512 75335a75f1662e6223d2be7bc2f3cdb12af0e13ed11f3551dbd68a9488ab2e37ba9cd7ee786cc13e545689ed213558b305bfaffbaf8fa7d3be61eb21eeeeba4a + REF v2020.06 + SHA512 7419af84a6de72f666a9bd12a325c4b40f9e2a25fec3d0b22c348faab0a402b62fa782231b9b12180d84f4ab2508b02df25a97713948bdd2f21c9e8cb831fa25 HEAD_REF master ) @@ -66,7 +66,9 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum-extras) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum-extras/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum-extras/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) + vcpkg_copy_pdbs() diff --git a/ports/magnum-integration/CONTROL b/ports/magnum-integration/CONTROL index 05fce1f61..893ce966f 100644 --- a/ports/magnum-integration/CONTROL +++ b/ports/magnum-integration/CONTROL @@ -1,5 +1,5 @@ Source: magnum-integration -Version: 2019.10 +Version: 2020.06 Build-Depends: magnum[core] Description: Integrations for magnum, C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ diff --git a/ports/magnum-integration/portfile.cmake b/ports/magnum-integration/portfile.cmake index c079ee445..9bb8a64de 100644 --- a/ports/magnum-integration/portfile.cmake +++ b/ports/magnum-integration/portfile.cmake @@ -2,8 +2,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum-integration - REF v2019.10 - SHA512 be8b21da07b9720ad19263d6ee0a234ff97ee4a1d5770e3ab33047bc54711689532945b099431c24f6ae863bb55a0883b3ba34a48d7d17768082b26651a9621e + REF v2020.06 + SHA512 0b615acdb49ed55bd678a5fb019b1a8ccf522084f3114b2b8dd7e121c27d39ae2aab2879a2e2fa8b083163be711a86f64202fcf380413dec0c705fffd7d649c5 HEAD_REF master ) @@ -59,7 +59,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum-integration) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum-integration/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum-integration/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/magnum-plugins/CONTROL b/ports/magnum-plugins/CONTROL index 39d0d1016..24e3e2fbb 100644 --- a/ports/magnum-plugins/CONTROL +++ b/ports/magnum-plugins/CONTROL @@ -1,9 +1,9 @@ Source: magnum-plugins -Version: 2019.10-2 +Version: 2020.06 Build-Depends: magnum[core] Description: Plugins for magnum, C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ -Default-Features: ddsimporter, miniexrimageconverter, opengeximporter, stanfordimporter, stbimageconverter, stbimageimporter +Default-Features: ddsimporter, icoimporter, miniexrimageconverter, opengeximporter, stanfordimporter, stanfordsceneconverter, stbimageconverter, stbimageimporter, stlimporter Feature: assimpimporter Description: AssimpImporter plugin @@ -14,11 +14,11 @@ Description: OpenDdl library Feature: basisimageconverter Description: BasisImageConverter plugin -Build-Depends: magnum[trade], basisu +Build-Depends: magnum[trade] Feature: basisimporter Description: BasisImporter plugin -Build-Depends: magnum[trade], basisu +Build-Depends: magnum[trade] Feature: ddsimporter Description: DdsImporter plugin @@ -51,6 +51,10 @@ Feature: harfbuzzfont Description: HarfBuzzFont plugin Build-Depends: harfbuzz, magnum-plugins[freetypefont] +Feature: icoimporter +Description: IcoImporter plugin +Build-Depends: magnum[trade] + Feature: jpegimporter Description: JpegImporter plugin Build-Depends: libjpeg-turbo, magnum[trade] @@ -59,6 +63,10 @@ Feature: jpegimageconverter Description: JpegImageConverter plugin Build-Depends: libjpeg-turbo, magnum[trade] +Feature: meshoptimizersceneconverter +Description: MeshOptimizerSceneConverter plugin +Build-Depends: magnum[trade], meshoptimizer + Feature: miniexrimageconverter Description: MiniExrImageConverter plugin Build-Depends: magnum[trade] @@ -79,6 +87,10 @@ Feature: stanfordimporter Description: StanfordImporter plugin Build-Depends: magnum[trade] +Feature: stanfordsceneconverter +Description: StanfordSceneConverter plugin +Build-Depends: magnum[trade] + Feature: stbimageconverter Description: StbImageConverter plugin Build-Depends: magnum[trade] @@ -95,6 +107,10 @@ Feature: stbvorbisaudioimporter Description: StbVorbisAudioImporter plugin Build-Depends: magnum[audio] +Feature: stlimporter +Description: StlImporter plugin +Build-Depends: magnum[trade] + Feature: tinygltfimporter Description: TinyGltfImporter plugin Build-Depends: magnum[anyimageimporter], magnum-plugins[stbimageimporter], magnum[trade] diff --git a/ports/magnum-plugins/portfile.cmake b/ports/magnum-plugins/portfile.cmake index 1fc50e203..62e4da7bc 100644 --- a/ports/magnum-plugins/portfile.cmake +++ b/ports/magnum-plugins/portfile.cmake @@ -1,51 +1,68 @@ -set(_RELEASE_ONLY_PATCHES) -if(NOT VCPKG_USE_HEAD_VERSION) - vcpkg_download_distfile( - _RELEASE_ONLY_PATCHES - URLS "https://github.com/mosra/magnum-plugins/commit/c2a05465fa43befbb628b424378e328fa42923b7.diff" - FILENAME "c2a05465fa43befbb628b424378e328fa42923b7.diff" - SHA512 e03953ff7319b3b8e3644b8e25c006a856dd6a85cec6e4c033f9b2059af7ae39ed84b76c11c93c41ea6a681d7f34dd5980806f49f760d1c26778047c90cc76df - ) -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum-plugins - REF v2019.10 - SHA512 702c43b0d323dc5b903ffee3dd9aaecf2de3b6bb00e7b243880e433df12efe337e512aac75a6f38adce02eb94f3065770ff6a03b7241198f27b5c46de63e5750 + REF v2020.06 + SHA512 3c11c2928bfc9d04c1ad64f72b6ffac6cf80a1ef3aacc5d0486b9ad955cf4f6ea6d5dcb3846dc5d73f64ec522a015eafb997f62c79ad7ff91169702341f23af0 HEAD_REF master PATCHES 001-tools-path.patch - ${_RELEASE_ONLY_PATCHES} ) +if("basisimporter" IN_LIST FEATURES OR "basisimageconverter" IN_LIST FEATURES) + # Bundle Basis Universal, a commit that's before the UASTC support (which + # is not implemented yet). The repo has big unrequired files in its + # history, so we're downloading just a snapshot instead of a git clone. + vcpkg_download_distfile( + _BASIS_UNIVERSAL_PATCHES + URLS "https://github.com/BinomialLLC/basis_universal/commit/e9c55faac7745ebf38d08cd3b4f71aaf542f8191.diff" + FILENAME "e9c55faac7745ebf38d08cd3b4f71aaf542f8191.patch" + SHA512 e5dda11de2ba8cfd39728e69c74a7656bb522e509786fe5673c94b26be9bd4bee897510096479ee6323f5276d34cba1c44c60804a515c0b35ff7b6ac9d625b88 + ) + set(_BASIS_VERSION "8565af680d1bd2ad56ab227ca7d96c56dfbe93ed") + vcpkg_download_distfile( + _BASIS_UNIVERSAL_ARCHIVE + URLS "https://github.com/BinomialLLC/basis_universal/archive/${_BASIS_VERSION}.tar.gz" + FILENAME "basis-universal-${_BASIS_VERSION}.tar.gz" + SHA512 65062ab3ba675c46760f56475a7528189ed4097fb9bab8316e25d9e23ffec2a9560eb9a6897468baf2a6ab2bd698b5907283e96deaeaef178085a47f9d371bb2 + ) + vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH _BASIS_UNIVERSAL_SOURCE + ARCHIVE ${_BASIS_UNIVERSAL_ARCHIVE} + WORKING_DIRECTORY "${SOURCE_PATH}/src/external" + PATCHES + ${_BASIS_UNIVERSAL_PATCHES}) + # Remove potentially cached directory which would cause renaming to fail + file(REMOVE_RECURSE "${SOURCE_PATH}/src/external/basis-universal") + # Rename the output folder so that magnum auto-detects it + file(RENAME ${_BASIS_UNIVERSAL_SOURCE} "${SOURCE_PATH}/src/external/basis-universal") +endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL static) set(BUILD_PLUGINS_STATIC 1) else() set(BUILD_PLUGINS_STATIC 0) endif() -# Handle features -set(_COMPONENT_FLAGS "") +set(_COMPONENTS "") +# Generate cmake parameters from feature names foreach(_feature IN LISTS ALL_FEATURES) # Uppercase the feature name and replace "-" with "_" string(TOUPPER "${_feature}" _FEATURE) string(REPLACE "-" "_" _FEATURE "${_FEATURE}") - # Turn "-DWITH_*=" ON or OFF depending on whether the feature - # is in the list. - if(_feature IN_LIST FEATURES) - list(APPEND _COMPONENT_FLAGS "-DWITH_${_FEATURE}=ON") - else() - list(APPEND _COMPONENT_FLAGS "-DWITH_${_FEATURE}=OFF") + # 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}) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS - ${_COMPONENT_FLAGS} + ${FEATURE_OPTIONS} -DBUILD_STATIC=${BUILD_PLUGINS_STATIC} -DBUILD_PLUGINS_STATIC=${BUILD_PLUGINS_STATIC} -DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d @@ -86,7 +103,8 @@ else() endif() # Handle copyright -file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum-plugins) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/magnum-plugins/COPYING ${CURRENT_PACKAGES_DIR}/share/magnum-plugins/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/magnum/002-sdl-includes-head.patch b/ports/magnum/002-sdl-includes-head.patch deleted file mode 100644 index fb2ffed8d..000000000 --- a/ports/magnum/002-sdl-includes-head.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp -index 276c7ee55..90c52f3cb 100644 ---- a/src/Magnum/Platform/Sdl2Application.cpp -+++ b/src/Magnum/Platform/Sdl2Application.cpp -@@ -34,7 +34,7 @@ - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wpragma-pack" - #endif --#include -+#include - #ifdef CORRADE_TARGET_CLANG_CL - #pragma clang diagnostic pop - #endif -diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h -index b2426d513..176729fdb 100644 ---- a/src/Magnum/Platform/Sdl2Application.h -+++ b/src/Magnum/Platform/Sdl2Application.h -@@ -57,11 +57,11 @@ - #pragma clang diagnostic ignored "-Wpragma-pack" - #endif - /* SDL.h includes the world, adding 50k LOC. We don't want that either. */ --#include --#include --#include /* huh, why is this not pulled in implicitly?! */ --#include --#include -+#include -+#include -+#include /* huh, why is this not pulled in implicitly?! */ -+#include -+#include - - #ifdef CORRADE_TARGET_IOS - /* Including SDL_main.h unconditionally would mean it'd override Corrade::Main -@@ -74,7 +74,7 @@ - #endif - - #ifdef CORRADE_TARGET_WINDOWS_RT --#include /* For SDL_WinRTRunApp */ -+#include /* For SDL_WinRTRunApp */ - #include /* For the WinMain entrypoint */ - #endif - #ifdef CORRADE_TARGET_CLANG_CL diff --git a/ports/magnum/002-sdl-includes.patch b/ports/magnum/002-sdl-includes.patch index b7ae6a446..fb2ffed8d 100644 --- a/ports/magnum/002-sdl-includes.patch +++ b/ports/magnum/002-sdl-includes.patch @@ -1,36 +1,43 @@ diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp -index 46ade2d00..24d8eabe7 100644 +index 276c7ee55..90c52f3cb 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp -@@ -26,7 +26,7 @@ - #include "Sdl2Application.h" - - #include +@@ -34,7 +34,7 @@ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpragma-pack" + #endif -#include +#include - #ifndef CORRADE_TARGET_EMSCRIPTEN - #include - #else + #ifdef CORRADE_TARGET_CLANG_CL + #pragma clang diagnostic pop + #endif diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h -index 1a50b1c72..45e88edf5 100644 +index b2426d513..176729fdb 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h -@@ -46,13 +46,13 @@ - #define SDL_MAIN_HANDLED +@@ -57,11 +57,11 @@ + #pragma clang diagnostic ignored "-Wpragma-pack" #endif /* SDL.h includes the world, adding 50k LOC. We don't want that either. */ -#include -#include +-#include /* huh, why is this not pulled in implicitly?! */ -#include -#include +#include +#include ++#include /* huh, why is this not pulled in implicitly?! */ +#include +#include - + + #ifdef CORRADE_TARGET_IOS + /* Including SDL_main.h unconditionally would mean it'd override Corrade::Main +@@ -74,7 +74,7 @@ + #endif + #ifdef CORRADE_TARGET_WINDOWS_RT -#include /* For SDL_WinRTRunApp */ +#include /* For SDL_WinRTRunApp */ #include /* For the WinMain entrypoint */ #endif - + #ifdef CORRADE_TARGET_CLANG_CL diff --git a/ports/magnum/CONTROL b/ports/magnum/CONTROL index 8f187b890..8bea92fbf 100644 --- a/ports/magnum/CONTROL +++ b/ports/magnum/CONTROL @@ -1,9 +1,9 @@ Source: magnum -Version: 2019.10-2 +Version: 2020.06 Build-Depends: corrade[utility] Description: C++11/C++14 graphics middleware for games and data visualization Homepage: https://magnum.graphics/ -Default-Features: anyimageimporter, anyaudioimporter, anyimageconverter, anysceneimporter, debugtools, gl, meshtools, primitives, scenegraph, shaders, text, texturetools, trade, sdl2application +Default-Features: anyaudioimporter, anyimageimporter, anyimageconverter, anysceneconverter, anysceneimporter, debugtools, gl, meshtools, primitives, scenegraph, shaders, text, texturetools, trade, sdl2application Feature: al-info Description: magnum-al-info utility @@ -21,6 +21,10 @@ Feature: anyimageconverter Description: AnyImageConverter plugin Build-Depends: magnum[trade] +Feature: anysceneconverter +Description: AnySceneConverter plugin +Build-Depends: magnum[trade] + Feature: anysceneimporter Description: AnySceneImporter plugin Build-Depends: magnum[trade] @@ -90,6 +94,10 @@ Build-Depends: sdl2 Feature: scenegraph Description: SceneGraph library +Feature: sceneconverter +Description: magnum-sceneconverter utility +Build-Depends: magnum[anysceneconverter] + Feature: shaders Description: Shaders library Build-Depends: magnum[gl] @@ -113,20 +121,16 @@ Feature: wavaudioimporter Description: WavAudioImporter plugin Build-Depends: magnum[audio] -Feature: windowlesswglapplication -Description: WindowlessWglApplication library -Build-Depends: magnum[gl] - -Feature: eglcontext -Description: EglContext library +Feature: windowlesscglapplication +Description: WindowlessCglApplication library Build-Depends: magnum[gl] Feature: cglcontext Description: CglContext library Build-Depends: magnum[gl] -Feature: glxcontext -Description: GlxContext library +Feature: windowlesswglapplication +Description: WindowlessWglApplication library Build-Depends: magnum[gl] Feature: wglcontext @@ -137,6 +141,14 @@ Feature: windowlesseglapplication Description: WindowlessEglApplication library Build-Depends: magnum[gl] +Feature: eglcontext +Description: EglContext library +Build-Depends: magnum[gl] + Feature: windowlessglxapplication Description: WindowlessGlxApplication library Build-Depends: magnum[gl] + +Feature: glxcontext +Description: GlxContext library +Build-Depends: magnum[gl] diff --git a/ports/magnum/portfile.cmake b/ports/magnum/portfile.cmake index bc45ed9fd..cbdb34cd5 100644 --- a/ports/magnum/portfile.cmake +++ b/ports/magnum/portfile.cmake @@ -1,23 +1,12 @@ -# Patches that are independent of --head flag -set(_PATCHES 001-tools-path.patch) - -# Patches that are only applied to --head builds -if(VCPKG_USE_HEAD_VERSION) - list(APPEND _PATCHES 002-sdl-includes-head.patch) - -# Patches that are only applied to release builds -else() - list(APPEND _PATCHES 002-sdl-includes.patch) -endif() - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO mosra/magnum - REF v2019.10 - SHA512 b1c991199fa9b09b780ea822de4b2251c70fcc95e7f28bb14a6184861d92fcd4c6e6fe43ad21acfbfd191cd46e79bf58b867240ad6f706b07cd1fbe145b8eaff + REF v2020.06 + SHA512 65b0c8a4520d1d282420c30ecd7c8525525d4dbb6e562e1e2e93d110f4eb686af43f098bf02460727fab1e1f9446dd00a99051e150c05ea40b1486a44fea1042 HEAD_REF master PATCHES - ${_PATCHES} + 001-tools-path.patch + 002-sdl-includes.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) @@ -28,43 +17,52 @@ else() set(BUILD_PLUGINS_STATIC 0) endif() -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - al-info WITH_AL_INFO - anyimageimporter WITH_ANYIMAGEIMPORTER - anyaudioimporter WITH_ANYAUDIOIMPORTER - anyimageconverter WITH_ANYIMAGECONVERTER - anysceneimporter WITH_ANYSCENEIMPORTER - audio WITH_AUDIO - debugtools WITH_DEBUGTOOLS - distancefieldconverter WITH_DISTANCEFIELDCONVERTER - fontconverter WITH_FONTCONVERTER - gl WITH_GL - gl-info WITH_GL_INFO - glfwapplication WITH_GLFWAPPLICATION - imageconverter WITH_IMAGECONVERTER - magnumfont WITH_MAGNUMFONT - magnumfontconverter WITH_MAGNUMFONTCONVERTER - meshtools WITH_MESHTOOLS - objimporter WITH_OBJIMPORTER - tgaimageconverter WITH_TGAIMAGECONVERTER - opengltester WITH_OPENGLTESTER - primitives WITH_PRIMITIVES - sdl2application WITH_SDL2APPLICATION - scenegraph WITH_SCENEGRAPH - shaders WITH_SHADERS - text WITH_TEXT - texturetools WITH_TEXTURETOOLS - tgaimporter WITH_TGAIMPORTER - trade WITH_TRADE - wavaudioimporter WITH_WAVAUDIOIMPORTER - windowlesswglapplication WITH_WINDOWLESSWGLAPPLICATION - eglcontext WITH_EGLCONTEXT - cglcontext WITH_CGLCONTEXT - glxcontext WITH_GLXCONTEXT - wglcontext WITH_WGLCONTEXT - windowlesseglapplication WITH_WINDOWLESSEGLAPPLICATION - windowlessglxapplication WITH_WINDOWLESSGLXAPPLICATION -) +# 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}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} @@ -88,27 +86,23 @@ else() set(EXE_SUFFIX) endif() -if(distancefieldconverter IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-distancefieldconverter${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() -if(fontconverter IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-fontconverter${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() -if(al-info IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-al-info${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() -if(magnuminfo IN_LIST FEATURES) - file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-info${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum) -endif() - -# Tools require dlls -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/magnum) - -file(GLOB_RECURSE TO_REMOVE - ${CURRENT_PACKAGES_DIR}/bin/*${EXE_SUFFIX} - ${CURRENT_PACKAGES_DIR}/debug/bin/*${EXE_SUFFIX}) -if(TO_REMOVE) - file(REMOVE ${TO_REMOVE}) +# 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) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -129,4 +123,6 @@ else() file(COPY ${CMAKE_CURRENT_LIST_DIR}/magnumdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin/magnum-d) endif() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/COPYING + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) diff --git a/ports/meshoptimizer/CONTROL b/ports/meshoptimizer/CONTROL new file mode 100644 index 000000000..320908e70 --- /dev/null +++ b/ports/meshoptimizer/CONTROL @@ -0,0 +1,5 @@ +Source: meshoptimizer +Version: 0.14 +Port-Version: 1 +Homepage: https://github.com/zeux/meshoptimizer +Description: Mesh optimization library that makes meshes smaller and faster to render diff --git a/ports/meshoptimizer/portfile.cmake b/ports/meshoptimizer/portfile.cmake new file mode 100644 index 000000000..e46b17460 --- /dev/null +++ b/ports/meshoptimizer/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO zeux/meshoptimizer + REF v0.14 + SHA512 303b3bf1bed7cba8f89bce1c2782e3718fc8f4ec01f7ffd64f5ca23406130097f07d234b142916b16fe586db97c7deaa0ae9135b4e558543cc1664e7db85de67 + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DMESHOPT_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/meshoptimizer) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/LICENSE.md + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} + RENAME copyright) + +vcpkg_copy_pdbs()