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
2018-05-02 18:21:02 +08:00
R E F v 2 0 1 8 . 0 4
S H A 5 1 2 2 c 9 3 3 d 0 c a d 6 f 0 b 6 5 8 0 a 8 4 d b a 2 2 b f d a d f 1 2 0 a 3 0 2 2 4 6 c a b 4 0 4 a 9 9 7 4 9 e 0 b a 7 b b 0 d 7 9 9 e e 6 0 6 c a 4 3 c c 1 c 3 9 f 8 5 a e 3 7 a 0 0 d c c 7 3 7 4 b 9 f d 0 5 e b 2 b b 0 7 9 4 5 c 9 3 7 1 a 9 c 8 a 8 4 9 2
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 ( )