-
Notifications
You must be signed in to change notification settings - Fork 66
/
CMakeLists.txt
50 lines (45 loc) · 1.38 KB
/
CMakeLists.txt
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
PROJECT(luajit-rocks)
# We want release compilation by default
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.6)
OPTION(WITH_LUA51 "Use Lua 5.1 instead of LuaJIT 2.1" OFF)
OPTION(WITH_LUA52 "Use Lua 5.2 instead of LuaJIT 2.1" OFF)
OPTION(WITH_LUA53 "Use Lua 5.3 instead of LuaJIT 2.1" OFF)
OPTION(WITH_LUAJIT21 "Use LuaJIT 2.1 instead of LuaJIT 2.0" OFF)
OPTION(WITH_SYSTEM_LUAJIT "Use LuaJIT installed on the system" OFF)
OPTION(WITH_LUAROCKS "Install Luarocks" ON)
IF(WITH_LUA51)
SET(LUA_EXE_NAME lua)
SET(LUA_VERSION 5.1)
ADD_SUBDIRECTORY(lua-5.1)
ELSEIF(WITH_LUA51RC)
SET(LUA_EXE_NAME lua)
SET(LUA_VERSION 5.1)
ADD_SUBDIRECTORY(lua-5.1-rc)
ELSEIF(WITH_LUA52)
SET(LUA_EXE_NAME lua)
SET(LUA_VERSION 5.2)
ADD_SUBDIRECTORY(lua-5.2)
ELSEIF(WITH_LUA53)
SET(LUA_EXE_NAME lua)
SET(LUA_VERSION 5.3)
ADD_SUBDIRECTORY(lua-5.3)
ELSEIF(WITH_LUAJIT21)
SET(LUA_EXE_NAME luajit)
SET(LUA_VERSION 5.1)
ADD_SUBDIRECTORY(luajit-2.1)
ELSEIF(WITH_SYSTEM_LUAJIT)
SET(LUA_EXE_NAME luajit)
SET(LUA_VERSION 5.1)
ELSE()
SET(LUA_EXE_NAME luajit)
SET(LUA_VERSION 5.1)
ADD_SUBDIRECTORY(luajit-2.0)
ENDIF()
IF(WITH_LUAROCKS)
ADD_SUBDIRECTORY(luarocks)
ENDIF(WITH_LUAROCKS)