annotate Resources/CMake/LuaConfiguration.cmake @ 397:941ea46e9e26 lua-scripting

lua filter of new instances
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 02 May 2013 16:34:00 +0200
parents 18fe778eeb95
children 5f6d75cd4b46
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
382
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 if (STATIC_BUILD OR NOT USE_DYNAMIC_LUA)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 SET(LUA_SOURCES_DIR ${CMAKE_BINARY_DIR}/lua-5.1.5)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 DownloadPackage("http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/lua-5.1.5.tar.gz" "${LUA_SOURCES_DIR}" "" "")
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 add_definitions(
384
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
6 #-DLUA_LIB=1
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
7 #-Dluaall_c=1
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
8 #-DLUA_COMPAT_ALL=1 # Compile a generic version of Lua
382
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 )
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 include_directories(
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 ${LUA_SOURCES_DIR}/src
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 )
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 set(LUA_SOURCES
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 # Core Lua
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 ${LUA_SOURCES_DIR}/src/lapi.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 ${LUA_SOURCES_DIR}/src/lcode.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 ${LUA_SOURCES_DIR}/src/ldebug.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 ${LUA_SOURCES_DIR}/src/ldo.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 ${LUA_SOURCES_DIR}/src/ldump.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 ${LUA_SOURCES_DIR}/src/lfunc.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 ${LUA_SOURCES_DIR}/src/lgc.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 ${LUA_SOURCES_DIR}/src/llex.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 ${LUA_SOURCES_DIR}/src/lmem.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 ${LUA_SOURCES_DIR}/src/lobject.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 ${LUA_SOURCES_DIR}/src/lopcodes.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 ${LUA_SOURCES_DIR}/src/lparser.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 ${LUA_SOURCES_DIR}/src/lstate.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 ${LUA_SOURCES_DIR}/src/lstring.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 ${LUA_SOURCES_DIR}/src/ltable.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 ${LUA_SOURCES_DIR}/src/ltm.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 ${LUA_SOURCES_DIR}/src/lundump.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 ${LUA_SOURCES_DIR}/src/lvm.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 ${LUA_SOURCES_DIR}/src/lzio.c
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
384
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
37 # Base Lua modules
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
38 ${LUA_SOURCES_DIR}/src/lauxlib.c
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
39 ${LUA_SOURCES_DIR}/src/lbaselib.c
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
40 ${LUA_SOURCES_DIR}/src/ldblib.c
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
41 ${LUA_SOURCES_DIR}/src/liolib.c
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
42 ${LUA_SOURCES_DIR}/src/lmathlib.c
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
43 ${LUA_SOURCES_DIR}/src/loslib.c
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
44 ${LUA_SOURCES_DIR}/src/ltablib.c
382
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 ${LUA_SOURCES_DIR}/src/lstrlib.c
384
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
46 ${LUA_SOURCES_DIR}/src/loadlib.c
18fe778eeb95 wrapper around lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 382
diff changeset
47 ${LUA_SOURCES_DIR}/src/linit.c
382
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 )
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 add_library(Lua STATIC ${LUA_SOURCES})
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 link_libraries(Lua)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 source_group(ThirdParty\\Lua REGULAR_EXPRESSION ${LUA_SOURCES_DIR}/.*)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 else()
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 CHECK_INCLUDE_FILE_CXX(lua.h HAVE_LUA_H)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 if (NOT HAVE_LUA_H)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 message(FATAL_ERROR "Please install the liblua-dev package")
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 endif()
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 CHECK_LIBRARY_EXISTS(lua "lua_pcall" HAVE_LUA_LIB)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 if (NOT HAVE_LUA_LIB)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 message(FATAL_ERROR "Please install the liblua-dev package")
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 endif()
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 link_libraries(lua)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 endif()