2020-08-06 05:08:18 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/include/gmp.h" OR "${CURRENT_INSTALLED_DIR}/include/gmpxx.h" )
message ( FATAL_ERROR "Can't build ${PORT} if mpir is installed. Please remove mpir, and try install ${PORT} again if you need it." )
endif ( )
2020-05-08 22:55:11 +02: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
2020-12-28 11:26:40 -08:00
R E F 0 0 1 8 c 4 4 e 8 d f c c 3 b 6 4 b 4 3 e 0 a e a 4 b 3 f 4 1 9 f 0 b 6 5 f d 0 #v6.2.1-2
S H A 5 1 2 2 4 0 5 e 2 5 3 6 c a 9 f e 0 b 8 9 0 f 4 4 f 5 4 c 9 3 6 a c 0 e 4 b 5 a 9 e b e 6 a 1 9 e 1 c 4 8 a 9 c 2 1 b 7 2 1 1 d 2 a 1 b 4 5 8 6 5 8 5 2 e 3 c 6 5 a 9 8 a 6 7 3 5 2 1 6 a 4 e 2 7 b e a 7 5 c 0 f d 6 e 5 2 e f e e d 4 b a e c d 9 5 d a 9 8 9 5 a 5
2020-05-08 22:55:11 +02:00
H E A D _ R E F m a s t e r
2020-10-28 14:26:41 -07:00
P A T C H E S
2020-08-06 05:08:18 +08:00
v s . b u i l d . p a t c h
r u n t i m e . p a t c h
2020-05-08 22:55:11 +02:00
)
2020-10-28 14:26:41 -07:00
include ( ${ CURRENT_INSTALLED_DIR } /share/yasm-tool-helper/yasm-tool-helper.cmake )
yasm_tool_helper ( OUT_VAR YASM )
file ( TO_NATIVE_PATH "${YASM}" YASM )
2020-05-08 22:55:11 +02: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
2020-12-28 11:26:40 -08:00
set ( _porjectfile )
if ( VCPKG_TARGET_IS_UWP )
set ( _porjectfile "${SOURCE_PATH}/SMP/libgmp_winrt.vcxproj" )
else ( )
set ( _porjectfile "${SOURCE_PATH}/SMP/libgmp.vcxproj" )
endif ( )
set ( _file "${_porjectfile}" )
2020-05-08 22:55:11 +02:00
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
file ( WRITE "${_file}" "${_contents}" )
2020-10-28 14:26:41 -07:00
2020-05-08 22:55:11 +02:00
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-10-28 14:26:41 -07:00
O P T I O N S " / p : Y a s m P a t h = $ { Y A S M } "
2020-05-08 22:55:11 +02: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" )
2020-12-28 11:26:40 -08:00
set ( PACKAGE_VERSION 6.2.1 )
2020-05-08 22:55:11 +02:00
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
2020-12-28 11:26:40 -08:00
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 . 1 . t a r . x z
F I L E N A M E g m p - 6 . 2 . 1 . t a r . x z
S H A 5 1 2 c 9 9 b e 0 9 5 0 a 1 d 0 5 a 0 2 9 7 d 6 5 6 4 1 d d 3 5 b 7 5 b 7 4 4 6 6 f 7 b f 0 3 c 9 e 8 a 9 9 8 9 5 a 3 b 2 f 9 a 0 8 5 6 c d 1 7 8 8 7 7 3 8 f a 5 1 c f 7 4 9 9 7 8 1 b 6 5 c 0 4 9 7 6 9 2 7 1 c b c b 7 7 d 0 5 7 d 2 e 9 f 1 e c 5 2 e 0 7 d d 8 4
)
2020-05-08 22:55:11 +02:00
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 }
2020-12-28 11:26:40 -08:00
R E F g m p - 6 . 2 . 1
2020-05-08 22:55:11 +02:00
)
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
)
vcpkg_install_make ( )
vcpkg_fixup_pkgconfig ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( INSTALL "${SOURCE_PATH}/COPYINGv3" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )
2020-10-28 14:26:41 -07:00
endif ( )