-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
56 lines (41 loc) · 1.42 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
51
52
53
54
55
56
cmake_minimum_required(VERSION 2.8)
project(laco)
set(EXECUTABLE_OUTPUT_PATH "${laco_BINARY_DIR}/bin")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/modules")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(LACO_VERSION_STRING "0.3.0")
execute_process(COMMAND "date" "+%a %b %d, %Y %T"
OUTPUT_VARIABLE LACO_TIMESTAMP)
string(REGEX REPLACE "\n" "" LACO_TIMESTAMP ${LACO_TIMESTAMP})
option(LACO_USE_LUAJIT "Use luajit libraries." off)
if(LACO_USE_LUAJIT)
# When using Mac OSX for x64 applications, you need these flags linked
# against the binary for luajit library to allocate a luaState.
#
# ====================================================================
#
# <http://luajit.org/install.html#embed>
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS
"-pagezero_size 10000 -image_base 100000000")
endif()
find_package(LuaJIT REQUIRED)
include_directories(${LUAJIT_INCLUDE_DIR})
set(LACO_LUA ${LUAJIT_LIBRARY})
set(LACO_LUA_USED "luajit")
else()
find_package(Lua51 REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
set(LACO_LUA ${LUA_LIBRARY})
set(LACO_LUA_USED "lua")
endif()
# for lacoconf includes
include_directories("${laco_BINARY_DIR}/include")
configure_file(
"${laco_SOURCE_DIR}/src/lacoconf.h.in"
"${laco_BINARY_DIR}/include/lacoconf.h")
# for linenoise library
include_directories("${laco_SOURCE_DIR}/deps/linenoise")
add_subdirectory(deps)
add_subdirectory(src)