2020-05-09 04:55:11 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
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 S h i f t M e d i a P r o j e c t / g m p
R E F e 1 4 0 d f c 8 6 6 8 e 9 6 d 7 e 5 6 c b d 4 6 4 6 7 9 4 5 a d c c 6 b 3 c c 4 #v6.2.0
S H A 5 1 2 3 b 6 4 6 c 1 4 2 4 4 7 9 4 6 b b 4 5 5 6 d b 0 1 2 1 4 f f 1 3 0 d a 9 1 7 b c 1 4 9 9 4 6 b 8 c f 0 8 6 f 3 b 0 1 e 1 c c 3 d 6 6 4 b 9 4 1 a 3 0 a 4 2 6 0 8 7 9 9 c 1 4 4 6 1 b 2 f 2 9 e 4 b 8 9 4 b 7 2 9 1 5 d 7 2 3 b d 7 3 6 5 1 3 c 8 9 1 4 7 2 9 b 7
H E A D _ R E F m a s t e r
P A T C H E S v s . b u i l d . p a t c h
r u n t i m e . p a t c h
p r e f i x . p a t c h
)
vcpkg_find_acquire_program ( YASM )
get_filename_component ( YASM_DIR "${YASM}" DIRECTORY )
2020-05-27 12:42:12 +08:00
vcpkg_add_to_path ( "${YASM_DIR}" )
2020-05-09 04:55:11 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
set ( CONFIGURATION_RELEASE ReleaseDLL )
set ( CONFIGURATION_DEBUG DebugDLL )
else ( )
set ( CONFIGURATION_RELEASE Release )
set ( CONFIGURATION_DEBUG Debug )
endif ( )
if ( VCPKG_TARGET_IS_UWP )
string ( APPEND CONFIGURATION_RELEASE WinRT )
string ( APPEND CONFIGURATION_DEBUG WinRT )
endif ( )
#Setup YASM integration
set ( _file "${SOURCE_PATH}/SMP/libgmp.vcxproj" )
file ( READ "${_file}" _contents )
string ( REPLACE [[<Import Project= "$(VCTargetsPath)\BuildCustomizations\yasm.props" />]]
" < I m p o r t P r o j e c t = \ " $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / v s - y a s m / y a s m . p r o p s \ " / > "
_ c o n t e n t s " $ { _ c o n t e n t s } " )
string ( REPLACE [[<Import Project= "$(VCTargetsPath)\BuildCustomizations\yasm.targets" />]]
" < I m p o r t P r o j e c t = \ " $ { C U R R E N T _ I N S T A L L E D _ D I R } / s h a r e / v s - y a s m / y a s m . t a r g e t s \ " / > "
_ c o n t e n t s " $ { _ c o n t e n t s } " )
string ( REGEX REPLACE "${VCPKG_ROOT_DIR}/installed/[^/]+/share" "${CURRENT_INSTALLED_DIR}/share" _contents "${_contents}" ) # Above already replaced by another triplet
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
STRING ( REPLACE ">MultiThreadedDebugDLL<" ">MultiThreadedDebug<" _contents "${_contents}" )
STRING ( REPLACE ">MultiThreadedDLL<" ">MultiThreaded<" _contents "${_contents}" )
else ( )
STRING ( REPLACE ">MultiThreadedDebug<" ">MultiThreadedDebugDLL<" _contents "${_contents}" )
STRING ( REPLACE ">MultiThreaded<" ">MultiThreadedDLL<" _contents "${_contents}" )
endif ( )
file ( WRITE "${_file}" "${_contents}" )
vcpkg_install_msbuild (
U S E _ V C P K G _ I N T E G R A T I O N
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R O J E C T _ S U B P A T H S M P / l i b g m p . s l n
P L A T F O R M $ { T R I P L E T _ S Y S T E M _ A R C H }
L I C E N S E _ S U B P A T H C O P Y I N G . L E S S E R v 3
T A R G E T R e b u i l d
R E L E A S E _ C O N F I G U R A T I O N $ { C O N F I G U R A T I O N _ R E L E A S E }
D E B U G _ C O N F I G U R A T I O N $ { C O N F I G U R A T I O N _ D E B U G }
S K I P _ C L E A N
2020-05-27 12:42:12 +08:00
O P T I O N S / p : U s e E n v = T r u e
2020-05-09 04:55:11 +08:00
)
get_filename_component ( SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME )
file ( RENAME "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/${SOURCE_PATH_SUFFIX}/msvc/include" "${CURRENT_PACKAGES_DIR}/include" )
set ( PACKAGE_VERSION 6.2.0 )
set ( PACKAGE_NAME gmp )
set ( prefix "${CURRENT_INSTALLED_DIR}" )
set ( exec_prefix "\${prefix}" )
set ( libdir "\${prefix}/lib" )
set ( includedir "\${prefix}/include" )
set ( LIBS -lgmp )
configure_file ( "${SOURCE_PATH}/gmp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gmp.pc" @ONLY )
configure_file ( "${SOURCE_PATH}/gmpxx.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/gmpxx.pc" @ONLY )
set ( prefix "${CURRENT_INSTALLED_DIR}/debug" )
set ( exec_prefix "\${prefix}" )
set ( libdir "\${prefix}/lib" )
set ( includedir "\${prefix}/../include" )
set ( LIBS -lgmpd )
configure_file ( "${SOURCE_PATH}/gmp.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gmp.pc" @ONLY )
configure_file ( "${SOURCE_PATH}/gmpxx.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/gmpxx.pc" @ONLY )
vcpkg_fixup_pkgconfig ( )
else ( )
vcpkg_download_distfile (
A R C H I V E
U R L S h t t p s : / / g m p l i b . o r g / d o w n l o a d / g m p / g m p - 6 . 2 . 0 . t a r . x z
F I L E N A M E g m p - 6 . 2 . 0 . t a r . x z
S H A 5 1 2 a 0 6 6 f 0 4 5 6 f 0 3 1 4 a 1 3 5 9 f 5 5 3 c 4 9 f c 2 5 8 7 e 4 8 4 f f 8 a c 3 9 0 f f 8 8 5 3 7 2 6 6 a 1 4 6 e a 3 7 3 f 9 7 a 1 c 0 b a 2 4 6 0 8 b f 6 7 5 6 f 4 e a b 1 1 c 9 0 5 6 f 1 0 3 c 8 d e b 9 9 e 5 b 5 7 7 4 1 b 4 f 7 f 0 e c 4 4 b 9 0 c )
vcpkg_extract_source_archive_ex (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
A R C H I V E $ { A R C H I V E }
R E F g m p - 6 . 2 . 0
)
vcpkg_configure_make (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
A U T O C O N F I G
O P T I O N S $ { O P T I O N S }
)
vcpkg_install_make ( )
vcpkg_fixup_pkgconfig ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
# # Handle copyright
file ( INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )
endif ( )