* update deps * fix win build errors * fix mac build * update linux (cherry picked from commit 77b6225060fd1b6cbc32865b6397363befd2af1d)
39 lines
1.6 KiB
CMake
39 lines
1.6 KiB
CMake
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
|
|
${_dstdir}/bin/libmpfr-4.dll)
|
|
|
|
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/
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${_dstdir}/bin/
|
|
)
|
|
|
|
add_custom_target(dep_MPFR SOURCES ${_output})
|
|
|
|
else ()
|
|
|
|
set(_cross_compile_arg "")
|
|
if (CMAKE_CROSSCOMPILING)
|
|
# TOOLCHAIN_PREFIX should be defined in the toolchain file
|
|
set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX})
|
|
endif ()
|
|
|
|
ExternalProject_Add(dep_MPFR
|
|
URL https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2
|
|
URL_HASH SHA256=b9df93635b20e4089c29623b19420c4ac848a1b29df1cfd59f26cab0d2666aa0
|
|
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
|
|
BUILD_IN_SOURCE ON
|
|
CONFIGURE_COMMAND autoreconf -f -i &&
|
|
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}
|
|
BUILD_COMMAND make -j
|
|
INSTALL_COMMAND make install
|
|
DEPENDS dep_GMP
|
|
)
|
|
endif ()
|