Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/cmake/src/tolua/CMakeLists.txt @ 1124

Last change on this file since 1124 was 1124, checked in by rgrieder, 16 years ago
  • completely rewrote FindLua.cmake (hope it still works) It should be more clear now and cache works. Lua_LIBRARIES, Lua_INCLUDE_DIR, Lua_FOUND and Lua_VERSION (5.1 or 5.0) are defined
  • something to add for last commit: when using out-of-source build, you can simply write 'rm -rf *' in the build directory to clean everything, including the CMake cache, but not the binary files in bin/ and bin/lib/
File size: 914 bytes
Line 
1SET(TOLUA_SRC_FILES
2  tolua.c
3  tolua_event.c
4  tolua_is.c
5  tolua_map.c
6  tolua_push.c
7  tolua_to.c
8  toluabind.c
9)
10
11
12ADD_EXECUTABLE(tolua ${TOLUA_SRC_FILES})
13
14TARGET_LINK_LIBRARIES(tolua
15  ${Lua_LIBRARIES}
16  m
17)
18
19
20
21SET(TOLUALIB_SRC_FILES
22  tolua_event.c
23  tolua_is.c
24  tolua_map.c
25  tolua_push.c
26  tolua_to.c
27  tolua_bind.cc
28  tolua_bind.h
29)
30
31SET_SOURCE_FILES_PROPERTIES(tolua_bind.h
32  PROPERTIES
33  OBJECT_DEPENDS tolua_bind.h
34  OBJECT_DEPENDS tolua_bind.cc
35  GENERATED true
36  HEADER_FILE_ONLY true
37)
38
39GET_TARGET_PROPERTY(TOLUA_EXE tolua LOCATION)
40ADD_CUSTOM_COMMAND(
41  OUTPUT tolua_bind.h tolua_bind.cc
42  COMMAND ${TOLUA_EXE} -n orxonox -o tolua/tolua_bind.cc -H tolua/tolua_bind.h tolua/tolua.pkg
43  DEPENDS tolua
44  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
45)
46
47ADD_LIBRARY(tolualib ${TOLUALIB_SRC_FILES})
48
49TARGET_LINK_LIBRARIES(tolualib
50  ${Lua_LIBRARIES}
51)
52
Note: See TracBrowser for help on using the repository browser.