MPFR.cmake 1.3 KB

1234567891011121314151617181920212223242526272829
  1. set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
  2. set(_dstdir ${DESTDIR}/usr/local)
  3. if (MSVC)
  4. set(_output ${_dstdir}/include/mpfr.h
  5. ${_dstdir}/include/mpf2mpfr.h
  6. ${_dstdir}/lib/libmpfr-4.lib
  7. ${_dstdir}/bin/libmpfr-4.dll)
  8. add_custom_command(
  9. OUTPUT ${_output}
  10. COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${_dstdir}/include/
  11. COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${_dstdir}/include/
  12. COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.lib ${_dstdir}/lib/
  13. COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${_dstdir}/bin/
  14. )
  15. add_custom_target(dep_MPFR SOURCES ${_output})
  16. else ()
  17. ExternalProject_Add(dep_MPFR
  18. 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
  19. BUILD_IN_SOURCE ON
  20. CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
  21. BUILD_COMMAND make -j
  22. INSTALL_COMMAND make install
  23. DEPENDS dep_GMP
  24. )
  25. endif ()