Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/netp3/src/CMakeLists.txt @ 3006

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

Fix following the hack before.

  • Property svn:eol-style set to native
File size: 4.9 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
20################ Various Options ################
21
22# various macro includes
23INCLUDE(FlagUtilities)
24INCLUDE(GenerateToluaBindings)
25INCLUDE(InstallUtilities)
26INCLUDE(SourceFileUtilities)
27
28# Use TinyXML++
29ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")
30# OIS dynamic linking requires macro definition, at least for Windows
31ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")
32# Tolua binding speedup if required
33ADD_COMPILER_FLAGS("-DTOLUA_RELEASE" Release MinSizeRel TOLUA_PARSER_RELEASE)
34
35################ OrxonoxConfig.h ################
36
37# Check endianness
38INCLUDE(TestBigEndian)
39TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)
40IF(NOT ORXONOX_BIG_ENDIAN)
41  SET(ORXONOX_LITTLE_ENDIAN TRUE)
42ENDIF()
43
44# 32/64 bit system check
45IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
46  SET(ORXONOX_ARCH_64 TRUE)
47ELSE()
48  SET(ORXONOX_ARCH_32 TRUE)
49ENDIF()
50
51# Platforms
52SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
53SET(ORXONOX_PLATFORM_APPLE ${APPLE})
54SET(ORXONOX_PLATFORM_UNIX ${UNIX})
55IF(UNIX AND NOT APPLE)
56  SET(ORXONOX_PLATFORM_LINUX TRUE)
57ENDIF()
58
59# Check __forceinline
60IF(MSVC)
61  INCLUDE(CheckCXXSourceCompiles)
62  SET(_source "int main() { return 0; } __forceinline void test() { return; }")
63  CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
64ENDIF(MSVC)
65
66# Check ciso646 include (literal operators)
67INCLUDE(CheckIncludeFileCXX)
68CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
69
70# XCode and Visual Studio support multiple configurations. In order to tell the
71# which one we have to define the macros separately for each configuration
72ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
73ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
74ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
75ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
76
77SET(GENERATED_FILE_COMMENT
78   "DO NOT EDIT THIS FILE!
79    It has been automatically generated by CMake from OrxonoxConfig.h.in")
80# Copy and configure OrxonoxConfig which gets included in every file
81CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
82# This file only gets included by very few classes to avoid a large recompilation
83CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)
84
85
86############## Include Directories ##############
87
88# Set the search paths for include files
89INCLUDE_DIRECTORIES(
90  # External
91  ${OGRE_INCLUDE_DIR}
92  ${CEGUI_INCLUDE_DIR}
93  ${ENET_INCLUDE_DIR}
94  ${Boost_INCLUDE_DIRS}
95  ${OPENAL_INCLUDE_DIRS}
96  ${ALUT_INCLUDE_DIR}
97  ${VORBIS_INCLUDE_DIR}
98  ${OGG_INCLUDE_DIR}
99  ${LUA_INCLUDE_DIR}
100  ${TCL_INCLUDE_PATH}
101  ${DIRECTX_INCLUDE_DIR}
102  ${ZLIB_INCLUDE_DIR}
103
104  # All library includes are prefixed with the path to avoid conflicts
105  ${CMAKE_CURRENT_SOURCE_DIR}
106  # Bullet headers really need the include directory
107  ${CMAKE_CURRENT_SOURCE_DIR}/bullet
108  # OIS headers need the root dir as well
109  ${CMAKE_CURRENT_SOURCE_DIR}/ois
110  # Convenience directory
111  # Convenience directory
112  ${CMAKE_CURRENT_SOURCE_DIR}/orxonox
113  # OrxonoxConfig.h
114  ${CMAKE_CURRENT_BINARY_DIR}
115  # Tolua bind files for Core
116  ${CMAKE_CURRENT_BINARY_DIR}/core/${CMAKE_CFG_INTDIR}
117  # Tolua bind files for Orxonox
118  ${CMAKE_CURRENT_BINARY_DIR}/orxonox/${CMAKE_CFG_INTDIR}
119)
120
121
122################ Sub Directories ################
123
124# Third party libraries
125ADD_SUBDIRECTORY(tolua)
126
127# Include CEGUILua if not requested otherwise
128IF(CEGUILUA_USE_INTERNAL_LIBRARY)
129  IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
130    MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")
131  ENDIF()
132
133  INCLUDE_DIRECTORIES(ceguilua/ceguilua-${CEGUI_VERSION})
134  ADD_SUBDIRECTORY(ceguilua)
135ENDIF()
136
137ADD_SUBDIRECTORY(bullet)
138ADD_SUBDIRECTORY(cpptcl)
139ADD_SUBDIRECTORY(ogreceguirenderer)
140ADD_SUBDIRECTORY(ois)
141ADD_SUBDIRECTORY(tinyxml)
142
143# Orxonox code
144ADD_SUBDIRECTORY(util)
145ADD_SUBDIRECTORY(core)
146#ADD_SUBDIRECTORY(audio)
147ADD_SUBDIRECTORY(network)
148ADD_SUBDIRECTORY(orxonox)
149
150# Apply version info
151SET_TARGET_PROPERTIES(util core network orxonox
152  PROPERTIES VERSION ${ORXONOX_VERSION})
Note: See TracBrowser for help on using the repository browser.