2017-01-23 21:49:13 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-03-11 20:35:54 +03:00
|
|
|
|
|
|
|
set(MPIR_VERSION 3.0.0)
|
|
|
|
set(MPIR_HASH "c735105db8b86db739fd915bf16064e6bc82d0565ad8858059e4e93f62c9d72d9a1c02a5ca9859b184346a8dc64fa714d4d61404cff1e405dc548cbd54d0a88e")
|
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpir-${MPIR_VERSION})
|
|
|
|
|
2017-01-23 21:49:13 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2017-03-11 20:35:54 +03:00
|
|
|
URLS "http://mpir.org/mpir-${MPIR_VERSION}.tar.bz2"
|
|
|
|
FILENAME "mpir-${MPIR_VERSION}.tar.bz2"
|
|
|
|
SHA512 ${MPIR_HASH}
|
2017-01-23 21:49:13 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
|
|
|
|
2017-03-13 14:05:04 -07:00
|
|
|
if(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
|
2017-03-11 20:35:54 +03:00
|
|
|
set(MSVC_VERSION 15)
|
|
|
|
else()
|
|
|
|
set(MSVC_VERSION 14)
|
|
|
|
endif()
|
|
|
|
|
2017-01-23 21:49:13 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
vcpkg_build_msbuild(
|
2017-03-11 20:35:54 +03:00
|
|
|
PROJECT_PATH ${SOURCE_PATH}/build.vc${MSVC_VERSION}/dll_mpir_gc/dll_mpir_gc.vcxproj
|
2017-01-23 21:49:13 +08:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_build_msbuild(
|
2017-03-11 20:35:54 +03:00
|
|
|
PROJECT_PATH ${SOURCE_PATH}/build.vc${MSVC_VERSION}/lib_mpir_gc/lib_mpir_gc.vcxproj
|
2017-01-23 21:49:13 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2017-03-13 14:05:04 -07:00
|
|
|
IF (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
|
2017-01-23 21:49:13 +08:00
|
|
|
SET(BUILD_ARCH "Win32")
|
|
|
|
ELSE()
|
2017-03-13 14:05:04 -07:00
|
|
|
SET(BUILD_ARCH ${VCPKG_TARGET_ARCHITECTURE})
|
2017-01-23 21:49:13 +08:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmp.h
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/gmpxx.h
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.h
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpirxx.h
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.dll
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.dll
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Debug/mpir.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/dll/${BUILD_ARCH}/Release/mpir.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
)
|
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright)
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
else()
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmp.h
|
|
|
|
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/gmpxx.h
|
|
|
|
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.h
|
|
|
|
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpirxx.h
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/lib/${BUILD_ARCH}/Debug/mpir.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${SOURCE_PATH}/lib/${BUILD_ARCH}/Release/mpir.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
)
|
2017-03-13 14:05:04 -07:00
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpir RENAME copyright)
|
2017-01-23 21:49:13 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Installing done")
|