add gmp library
@@ -20,6 +20,21 @@ if(NOT EXISTS ${LMDB_SRC_DIR})
execute_process(COMMAND git clone https://github.com/lmdb/lmdb.git ${LMDB_SRC_DIR})
endif()
+set(GMP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/gmp-6.1.2)
+set(GMP_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/gmp-6.1.2)
+
+include(ExternalProject)
+
+ExternalProject_Add(libgmp
+ SOURCE_DIR ${GMP_SRC_DIR}
+ BINARY_DIR ${GMP_BUILD_DIR}
+ TMP_DIR ${GMP_BUILD_DIR}
+ STAMP_DIR ${GMP_BUILD_DIR}
+ CONFIGURE_COMMAND ${GMP_SRC_DIR}/configure --prefix=${LIB_DIR} --enable-static=no > /dev/null
+ PREFIX ${GMP_SRC_DIR}
+ BUILD_COMMAND $(MAKE) CFLAGS="${CMAKE_C_FLAGS}" all install > make.log
+ BUILD_ALWAYS 1)
+
add_custom_target(libtool DEPENDS libluajit liblmdb)
add_custom_target(libluajit $(MAKE) PREFIX=${LIB_DIR} ${CFLAGS} all install
