From 430b62322355c0bfe6233586c9823013d60a3335 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 17 Jul 2016 16:23:29 +0200 Subject: Use system Lua, if available, to generate bindings. Closes #1031. --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 02de722bb..f5ea75ba5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,18 @@ endif() set(BUILD_TOOLS OFF CACHE BOOL "") set(SELF_TEST OFF CACHE BOOL "") +# Check whether Lua 5.1 is installed locally: +include(CheckLua.cmake) +if(HAS_LUA_INTERPRETER AND ("${LUA_INTERPRETER_VERSION}" STREQUAL "5.1")) + message(STATUS "Lua 5.1 has been found in your system and will be used for the build.") +else() + if (CROSSCOMPILE) + message(FATAL "To crosscompile, you need to have Lua 5.1 installed in your system and available in PATH.") + endif() + message(STATUS "Lua 5.1 has NOT been found in your system, the build will use its own Lua implementation.") +endif() + + # This has to be done before any flags have been set up. if(${BUILD_TOOLS}) message("Building tools") -- cgit v1.2.3 From 2a05d8870d4df10593b7d0330d436f39151ae41c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 17 Jul 2016 16:42:38 +0200 Subject: CMake: Silenced CMP0054 policy warning. The warning is still emitted for jsoncpp and libevent, but not for Cuberite anymore. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f5ea75ba5..272f2394d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required (VERSION 2.8.7) +if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) +endif() + # Without this, the MSVC variable isn't defined for MSVC builds ( http://www.cmake.org/pipermail/cmake/2011-November/047130.html ) enable_language(CXX C) -- cgit v1.2.3