2019-12-10 10:08:54 +00:00
|
|
|
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
|
|
|
|
set(_dstdir ${DESTDIR}/usr/local)
|
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
set(_output ${_dstdir}/include/mpfr.h
|
|
|
|
${_dstdir}/include/mpf2mpfr.h
|
|
|
|
${_dstdir}/lib/libmpfr-4.lib
|
2019-12-10 14:49:52 +00:00
|
|
|
${_dstdir}/bin/libmpfr-4.dll)
|
2019-12-10 10:08:54 +00:00
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_output}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${_dstdir}/include/
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${_dstdir}/include/
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.lib ${_dstdir}/lib/
|
2019-12-10 14:49:52 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${_dstdir}/bin/
|
2019-12-10 10:08:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(dep_MPFR SOURCES ${_output})
|
|
|
|
|
2019-12-10 11:50:52 +00:00
|
|
|
else ()
|
2021-03-22 16:44:41 +00:00
|
|
|
|
|
|
|
set(_cross_compile_arg "")
|
|
|
|
if (CMAKE_CROSSCOMPILING)
|
|
|
|
# TOOLCHAIN_PREFIX should be defined in the toolchain file
|
|
|
|
set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX})
|
|
|
|
endif ()
|
|
|
|
|
2019-12-10 11:50:52 +00:00
|
|
|
ExternalProject_Add(dep_MPFR
|
2019-12-18 10:57:21 +00:00
|
|
|
URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed
|
2021-03-23 18:01:18 +00:00
|
|
|
URL_HASH SHA256=cf4f4b2d80abb79e820e78c8077b6725bbbb4e8f41896783c899087be0e94068
|
|
|
|
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
|
2019-12-10 11:50:52 +00:00
|
|
|
BUILD_IN_SOURCE ON
|
2021-03-22 16:44:41 +00:00
|
|
|
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
|
2019-12-10 11:50:52 +00:00
|
|
|
BUILD_COMMAND make -j
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
DEPENDS dep_GMP
|
|
|
|
)
|
2020-03-18 11:17:05 +00:00
|
|
|
endif ()
|