[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 | |
---|
| 20 | ################ Various Options ################ |
---|
| 21 | |
---|
[2621] | 22 | # various macro includes |
---|
| 23 | INCLUDE(FlagUtilities) |
---|
[2634] | 24 | INCLUDE(GenerateToluaBindings) |
---|
| 25 | INCLUDE(InstallUtilities) |
---|
[2621] | 26 | INCLUDE(SourceFileUtilities) |
---|
| 27 | |
---|
| 28 | # Use TinyXML++ |
---|
| 29 | ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP") |
---|
| 30 | # OIS dynamic linking requires macro definition, at least for Windows |
---|
| 31 | ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB") |
---|
[2625] | 32 | # Tolua binding speedup if required |
---|
[2621] | 33 | ADD_COMPILER_FLAGS("-DTOLUA_RELEASE" Release MinSizeRel TOLUA_PARSER_RELEASE) |
---|
| 34 | |
---|
[2619] | 35 | ################ OrxonoxConfig.h ################ |
---|
| 36 | |
---|
[2639] | 37 | # Check endianness |
---|
| 38 | INCLUDE(TestBigEndian) |
---|
| 39 | TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN) |
---|
| 40 | IF(NOT ORXONOX_BIG_ENDIAN) |
---|
| 41 | SET(ORXONOX_LITTLE_ENDIAN TRUE) |
---|
| 42 | ENDIF() |
---|
| 43 | |
---|
| 44 | # 32/64 bit system check |
---|
| 45 | IF(CMAKE_SIZEOF_VOID_P EQUAL 8) |
---|
| 46 | SET(ORXONOX_ARCH_64 TRUE) |
---|
| 47 | ELSE() |
---|
| 48 | SET(ORXONOX_ARCH_32 TRUE) |
---|
| 49 | ENDIF() |
---|
| 50 | |
---|
| 51 | # Platforms |
---|
| 52 | SET(ORXONOX_PLATFORM_WINDOWS ${WIN32}) |
---|
| 53 | SET(ORXONOX_PLATFORM_APPLE ${APPLE}) |
---|
| 54 | SET(ORXONOX_PLATFORM_UNIX ${UNIX}) |
---|
| 55 | IF(UNIX AND NOT APPLE) |
---|
| 56 | SET(ORXONOX_PLATFORM_LINUX TRUE) |
---|
| 57 | ENDIF() |
---|
| 58 | |
---|
| 59 | # Check __forceinline |
---|
| 60 | INCLUDE(CheckCXXSourceCompiles) |
---|
| 61 | SET(_source "int main() { return 0; } __forceinline void test() { return; }") |
---|
| 62 | CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE) |
---|
| 63 | |
---|
| 64 | # Check ciso646 include (operators in words) |
---|
| 65 | INCLUDE(CheckIncludeFileCXX) |
---|
| 66 | CHECK_INCLUDE_FILE_CXX(cstdint HAVE_CSTDINT) |
---|
| 67 | CHECK_INCLUDE_FILE_CXX(cstddef HAVE_CSTDDEF) |
---|
| 68 | CHECK_INCLUDE_FILE_CXX(ciso646 HAVE_CISO646) |
---|
| 69 | |
---|
| 70 | SET(GENERATED_FILE_COMMENT |
---|
| 71 | "DO NOT EDIT THIS FILE! |
---|
| 72 | It has been automatically generated by CMake from OrxonoxConfig.h.in") |
---|
[2619] | 73 | # Copy and configure OrxonoxConfig which gets included in every file |
---|
| 74 | CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h) |
---|
| 75 | |
---|
[2621] | 76 | |
---|
| 77 | ############## Include Directories ############## |
---|
| 78 | |
---|
[2509] | 79 | # Set the search paths for include files |
---|
| 80 | INCLUDE_DIRECTORIES( |
---|
[2621] | 81 | # External |
---|
[2509] | 82 | ${OGRE_INCLUDE_DIR} |
---|
| 83 | ${CEGUI_INCLUDE_DIR} |
---|
[2583] | 84 | ${ENET_INCLUDE_DIR} |
---|
[2509] | 85 | ${Boost_INCLUDE_DIRS} |
---|
[2630] | 86 | ${OPENAL_INCLUDE_DIRS} |
---|
[2509] | 87 | ${ALUT_INCLUDE_DIR} |
---|
| 88 | ${VORBIS_INCLUDE_DIR} |
---|
| 89 | ${OGG_INCLUDE_DIR} |
---|
| 90 | ${LUA_INCLUDE_DIR} |
---|
| 91 | ${TCL_INCLUDE_PATH} |
---|
[2621] | 92 | ${DIRECTX_INCLUDE_DIR} |
---|
[2509] | 93 | ${ZLIB_INCLUDE_DIR} |
---|
[1505] | 94 | |
---|
[2640] | 95 | # All library includes are prefixed with the path to avoid conflicts |
---|
| 96 | ${CMAKE_CURRENT_SOURCE_DIR} |
---|
| 97 | # Convenience directory |
---|
| 98 | ${CMAKE_CURRENT_SOURCE_DIR}/orxonox |
---|
| 99 | # OrxonoxConfig.h |
---|
[2509] | 100 | ${CMAKE_CURRENT_BINARY_DIR} |
---|
[2640] | 101 | # Tolua bind files for Core |
---|
| 102 | ${CMAKE_CURRENT_BINARY_DIR}/core/${CMAKE_CFG_INTDIR} |
---|
| 103 | # Tolua bind files for Orxonox |
---|
| 104 | ${CMAKE_CURRENT_BINARY_DIR}/orxonox/${CMAKE_CFG_INTDIR} |
---|
[2509] | 105 | ) |
---|
| 106 | |
---|
| 107 | |
---|
[2621] | 108 | ################ Sub Directories ################ |
---|
[2583] | 109 | |
---|
[2621] | 110 | # Third party libraries |
---|
[2610] | 111 | ADD_SUBDIRECTORY(tolua) |
---|
[2621] | 112 | |
---|
| 113 | # Include CEGUILua if not requested otherwise |
---|
| 114 | IF(CEGUILUA_USE_INTERNAL_LIBRARY) |
---|
| 115 | IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION}) |
---|
| 116 | MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!") |
---|
[2624] | 117 | ENDIF() |
---|
[2621] | 118 | |
---|
| 119 | INCLUDE_DIRECTORIES(ceguilua/ceguilua-${CEGUI_VERSION}) |
---|
| 120 | ADD_SUBDIRECTORY(ceguilua) |
---|
[2624] | 121 | ENDIF() |
---|
[2621] | 122 | |
---|
[1505] | 123 | ADD_SUBDIRECTORY(cpptcl) |
---|
[2569] | 124 | ADD_SUBDIRECTORY(ogreceguirenderer) |
---|
[1505] | 125 | ADD_SUBDIRECTORY(ois) |
---|
| 126 | ADD_SUBDIRECTORY(tinyxml) |
---|
| 127 | |
---|
[2621] | 128 | # Orxonox code |
---|
[1505] | 129 | ADD_SUBDIRECTORY(util) |
---|
| 130 | ADD_SUBDIRECTORY(core) |
---|
[2621] | 131 | ADD_SUBDIRECTORY(audio) |
---|
[1505] | 132 | ADD_SUBDIRECTORY(network) |
---|
| 133 | ADD_SUBDIRECTORY(orxonox) |
---|