2017-06-10 11:38:25 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O m o s r a / m a g n u m - p l u g i n s
2020-07-14 23:38:18 +08:00
R E F v 2 0 2 0 . 0 6
S H A 5 1 2 3 c 1 1 c 2 9 2 8 b f c 9 d 0 4 c 1 a d 6 4 f 7 2 b 6 f f a c 6 c f 8 0 a 1 e f 3 a a c c 5 d 0 4 8 6 b 9 a d 9 5 5 c f 4 f 6 e a 6 d 5 d c b 3 8 4 6 d c 5 d 7 3 f 6 4 e c 5 2 2 a 0 1 5 e a f b 9 9 7 f 6 2 c 7 9 a d 7 f f 9 1 1 6 9 7 0 2 3 4 1 f 2 3 a f 0
2017-06-10 11:38:25 +08:00
H E A D _ R E F m a s t e r
2017-06-15 22:49:43 +08:00
P A T C H E S
2020-07-21 10:47:16 +08:00
0 0 2 - f i x - s t b - c o n f l i c t . p a t c h
2017-06-10 22:48:40 +08:00
)
2020-07-14 23:38:18 +08:00
if ( "basisimporter" IN_LIST FEATURES OR "basisimageconverter" IN_LIST FEATURES )
2021-11-19 12:13:14 +08:00
# Bundle Basis Universal. The repo has big unrequired files in its
2020-07-14 23:38:18 +08:00
# history, so we're downloading just a snapshot instead of a git clone.
2021-11-19 12:13:14 +08:00
if ( VCPKG_USE_HEAD_VERSION )
# v1_15_update2
set ( _BASIS_VERSION "v1_15_update2" )
set ( _BASIS_SHA512 "a898a057b57ac64f6c0bf5fce0b599e23421ccdd015ea7bb668bce8b9292ef55b098f3d05854a2fb5363959932b75cd0a842664ae7d4f71f3537dc11301c1b32" )
else ( )
# A commit that's before the UASTC support (which is not implemented yet)
vcpkg_download_distfile (
_ B A S I S _ U N I V E R S A L _ P A T C H E S
U R L S " h t t p s : / / g i t h u b . c o m / B i n o m i a l L L C / b a s i s _ u n i v e r s a l / c o m m i t / e 9 c 5 5 f a a c 7 7 4 5 e b f 3 8 d 0 8 c d 3 b 4 f 7 1 a a f 5 4 2 f 8 1 9 1 . d i f f "
F I L E N A M E " e 9 c 5 5 f a a c 7 7 4 5 e b f 3 8 d 0 8 c d 3 b 4 f 7 1 a a f 5 4 2 f 8 1 9 1 . p a t c h "
S H A 5 1 2 e 5 d d a 1 1 d e 2 b a 8 c f d 3 9 7 2 8 e 6 9 c 7 4 a 7 6 5 6 b b 5 2 2 e 5 0 9 7 8 6 f e 5 6 7 3 c 9 4 b 2 6 b e 9 b d 4 b e e 8 9 7 5 1 0 0 9 6 4 7 9 e e 6 3 2 3 f 5 2 7 6 d 3 4 c b a 1 c 4 4 c 6 0 8 0 4 a 5 1 5 c 0 b 3 5 f f 7 b 6 a c 9 d 6 2 5 b 8 8
)
set ( _BASIS_VERSION "8565af680d1bd2ad56ab227ca7d96c56dfbe93ed" )
set ( _BASIS_SHA512 "65062ab3ba675c46760f56475a7528189ed4097fb9bab8316e25d9e23ffec2a9560eb9a6897468baf2a6ab2bd698b5907283e96deaeaef178085a47f9d371bb2" )
endif ( )
2020-07-14 23:38:18 +08:00
vcpkg_download_distfile (
_ B A S I S _ U N I V E R S A L _ A R C H I V E
U R L S " h t t p s : / / g i t h u b . c o m / B i n o m i a l L L C / b a s i s _ u n i v e r s a l / a r c h i v e / $ { _ B A S I S _ V E R S I O N } . t a r . g z "
F I L E N A M E " b a s i s - u n i v e r s a l - $ { _ B A S I S _ V E R S I O N } . t a r . g z "
2021-11-19 12:13:14 +08:00
S H A 5 1 2 $ { _ B A S I S _ S H A 5 1 2 }
2020-07-14 23:38:18 +08:00
)
2021-11-19 12:13:14 +08:00
vcpkg_extract_source_archive (
_ B A S I S _ U N I V E R S A L _ S O U R C E
2020-07-14 23:38:18 +08:00
A R C H I V E $ { _ B A S I S _ U N I V E R S A L _ A R C H I V E }
W O R K I N G _ D I R E C T O R Y " $ { S O U R C E _ P A T H } / s r c / e x t e r n a l "
P A T C H E S
$ { _ B A S I S _ U N I V E R S A L _ P A T C H E S } )
# 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 ( )
2017-06-09 20:17:01 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
2018-04-19 10:33:12 +08:00
set ( BUILD_PLUGINS_STATIC 1 )
2017-06-09 20:17:01 +08:00
else ( )
2018-04-19 10:33:12 +08:00
set ( BUILD_PLUGINS_STATIC 0 )
2017-06-09 20:17:01 +08:00
endif ( )
2021-01-27 07:03:54 +08:00
# Head only features
set ( ALL_SUPPORTED_FEATURES ${ ALL_FEATURES } )
if ( NOT VCPKG_USE_HEAD_VERSION )
2021-11-19 12:13:14 +08:00
list ( REMOVE_ITEM ALL_SUPPORTED_FEATURES cgltfimporter glslangshaderconverter
k t x i m a g e c o n v e r t e r k t x i m p o r t e r o p e n e x r i m a g e c o n v e r t e r o p e n e x r i m p o r t e r
s p i r v t o o l s s h a d e r c o n v e r t e r s t b d x t i m a g e c o n v e r t e r )
message ( WARNING "Features cgltfimporter, glslangshaderconverter, ktximageconverter, ktximporter, openexrimageconverter, openexrimporter, spirvtoolsshaderconverter and stbdxtimageconverter are not available when building non-head version." )
2021-01-27 07:03:54 +08:00
endif ( )
2020-07-14 23:38:18 +08:00
set ( _COMPONENTS "" )
# Generate cmake parameters from feature names
2021-01-27 07:03:54 +08:00
foreach ( _feature IN LISTS ALL_SUPPORTED_FEATURES )
2018-02-17 13:25:30 +08:00
# Uppercase the feature name and replace "-" with "_"
string ( TOUPPER "${_feature}" _FEATURE )
string ( REPLACE "-" "_" _FEATURE "${_FEATURE}" )
2020-07-14 23:38:18 +08:00
# Final feature is empty, ignore it
if ( _feature )
list ( APPEND _COMPONENTS ${ _feature } WITH_ ${ _FEATURE } )
2018-02-17 13:25:30 +08:00
endif ( )
endforeach ( )
2021-04-30 04:49:04 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES ${ _COMPONENTS } )
2020-07-14 23:38:18 +08:00
2021-11-19 12:13:14 +08:00
vcpkg_cmake_configure (
2017-06-09 20:17:01 +08:00
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2017-06-10 11:38:25 +08:00
O P T I O N S
2020-07-14 23:38:18 +08:00
$ { F E A T U R E _ O P T I O N S }
2018-04-19 10:33:12 +08:00
- D B U I L D _ S T A T I C = $ { B U I L D _ P L U G I N S _ S T A T I C }
- D B U I L D _ P L U G I N S _ S T A T I C = $ { B U I L D _ P L U G I N S _ S T A T I C }
2017-06-22 18:29:00 +08:00
- D M A G N U M _ P L U G I N S _ D E B U G _ D I R = $ { C U R R E N T _ I N S T A L L E D _ D I R } / d e b u g / b i n / m a g n u m - d
- D M A G N U M _ P L U G I N S _ R E L E A S E _ D I R = $ { C U R R E N T _ I N S T A L L E D _ D I R } / b i n / m a g n u m
2017-06-09 20:17:01 +08:00
)
2021-11-19 12:13:14 +08:00
vcpkg_cmake_install ( )
2017-06-09 20:17:01 +08:00
2018-02-17 13:25:30 +08:00
# Debug includes and share are the same as release
file ( REMOVE_RECURSE
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e )
2018-05-02 18:21:02 +08:00
# Clean up empty directories, if not building anything.
# FEATURES may only contain "core", but that does not build anything.
if ( NOT FEATURES OR FEATURES STREQUAL "core" )
2018-02-17 13:25:30 +08:00
file ( REMOVE_RECURSE
$ { C U R R E N T _ P A C K A G E S _ D I R } / b i n
$ { C U R R E N T _ P A C K A G E S _ D I R } / l i b
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g )
set ( VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled )
endif ( )
2017-06-09 20:17:01 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
2018-05-02 18:21:02 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /bin )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/bin )
# 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 )
2017-06-22 18:29:00 +08:00
else ( )
2018-05-02 18:17:57 +08:00
set ( VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled )
2021-02-19 05:02:27 +08:00
# On windows, plugins are "Modules" that cannot be linked as shared
# libraries, but are meant to be loaded at runtime.
# While this is handled adequately through the CMake project, the auto-magic
# linking with visual studio might try to link the import libs anyway.
#
# We delete the import libraries here to avoid the auto-magic linking
# for plugins which are loaded at runtime.
if ( WIN32 )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /lib/magnum )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/lib/magnum-d )
endif ( )
2017-06-09 20:17:01 +08:00
endif ( )
# Handle copyright
2020-07-14 23:38:18 +08:00
file ( INSTALL ${ SOURCE_PATH } /COPYING
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / $ { P O R T }
R E N A M E c o p y r i g h t )
2017-06-09 20:17:01 +08:00
2017-09-13 04:32:26 +08:00
vcpkg_copy_pdbs ( )