2018-02-17 13:25:30 +08:00
include ( vcpkg_common_functions )
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 - e x t r a s
2019-02-12 05:49:12 +08:00
R E F v 2 0 1 9 . 0 1
S H A 5 1 2 b 7 1 1 6 e 5 3 a 6 1 3 2 c 9 3 7 a d 1 d c 1 0 d 2 5 1 d 0 b 9 8 8 8 4 3 7 5 a 1 4 e 9 4 7 c 5 d d f a 0 4 6 c d 7 a 8 e 7 e 6 0 e d d f 2 8 0 2 e 1 c 9 4 5 1 6 8 f c b 4 2 d 7 8 f b 1 3 6 3 9 f e 6 5 e a 2 5 9 c 6 a 4 4 f 0 6 4 e 6 0 6 5 e e 5 a e 3 a f
2018-02-17 13:25:30 +08:00
H E A D _ R E F m a s t e r
)
2018-03-25 00:33:40 +08:00
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC )
2018-02-17 13:25:30 +08:00
# 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 (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R E F E R _ N I N J A # Disable this option if project cannot be built with Ninja
O P T I O N S
$ { _ C O M P O N E N T _ F L A G S }
- D B U I L D _ S T A T I C = $ { B U I L D _ S T A T I C }
- 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
)
vcpkg_install_cmake ( )
2018-02-24 18:27:48 +08:00
vcpkg_fixup_cmake_targets ( CONFIG_PATH share/cmake/MagnumExtras TARGET_PATH share/MagnumExtras )
2018-02-17 13:25:30 +08:00
# 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
$ { 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
2018-03-25 00:33:40 +08:00
$ { 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-02-17 13:25:30 +08:00
# Clean up empty directories
2018-03-25 00:33:40 +08:00
if ( "${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
2018-02-24 18:27:48 +08:00
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g
)
2018-02-17 13:25:30 +08:00
set ( VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled )
endif ( )
2018-02-24 18:27:48 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2018-02-17 13:25:30 +08:00
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 ( )