38 lines
1.0 KiB
Diff
38 lines
1.0 KiB
Diff
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -215,8 +215,6 @@
|
|
message (STATUS "LuaJIT headers: ${LUA_INCLUDE_DIR}")
|
|
else (NOT ${DISABLE_LUAJIT} MATCHES "1")
|
|
message (STATUS "LuaJIT detection disabled! (DISABLE_LUAJIT=1)")
|
|
- set(LUA_LIBRARY "")
|
|
- set(LUA_INCLUDE_DIR "")
|
|
endif (NOT DISABLE_LUAJIT)
|
|
|
|
set(USE_LUAJIT 0)
|
|
@@ -267,11 +265,22 @@
|
|
endif (VALID_LUAJIT_VERSION)
|
|
endif (LUA_LIBRARY AND LUA_INCLUDE_DIR)
|
|
|
|
+OPTION(WITH_BUNDLED_LUA "Use bundled lua")
|
|
+
|
|
if(NOT USE_LUAJIT)
|
|
message (STATUS "LuaJIT not found, using bundled Lua.")
|
|
- set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
|
|
- set(LUA_LIBRARY "lua")
|
|
- add_subdirectory(lua)
|
|
+ if (WITH_BUNDLED_LUA)
|
|
+ set(LUA_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lua/src")
|
|
+ set(LUA_LIBRARY "lua")
|
|
+ add_subdirectory(lua)
|
|
+ else (WITH_BUNDLED_LUA)
|
|
+ find_package(Lua51)
|
|
+ if(LUA51_FOUND)
|
|
+ message (STATUS "Lua51 found")
|
|
+ else(LUA51_FOUND)
|
|
+ message (FATAL_ERROR "Lua51 not found!")
|
|
+ endif(LUA51_FOUND)
|
|
+ endif(WITH_BUNDLED_LUA)
|
|
endif(NOT USE_LUAJIT)
|
|
|
|
mark_as_advanced(LUA_LIBRARY)
|