Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/CMakeLists.txt @ 3864

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

Added NO_INSTALL argument for ORXONOX_ADD_EXECUTABLE/LIBRARY and moved "-DTOLUA_RELEASE" from the global definitions to the tolua bind source files.

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