vcpkg/ports/mpfr/portfile.cmake

30 lines
1.1 KiB
CMake
Raw Normal View History

2017-08-08 17:48:24 +02:00
include(vcpkg_common_functions)
2017-10-10 23:06:14 -07:00
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mpfr-3.1.6)
2017-08-08 17:48:24 +02:00
vcpkg_download_distfile(ARCHIVE
2017-10-10 23:06:14 -07:00
URLS "http://www.mpfr.org/mpfr-current/mpfr-3.1.6.tar.xz"
FILENAME "mpfr-3.1.6.tar.xz"
SHA512 746ee74d5026f267f74ab352d850ed30ff627d530aa840c71b24793e44875f8503946bd7399905dea2b2dd5744326254d7889337fe94cfe58d03c4066e9d8054
2017-08-08 17:48:24 +02:00
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/gmp_printf.c DESTINATION ${SOURCE_PATH}/src)
2017-08-08 17:48:24 +02:00
2017-11-29 11:49:09 -06:00
# Prepend stdint to the mpfr header
2017-11-29 11:56:17 -06:00
file(READ "${SOURCE_PATH}/src/mpfr.h" _contents)
2017-11-29 11:49:09 -06:00
string(CONCAT _contents "#include \"stdint.h\"\n" ${_contents})
2017-11-29 11:56:17 -06:00
file(WRITE "${SOURCE_PATH}/src/mpfr.h" ${_contents})
2017-11-29 11:49:09 -06:00
2017-08-08 17:48:24 +02:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mpfr)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/mpfr/COPYING ${CURRENT_PACKAGES_DIR}/share/mpfr/copyright)