2019-12-10 10:08:54 +00:00
|
|
|
|
|
|
|
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
|
|
|
|
set(_dstdir ${DESTDIR}/usr/local)
|
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
set(_output ${_dstdir}/include/gmp.h
|
|
|
|
${_dstdir}/lib/libgmp-10.lib
|
2019-12-10 14:49:52 +00:00
|
|
|
${_dstdir}/bin/libgmp-10.dll)
|
2019-12-10 10:08:54 +00:00
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_output}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${_dstdir}/include/
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.lib ${_dstdir}/lib/
|
2019-12-10 14:49:52 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.dll ${_dstdir}/bin/
|
2019-12-10 10:08:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(dep_GMP SOURCES ${_output})
|
|
|
|
|
2019-12-10 11:50:52 +00:00
|
|
|
else ()
|
|
|
|
ExternalProject_Add(dep_GMP
|
|
|
|
URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
|
|
|
|
BUILD_IN_SOURCE ON
|
|
|
|
CONFIGURE_COMMAND ./configure --enable-shared=no --enable-static=yes "--prefix=${DESTDIR}/usr/local" --with-pic
|
|
|
|
BUILD_COMMAND make -j
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
)
|
2019-12-10 10:08:54 +00:00
|
|
|
endif ()
|