forked from torch/luajit-rocks
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
38 lines (33 loc) · 1.01 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
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.0" OFF)
OPTION(WITH_LUA52 "Use Lua 5.2 instead of LuaJIT 2.0" OFF)
OPTION(WITH_LUAJIT21 "Use LuaJIT 2.1 instead of LuaJIT 2.0" OFF)
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_LUAJIT21)
SET(LUA_EXE_NAME luajit)
SET(LUA_VERSION 5.1)
ADD_SUBDIRECTORY(luajit-2.1)
ELSE()
SET(LUA_EXE_NAME luajit)
SET(LUA_VERSION 5.1)
ADD_SUBDIRECTORY(luajit-2.0)
ENDIF()
ADD_SUBDIRECTORY(luarocks)