Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/src/ceguilua/CMakeLists.txt @ 2621

Last change on this file since 2621 was 2621, checked in by rgrieder, 15 years ago

This commit gets a little ugly, couldn't separate that anymore:

  • Renamed UseTolua.cmake to GenerateLuaBindings.cmake
  • Applied the macros for compiler flags, linker flags, header files and source groups Updated the whole build tree for that
  • Created real compiler config scripts (BuildConfigGCC.cmake and BuildConfigMSVC.cmake)
  • Large scale clean up in BuildConfig.cmake
  • You can now specify your own LibraryConfig and BuildConfig script via CMake Cache
  • Lots of small changes and fixes
  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1SET(CEGUILUA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION}/ceguilua)
2SET(CEGUILUA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
3
4SET(CEGUILUA_FILES
5  ${CEGUILUA_DIR}/CEGUILua.cpp
6  ${CEGUILUA_DIR}/CEGUILuaFunctor.cpp
7  ${CEGUILUA_DIR}/required.cpp
8  ${CEGUILUA_BINARY_DIR}/lua_CEGUI.cpp
9
10  ${CEGUILUA_DIR}/CEGUILua.h
11  ${CEGUILUA_DIR}/CEGUILuaFunctor.h
12  ${CEGUILUA_DIR}/required.h
13)
14
15INCLUDE(CompareVersionStrings)
16
17# Copy package files incrementally until the version is met
18SET(CEGUILUA_VERSIONS 0.5.0 0.6.0 0.6.1 0.6.2)
19FOREACH(_version ${CEGUILUA_VERSIONS})
20  COMPARE_VERSION_STRINGS(${_version} ${CEGUI_VERSION} _compare_result)
21  IF(_compare_result EQUAL 1)
22    BREAK() # _version > CEGUI_VERSION
23  ENDIF(_compare_result EQUAL 1)
24  ADD_SUBDIRECTORY(ceguilua-${_version})
25ENDFOREACH(_version)
26
27# Create the tolua bind file. We could use the orignal file though, but it is 1.6MB...
28ADD_CUSTOM_COMMAND(
29  OUTPUT ${CEGUILUA_BINARY_DIR}/lua_CEGUI.cpp
30  COMMAND tolua++gen_orxonox -n CEGUI
31                             -w ${CEGUILUA_BINARY_DIR}
32                             -o lua_CEGUI.cpp
33                             -L exceptions.lua
34                             -s ${TOLUA_PARSER_SOURCE}
35                                CEGUI.pkg
36  DEPENDS              ${TOLUA_PARSER_DEPENDENCIES}
37  WORKING_DIRECTORY    ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}
38  COMMENT "Generating tolua bind files for package CEGUILua"
39)
40
41ADD_COMPILER_FLAGS("-w44996" MSVC)
42
43SOURCE_GROUP("Source" FILES ${CEGUILUA_FILES})
44
45SET(CEGUILUA_LIBRARY ceguilua_orxonox)
46SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE)
47ADD_LIBRARY(${CEGUILUA_LIBRARY} SHARED ${CEGUILUA_FILES})
48SET_TARGET_PROPERTIES(${CEGUILUA_LIBRARY} PROPERTIES DEFINE_SYMBOL "CEGUILUA_EXPORTS")
49TARGET_LINK_LIBRARIES(${CEGUILUA_LIBRARY}
50  tolua++_orxonox
51  ${LUA_LIBRARIES}
52  ${CEGUI_LIBRARY}
53)
54
55IF (NOT WIN32)
56  INSTALL(TARGETS ceguilua_orxonox LIBRARY DESTINATION lib)
57ENDIF (NOT WIN32)
Note: See TracBrowser for help on using the repository browser.