2017-06-08 03:08:08 +08:00
include ( vcpkg_common_functions )
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 / c o r r a d e
2019-02-12 05:49:12 +08:00
R E F v 2 0 1 9 . 0 1
S H A 5 1 2 6 3 4 6 8 e e 0 a 9 3 6 2 d 9 2 d 6 1 e 2 b c 7 7 f b 8 c 3 e 4 5 5 7 6 1 8 9 4 9 9 8 3 9 3 9 1 0 f 6 b c e 4 1 1 1 b 0 e c 7 4 d b 8 f e 2 a 8 6 5 8 c e c 1 2 9 2 c 5 c e b 2 6 e 5 7 e 0 0 5 3 2 4 b 3 4 f 1 e c 3 4 3 d 4 2 1 6 a b f 3 a 9 5 5 e a a 9 7 e
2017-06-10 11:38:25 +08:00
H E A D _ R E F m a s t e r
2019-02-07 03:18:53 +08:00
P A T C H E S f i x C 2 6 6 6 . p a t c h
2017-06-08 03:08:08 +08:00
)
2018-07-04 22:12:51 +08:00
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC )
2017-06-08 07:48:04 +08:00
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 ( )
2019-08-07 01:34:39 +08:00
if ( NOT VCPKG_CMAKE_SYSTEM_NAME )
# building for Windows desktop
if ( VCPKG_PLATFORM_TOOLSET STREQUAL "v142" AND NOT VCPKG_USE_HEAD_VERSION )
message ( "**********" )
message ( "WARNING: Visual Studio 2019 is not official supported by Corrade/Magnum team. Please use --head version if you intend to have upstream support." )
message ( "**********" )
set ( _CUSTOM_BUILD_FLAGS "-DCORRADE_MSVC2017_COMPATIBILITY=ON" )
endif ( )
endif ( )
2017-06-08 03:08:08 +08:00
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
2018-02-17 13:25:30 +08:00
O P T I O N S
2019-08-07 01:34:39 +08:00
- D U T I L I T Y _ U S E _ A N S I _ C O L O R S = O N
2018-02-17 13:25:30 +08:00
- D B U I L D _ S T A T I C = $ { B U I L D _ S T A T I C }
2019-08-07 01:34:39 +08:00
$ { _ C U S T O M _ B U I L D _ F L A G S }
2018-02-17 13:25:30 +08:00
$ { _ C O M P O N E N T _ F L A G S }
2017-06-08 03:08:08 +08:00
)
vcpkg_install_cmake ( )
2018-02-17 13:25:30 +08:00
# Debug includes and share are the same as release
2017-06-08 03:08:08 +08:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
2018-02-17 13:25:30 +08:00
# Install tools
if ( "utility" IN_LIST FEATURES )
2018-07-04 22:12:51 +08:00
file ( GLOB EXES
$ { C U R R E N T _ P A C K A G E S _ D I R } / b i n / c o r r a d e - r c
$ { C U R R E N T _ P A C K A G E S _ D I R } / b i n / c o r r a d e - r c . e x e
)
2018-02-17 13:25:30 +08:00
# Drop a copy of tools
2018-07-04 22:12:51 +08:00
file ( COPY ${ EXES } DESTINATION ${ CURRENT_PACKAGES_DIR } /tools/corrade )
2017-06-10 11:38:25 +08:00
2018-02-17 13:25:30 +08:00
# Tools require dlls
vcpkg_copy_tool_dependencies ( ${ CURRENT_PACKAGES_DIR } /tools/corrade )
2017-06-08 03:08:08 +08:00
2018-07-04 22:12:51 +08:00
file ( GLOB TO_REMOVE
$ { C U R R E N T _ P A C K A G E S _ D I R } / b i n / c o r r a d e - r c *
$ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / b i n / c o r r a d e - r c * )
2018-02-17 13:25:30 +08:00
file ( REMOVE ${ TO_REMOVE } )
endif ( )
2017-06-08 03:08:08 +08:00
2018-02-17 13:25:30 +08:00
# Ensure no empty folders are left behind
if ( NOT FEATURES )
# No features, no binaries (only Corrade.h).
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 )
# debug is completely empty, as include and share
# have already been removed.
2018-07-04 22:12:51 +08:00
elseif ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2018-02-17 13:25:30 +08:00
# No dlls
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 } / d e b u g / b i n )
2017-06-08 07:48:04 +08:00
endif ( )
2017-06-08 03:08:08 +08:00
# Handle copyright
2018-02-17 13:25:30 +08:00
file ( COPY ${ 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 / c o r r a d e )
file ( RENAME
$ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / c o r r a d e / C O P Y I N G
$ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / c o r r a d e / c o p y r i g h t )
2017-06-08 03:08:08 +08:00
2017-09-13 04:32:26 +08:00
vcpkg_copy_pdbs ( )