aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindLua.cmake
blob: 479dfcf419852662ef1d60256e1f970640c9e9b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
mark_as_advanced(LUA_LIBRARY LUA_INCLUDE_DIR)
set(USE_LUAJIT FALSE)

if(ENABLE_LUAJIT)
	find_library(LUA_LIBRARY luajit
			NAMES luajit-5.1)
	find_path(LUA_INCLUDE_DIR luajit.h
		NAMES luajit.h
		PATH_SUFFIXES luajit-2.0)
	if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
		set(USE_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 "${PROJECT_SOURCE_DIR}/lua/src")
	add_subdirectory(lua)
endif()