[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 |
---|
| 27 | ${CEGUILUA_BINARY_DIR}/lua_CEGUI.cpp |
---|
| 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) |
---|
| 38 | FOREACH(_version ${CEGUILUA_VERSIONS}) |
---|
| 39 | COMPARE_VERSION_STRINGS(${_version} ${CEGUI_VERSION} _compare_result) |
---|
| 40 | IF(_compare_result EQUAL 1) |
---|
| 41 | BREAK() # _version > CEGUI_VERSION |
---|
[2624] | 42 | ENDIF() |
---|
[2627] | 43 | |
---|
| 44 | ADD_SUBDIRECTORY(ceguilua-${_version}) # Sets parent scope variable |
---|
| 45 | FOREACH(_file ${_package_files}) |
---|
| 46 | CONFIGURE_FILE(ceguilua-${_version}/package/${_file} ${CEGUILUA_BINARY_DIR}/${_file} COPYONLY) |
---|
| 47 | ENDFOREACH(_file) |
---|
[2608] | 48 | ENDFOREACH(_version) |
---|
[1804] | 49 | |
---|
[2608] | 50 | # Create the tolua bind file. We could use the orignal file though, but it is 1.6MB... |
---|
| 51 | ADD_CUSTOM_COMMAND( |
---|
| 52 | OUTPUT ${CEGUILUA_BINARY_DIR}/lua_CEGUI.cpp |
---|
[2623] | 53 | COMMAND tolua++app_orxonox -n CEGUI |
---|
[2608] | 54 | -w ${CEGUILUA_BINARY_DIR} |
---|
| 55 | -o lua_CEGUI.cpp |
---|
| 56 | -L exceptions.lua |
---|
| 57 | -s ${TOLUA_PARSER_SOURCE} |
---|
| 58 | CEGUI.pkg |
---|
| 59 | DEPENDS ${TOLUA_PARSER_DEPENDENCIES} |
---|
[2621] | 60 | WORKING_DIRECTORY ${ORXONOX_RUNTIME_LIBRARY_DIRECTORY} |
---|
[2608] | 61 | COMMENT "Generating tolua bind files for package CEGUILua" |
---|
| 62 | ) |
---|
| 63 | |
---|
[2621] | 64 | ADD_COMPILER_FLAGS("-w44996" MSVC) |
---|
[2608] | 65 | |
---|
[2621] | 66 | SOURCE_GROUP("Source" FILES ${CEGUILUA_FILES}) |
---|
| 67 | |
---|
| 68 | SET(CEGUILUA_LIBRARY ceguilua_orxonox) |
---|
| 69 | SET(CEGUILUA_LIBRARY ${CEGUILUA_LIBRARY} PARENT_SCOPE) |
---|
| 70 | ADD_LIBRARY(${CEGUILUA_LIBRARY} SHARED ${CEGUILUA_FILES}) |
---|
| 71 | SET_TARGET_PROPERTIES(${CEGUILUA_LIBRARY} PROPERTIES DEFINE_SYMBOL "CEGUILUA_EXPORTS") |
---|
| 72 | TARGET_LINK_LIBRARIES(${CEGUILUA_LIBRARY} |
---|
| 73 | tolua++_orxonox |
---|
[2509] | 74 | ${LUA_LIBRARIES} |
---|
| 75 | ${CEGUI_LIBRARY} |
---|
[1854] | 76 | ) |
---|
[2510] | 77 | |
---|
[2624] | 78 | IF(NOT WIN32) |
---|
[2579] | 79 | INSTALL(TARGETS ceguilua_orxonox LIBRARY DESTINATION lib) |
---|
[2624] | 80 | ENDIF() |
---|