Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/mac_osx/src/external/ceguilua/CMakeLists.txt @ 8739

Last change on this file since 8739 was 7620, checked in by rgrieder, 14 years ago

Also create output directories for CEGUILua.

  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1 #
2 #             ORXONOX - the hottest 3D action shooter ever to exist
3 #                             > www.orxonox.net <
4 #
5 #        This program is free software; you can redistribute it and/or
6 #         modify it under the terms of the GNU General Public License
7 #        as published by the Free Software Foundation; either version 2
8 #            of the License, or (at your option) any later version.
9 #
10 #       This program is distributed in the hope that it will be useful,
11 #        but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #                 GNU General Public License for more details.
14 #
15 #   You should have received a copy of the GNU General Public License along
16 #      with this program; if not, write to the Free Software Foundation,
17 #     Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 #
19
20SET(CEGUILUA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION}/ceguilua)
21SET(CEGUILUA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
22
23SET(CEGUILUA_FILES
24  ${CEGUILUA_DIR}/CEGUILua.cpp
25  ${CEGUILUA_DIR}/CEGUILuaFunctor.cpp
26  ${CEGUILUA_DIR}/required.cpp
27  ${CEGUILUA_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lua_CEGUI.cpp
28
29  ${CEGUILUA_DIR}/CEGUILua.h
30  ${CEGUILUA_DIR}/CEGUILuaFunctor.h
31  ${CEGUILUA_DIR}/required.h
32)
33
34INCLUDE(CompareVersionStrings)
35
36# Copy package files incrementally until the version is met
37SET(CEGUILUA_VERSIONS 0.5.0 0.6.0 0.6.1 0.6.2)
38# Only copy on version change
39IF(NOT "${_CEGUI_VERSION_REF}" STREQUAL "${CEGUI_VERSION}"
40   OR NOT EXISTS ${CEGUILUA_BINARY_DIR}/exceptions.lua)
41  SET(_CEGUI_VERSION_REF ${CEGUI_VERSION} CACHE INTERNAL "Do not edit")
42  FOREACH(_version ${CEGUILUA_VERSIONS})
43    COMPARE_VERSION_STRINGS(${_version} ${CEGUI_VERSION} _compare_result)
44    IF(_compare_result EQUAL 1)
45      BREAK() # _version > CEGUI_VERSION
46    ENDIF()
47
48    ADD_SUBDIRECTORY(ceguilua-${_version}) # Sets parent scope variable _package_files
49    FOREACH(_file ${_package_files})
50      CONFIGURE_FILE(ceguilua-${_version}/package/${_file} ${CEGUILUA_BINARY_DIR}/${_file} COPYONLY)
51    ENDFOREACH(_file)
52  ENDFOREACH(_version)
53ENDIF()
54
55# Workaround for XCode: The folder where the bind files are written to has
56# to be present beforehand.
57IF(CMAKE_CONFIGURATION_TYPES)
58  FOREACH(_dir ${CMAKE_CONFIGURATION_TYPES})
59    FILE(MAKE_DIRECTORY ${CEGUILUA_BINARY_DIR}/${_dir})
60  ENDFOREACH(_dir)
61ENDIF()
62
63# Create the tolua bind file. We could use the orignal file though, but it is 1.6MB...
64ADD_CUSTOM_COMMAND(
65  OUTPUT ${CEGUILUA_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lua_CEGUI.cpp
66  COMMAND toluaapp_orxonox -n CEGUI
67                           -w ${CEGUILUA_BINARY_DIR}
68                           -o ${CMAKE_CFG_INTDIR}/lua_CEGUI.cpp
69                           -L exceptions.lua
70                           -s ${TOLUA_PARSER_SOURCE}
71                              CEGUI.pkg
72  DEPENDS              ${TOLUA_PARSER_DEPENDENCIES}
73  WORKING_DIRECTORY    ${RUNTIME_LIBRARY_DIRECTORY}
74  COMMENT "Generating tolua bind files for package CEGUILua"
75)
76
77SOURCE_GROUP("Source" FILES ${CEGUILUA_FILES})
78
79SET(CEGUILUA_LIBRARY ceguilua_orxonox)
80SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE)
81ORXONOX_ADD_LIBRARY(${CEGUILUA_LIBRARY}
82  ORXONOX_EXTERNAL
83  NO_SOURCE_GROUPS
84  DEFINE_SYMBOL
85    "CEGUILUA_EXPORTS"
86  VERSION
87    ${CEGUI_VERSION}
88  LINK_LIBRARIES
89    tolua_orxonox
90    ${LUA_LIBRARIES}
91    ${CEGUI_LIBRARY}
92  SOURCE_FILES
93    ${CEGUILUA_FILES}
94)
Note: See TracBrowser for help on using the repository browser.