Skip to content

Commit

Permalink
[corrade,magnum,-plugins,-extras,-integration] Update to latest and s…
Browse files Browse the repository at this point in the history
…upport feature packages (microsoft#2687)

[corrade,magnum,-plugins,-extras,-integration] Update to latest and support feature packages
  • Loading branch information
Squareys authored and ras0219-msft committed Feb 17, 2018
1 parent 267a985 commit 0822a28
Show file tree
Hide file tree
Showing 11 changed files with 496 additions and 65 deletions.
20 changes: 18 additions & 2 deletions ports/corrade/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Source: corrade
Version: jan2018-1
Description: C++11/C++14 multiplatform utility library http://mosra.cz/blog/corrade.php
Version: 2018.02-1
Description: C++11/C++14 multiplatform utility library http://magnum.graphics/corrade/
Default-Features: interconnect, pluginmanager, testsuite, utility

Feature: interconnect
Description: Interconnect library
Build-Depends: corrade[utility]

Feature: pluginmanager
Description: PluginManager library
Build-Depends: corrade[utility]

Feature: testsuite
Description: TestSuite library
Build-Depends: corrade[utility]

Feature: utility
Description: Utility library
70 changes: 54 additions & 16 deletions ports/corrade/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mosra/corrade
REF 2dd926d23f21042838d9244c00ddd1d2f09861ee
SHA512 085062a34c4fecc864d02f38d4d45e22f6de72f3599d67327a783c350e478fe943c5bb3f9cd5544953b55b7ffa78923b087bc0f40a54eb9ed9f5d580970b2f45
REF v2018.02
SHA512 8fe4998dc32586386b8fa2030941f3ace6d5e76aadcf7e20a620d276cc9247324e10eb58f2c2c9e84a1a9d9b336e6bdc788f9947c9e507a053d6fd2ffcd3d58e
HEAD_REF master
)

Expand All @@ -13,35 +13,73 @@ else()
set(BUILD_STATIC 0)
endif()

# Handle features
set(_COMPONENT_FLAGS "")
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")
endif()
endforeach()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS -DBUILD_STATIC=${BUILD_STATIC}
OPTIONS
-DBUILD_STATIC=${BUILD_STATIC}
${_COMPONENT_FLAGS}
)

vcpkg_install_cmake()

# Debug includes and share are the same as release
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# Drop a copy of tools
file(COPY ${CURRENT_PACKAGES_DIR}/bin/corrade-rc.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/corrade)
# Install tools
if("utility" IN_LIST FEATURES)
# Drop a copy of tools
file(COPY ${CURRENT_PACKAGES_DIR}/bin/corrade-rc.exe
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/corrade)

# Tools require dlls
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/corrade)
# Tools require dlls
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/corrade)

file(GLOB_RECURSE TO_REMOVE
${CURRENT_PACKAGES_DIR}/bin/*.exe
${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(REMOVE ${TO_REMOVE})
file(GLOB_RECURSE TO_REMOVE
${CURRENT_PACKAGES_DIR}/bin/*.exe
${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(REMOVE ${TO_REMOVE})
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
# Ensure no empty folders are left behind
if(NOT FEATURES)
# No features, no binaries (only Corrade.h).
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/lib
${CURRENT_PACKAGES_DIR}/debug)
# debug is completely empty, as include and share
# have already been removed.

elseif(VCPKG_LIBRARY_LINKAGE STREQUAL static)
# No dlls
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin)
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(COPY ${SOURCE_PATH}/COPYING
DESTINATION ${CURRENT_PACKAGES_DIR}/share/corrade)
file(RENAME
${CURRENT_PACKAGES_DIR}/share/corrade/COPYING
${CURRENT_PACKAGES_DIR}/share/corrade/copyright)

vcpkg_copy_pdbs()
9 changes: 9 additions & 0 deletions ports/magnum-extras/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Source: magnum-extras
Version: 2018.02-1
Build-Depends: magnum
Description: Extras for magnum, C++11/C++14 graphics middleware for games and data visualization http://magnum.graphics/
Default-Features:

Feature: ui
Description: Ui library
Build-Depends: corrade[interconnect], magnum[text]
72 changes: 72 additions & 0 deletions ports/magnum-extras/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mosra/magnum-extras
REF v2018.02
SHA512 62c0832d19a36e0f89ffcd958356130c81f577b1091a9232d43307868caf51a1fd186c4aa196bd456d3c37cb887c9802d80eb0b332893bafa812298dbc39d7b7
HEAD_REF master
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BUILD_STATIC 1)
else()
set(BUILD_STATIC 0)
endif()

# Handle features
set(_COMPONENT_FLAGS "")
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")
endif()
endforeach()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
${_COMPONENT_FLAGS}
-DBUILD_STATIC=${BUILD_STATIC}
-DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d
-DMAGNUM_PLUGINS_RELEASE_DIR=${CURRENT_INSTALLED_DIR}/bin/magnum
)

vcpkg_install_cmake()

# Messages to the user
if("ui" IN_LIST FEATURES)
message(WARNING "It is recommended to install one of magnum-plugins[freetypefont,harfbuzzfont,stbtruetypefont] to have the UI library working out of the box")
endif()

# Debug includes and share are the same as release
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share)

# Clean up empty directories
if(NOT FEATURES)
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/lib
${CURRENT_PACKAGES_DIR}/debug)
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
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)

vcpkg_copy_pdbs()
16 changes: 16 additions & 0 deletions ports/magnum-integration/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Source: magnum-integration
Version: 2018.02-1
Build-Depends: magnum
Description: Integrations for magnum, C++11/C++14 graphics middleware for games and data visualization http://magnum.graphics/
Default-Features:

Feature: bullet
Description: BulletIntegration library
Build-Depends: bullet3
#Feature: ovr
#Description: OvrIntegration library
#Build-Depends: ovrsdk
#Feature: dart
#Description: DartIntegration library
#Build-Depends: dart

67 changes: 67 additions & 0 deletions ports/magnum-integration/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mosra/magnum-integration
REF v2018.02
SHA512 b2db442d5e29c117ee30ee2c37f5087c3d360158a52eb6bc19e5c1a0388a0ec1338c53e3fdad618bb6f4aba5d88fe10d20bb1539e5f21a309b8f06f2e195279c
HEAD_REF master
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BUILD_STATIC 1)
else()
set(BUILD_STATIC 0)
endif()

# Handle features
set(_COMPONENT_FLAGS "")
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")
endif()
endforeach()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
${_COMPONENT_FLAGS}
-DBUILD_STATIC=${BUILD_STATIC}
-DMAGNUM_PLUGINS_DEBUG_DIR=${CURRENT_INSTALLED_DIR}/debug/bin/magnum-d
-DMAGNUM_PLUGINS_RELEASE_DIR=${CURRENT_INSTALLED_DIR}/bin/magnum
)

vcpkg_install_cmake()

# Debug includes and share are the same as release
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share)

# Clean up empty directories
if(NOT FEATURES)
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/lib
${CURRENT_PACKAGES_DIR}/debug)
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
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)

vcpkg_copy_pdbs()
83 changes: 80 additions & 3 deletions ports/magnum-plugins/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,81 @@
Source: magnum-plugins
Version: jan2018-1
Build-Depends: stb, magnum
Description: Plugins for C++11/C++14 and OpenGL graphics engine http://mosra.cz/blog/magnum.php
Version: 2018.02-1
Build-Depends: magnum
Description: Plugins for magnum, C++11/C++14 graphics middleware for games and data visualization http://magnum.graphics/
Default-Features: anyimageimporter, anysceneimporter, anyimageconverter, ddsimporter, miniexrimageconverter, opengeximporter, stanfordimporter, stbimageconverter, stbimageimporter

Feature: anyimageimporter
Description: AnyImageImporter plugin

Feature: anyaudioimporter
Description: AnyAudioImporter plugin

Feature: anyimageconverter
Description: AnyImageConverter plugin

Feature: anysceneimporter
Description: AnySceneImporter plugin

Feature: assimpimporter
Description: AssimpImporter plugin
Build-Depends: assimp, magnum-plugins[anyimageimporter]

Feature: ddsimporter
Description: DdsImporter plugin

Feature: devilimageimporter
Description: DevIlImageImporter plugin
Build-Depends: devil

Feature: drflacaudioimporter
Description: DrFlacAudioImporter plugin
Build-Depends: magnum[audio]

Feature: drwavaudioimporter
Description: DrWavAudioImporter plugin
Build-Depends: magnum[audio]

Feature: freetypefont
Description: FreeTypeFont plugin
Build-Depends: freetype, magnum[text]

Feature: harfbuzzfont
Description: HarfBuzzFont plugin
Build-Depends: harfbuzz, magnum-plugins[freetypefont]

Feature: jpegimporter
Description: JpegImporter plugin
Build-Depends: libjpeg-turbo

Feature: miniexrimageconverter
Description: MiniExrImageConverter plugin

Feature: opengeximporter
Description: OpenGexImporter plugin
Build-Depends: magnum-plugins[anyimageimporter]

Feature: pngimageconverter
Description: PngImageConverter plugin
Build-Depends: libpng

Feature: pngimporter
Description: PngImporter plugin
Build-Depends: libpng

Feature: stanfordimporter
Description: StanfordImporter plugin

Feature: stbimageconverter
Description: StbImageConverter plugin

Feature: stbimageimporter
Description: StbImageImporter plugin

Feature: stbtruetypefont
Description: StbTrueTypeFont plugin
Build-Depends: magnum[text]

Feature: stbvorbisaudioimporter
Description: StbVorbisAudioImporter plugin
Build-Depends: magnum[audio]

Loading

0 comments on commit 0822a28

Please sign in to comment.