[2626] | 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 | |
---|
[2608] | 20 | SET(CEGUILUA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua-${CEGUI_VERSION}/ceguilua) |
---|
| 21 | SET(CEGUILUA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) |
---|
| 22 | |
---|
| 23 | SET(CEGUILUA_FILES |
---|
| 24 | ${CEGUILUA_DIR}/CEGUILua.cpp |
---|
| 25 | ${CEGUILUA_DIR}/CEGUILuaFunctor.cpp |
---|
| 26 | ${CEGUILUA_DIR}/required.cpp |
---|
[2641] | 27 | ${CEGUILUA_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lua_CEGUI.cpp |
---|
[2608] | 28 | |
---|
| 29 | ${CEGUILUA_DIR}/CEGUILua.h |
---|
| 30 | ${CEGUILUA_DIR}/CEGUILuaFunctor.h |
---|
| 31 | ${CEGUILUA_DIR}/required.h |
---|
[1803] | 32 | ) |
---|
| 33 | |
---|
[2608] | 34 | INCLUDE(CompareVersionStrings) |
---|
[2588] | 35 | |
---|
[2608] | 36 | # Copy package files incrementally until the version is met |
---|
| 37 | SET(CEGUILUA_VERSIONS 0.5.0 0.6.0 0.6.1 0.6.2) |
---|
[2670] | 38 | # Only copy on version change |
---|
| 39 | IF(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() |
---|
[2627] | 47 | |
---|
[2670] | 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) |
---|
| 53 | ENDIF() |
---|
[1804] | 54 | |
---|
[2608] | 55 | # Create the tolua bind file. We could use the orignal file though, but it is 1.6MB... |
---|
| 56 | ADD_CUSTOM_COMMAND( |
---|
[2640] | 57 | OUTPUT ${CEGUILUA_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lua_CEGUI.cpp |
---|
[2623] | 58 | COMMAND tolua++app_orxonox -n CEGUI |
---|
[2608] | 59 | -w ${CEGUILUA_BINARY_DIR} |
---|
[2640] | 60 | -o ${CMAKE_CFG_INTDIR}/lua_CEGUI.cpp |
---|
[2608] | 61 | -L exceptions.lua |
---|
| 62 | -s ${TOLUA_PARSER_SOURCE} |
---|
| 63 | CEGUI.pkg |
---|
| 64 | DEPENDS ${TOLUA_PARSER_DEPENDENCIES} |
---|
[2621] | 65 | WORKING_DIRECTORY ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY} |
---|
[2608] | 66 | COMMENT "Generating tolua bind files for package CEGUILua" |
---|
| 67 | ) |
---|
| 68 | |
---|
[2670] | 69 | # No warnings needed from third party libraries |
---|
[2672] | 70 | REMOVE_COMPILER_FLAGS("-W3 -W4" MSVC) |
---|
[2670] | 71 | ADD_COMPILER_FLAGS("-w") |
---|
[2608] | 72 | |
---|
[2621] | 73 | SOURCE_GROUP("Source" FILES ${CEGUILUA_FILES}) |
---|
| 74 | |
---|
| 75 | SET(CEGUILUA_LIBRARY ceguilua_orxonox) |
---|
| 76 | SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE) |
---|
[3116] | 77 | ORXONOX_ADD_LIBRARY(${CEGUILUA_LIBRARY} |
---|
| 78 | ORXONOX_EXTERNAL |
---|
| 79 | NO_SOURCE_GROUPS |
---|
| 80 | DEFINE_SYMBOL |
---|
| 81 | "CEGUILUA_EXPORTS" |
---|
| 82 | VERSION |
---|
| 83 | ${CEGUI_VERSION} |
---|
| 84 | LINK_LIBRARIES |
---|
| 85 | tolua++_orxonox |
---|
| 86 | ${LUA_LIBRARIES} |
---|
| 87 | ${CEGUI_LIBRARY} |
---|
| 88 | SOURCE_FILES |
---|
| 89 | ${CEGUILUA_FILES} |
---|
[1854] | 90 | ) |
---|