aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindGMP.cmake5
-rw-r--r--cmake/Modules/FindJson.cmake5
-rw-r--r--cmake/Modules/FindLua.cmake28
3 files changed, 32 insertions, 6 deletions
diff --git a/cmake/Modules/FindGMP.cmake b/cmake/Modules/FindGMP.cmake
index bb48289c5..64a57cfe0 100644
--- a/cmake/Modules/FindGMP.cmake
+++ b/cmake/Modules/FindGMP.cmake
@@ -1,4 +1,3 @@
-
option(ENABLE_SYSTEM_GMP "Use GMP from system" TRUE)
mark_as_advanced(GMP_LIBRARY GMP_INCLUDE_DIR)
set(USE_SYSTEM_GMP FALSE)
@@ -19,9 +18,9 @@ endif()
if(NOT USE_SYSTEM_GMP)
message(STATUS "Using bundled mini-gmp library.")
- set(GMP_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/gmp)
+ set(GMP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/gmp)
set(GMP_LIBRARY gmp)
- add_subdirectory(gmp)
+ add_subdirectory(lib/gmp)
endif()
include(FindPackageHandleStandardArgs)
diff --git a/cmake/Modules/FindJson.cmake b/cmake/Modules/FindJson.cmake
index e69d6c4c0..26339a295 100644
--- a/cmake/Modules/FindJson.cmake
+++ b/cmake/Modules/FindJson.cmake
@@ -20,8 +20,7 @@ endif()
if(NOT JSONCPP_FOUND)
message(STATUS "Using bundled JSONCPP library.")
- set(JSON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/jsoncpp)
+ set(JSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jsoncpp)
set(JSON_LIBRARY jsoncpp)
- add_subdirectory(jsoncpp/json)
+ add_subdirectory(lib/jsoncpp)
endif()
-
diff --git a/cmake/Modules/FindLua.cmake b/cmake/Modules/FindLua.cmake
new file mode 100644
index 000000000..be5d92d8c
--- /dev/null
+++ b/cmake/Modules/FindLua.cmake
@@ -0,0 +1,28 @@
+# Look for Lua library to use
+# This selects LuaJIT by default
+
+option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
+set(USE_LUAJIT FALSE)
+option(REQUIRE_LUAJIT "Require LuaJIT support" FALSE)
+if(REQUIRE_LUAJIT)
+ set(ENABLE_LUAJIT TRUE)
+endif()
+if(ENABLE_LUAJIT)
+ find_package(LuaJIT)
+ if(LUAJIT_FOUND)
+ set(USE_LUAJIT TRUE)
+ message (STATUS "Using LuaJIT provided by system.")
+ elseif(REQUIRE_LUAJIT)
+ message(FATAL_ERROR "LuaJIT not found whereas REQUIRE_LUAJIT=\"TRUE\" is used.\n"
+ "To continue, either install LuaJIT or do not use REQUIRE_LUAJIT=\"TRUE\".")
+ endif()
+else()
+ message (STATUS "LuaJIT detection disabled! (ENABLE_LUAJIT=0)")
+endif()
+
+if(NOT USE_LUAJIT)
+ message(STATUS "LuaJIT not found, using bundled Lua.")
+ set(LUA_LIBRARY lua)
+ set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/lua/src)
+ add_subdirectory(lib/lua)
+endif()