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-10-26 04:05:28 +08:00
R E F v 2 0 1 9 . 1 0
S H A 5 1 2 5 d 1 6 1 f 7 8 8 4 4 b 0 6 e 1 a 9 9 7 9 c 7 e 2 4 4 9 6 8 a 6 9 1 0 1 2 e 7 2 1 2 e 0 5 d f 3 e e 3 5 7 2 f 5 d f 9 a a 6 9 e 8 6 3 0 9 f 4 2 6 a 8 9 f 3 5 6 f 4 8 3 f 6 d e 3 8 7 1 3 6 6 a 8 e 1 1 b 1 7 0 1 a 5 7 8 f 8 6 5 e a 7 3 8 c c 8 e e e 5 1 5 b
2017-06-10 11:38:25 +08:00
H E A D _ R E F m a s t e r
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 ( )