Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/src/CMakeLists.txt @ 2639

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

Cleanup in OrxonoxConfig.h.in. Made use of various CMake features like CheckInclude or CheckCompiles to determine some options and macros in the config header file.

Also removed util/Integers.h and placed the code directory in OrxonoxConfig.h.in.

  • Property svn:eol-style set to native
File size: 3.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(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
60INCLUDE(CheckCXXSourceCompiles)
61SET(_source "int main() { return 0; } __forceinline void test() { return; }")
62CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
63
64# Check ciso646 include (operators in words)
65INCLUDE(CheckIncludeFileCXX)
66CHECK_INCLUDE_FILE_CXX(cstdint HAVE_CSTDINT)
67CHECK_INCLUDE_FILE_CXX(cstddef HAVE_CSTDDEF)
68CHECK_INCLUDE_FILE_CXX(ciso646 HAVE_CISO646)
69
70SET(GENERATED_FILE_COMMENT
71   "DO NOT EDIT THIS FILE!
72    It has been automatically generated by CMake from OrxonoxConfig.h.in")
73# Copy and configure OrxonoxConfig which gets included in every file
74CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
75
76
77############## Include Directories ##############
78
79# Set the search paths for include files
80INCLUDE_DIRECTORIES(
81  # External
82  ${OGRE_INCLUDE_DIR}
83  ${CEGUI_INCLUDE_DIR}
84  ${ENET_INCLUDE_DIR}
85  ${Boost_INCLUDE_DIRS}
86  ${OPENAL_INCLUDE_DIRS}
87  ${ALUT_INCLUDE_DIR}
88  ${VORBIS_INCLUDE_DIR}
89  ${OGG_INCLUDE_DIR}
90  ${LUA_INCLUDE_DIR}
91  ${TCL_INCLUDE_PATH}
92  ${DIRECTX_INCLUDE_DIR}
93  ${ZLIB_INCLUDE_DIR}
94
95  # Internal
96  .
97  orxonox
98  # Required for tolua bind and config files that are in the binary folder
99  ${CMAKE_CURRENT_BINARY_DIR}
100  ${CMAKE_CURRENT_BINARY_DIR}/orxonox
101)
102
103
104################ Sub Directories ################
105
106# Third party libraries
107ADD_SUBDIRECTORY(tolua)
108
109# Include CEGUILua if not requested otherwise
110IF(CEGUILUA_USE_INTERNAL_LIBRARY)
111  IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
112    MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")
113  ENDIF()
114
115  INCLUDE_DIRECTORIES(ceguilua/ceguilua-${CEGUI_VERSION})
116  ADD_SUBDIRECTORY(ceguilua)
117ENDIF()
118
119ADD_SUBDIRECTORY(cpptcl)
120ADD_SUBDIRECTORY(ogreceguirenderer)
121ADD_SUBDIRECTORY(ois)
122ADD_SUBDIRECTORY(tinyxml)
123
124# Orxonox code
125ADD_SUBDIRECTORY(util)
126ADD_SUBDIRECTORY(core)
127ADD_SUBDIRECTORY(audio)
128ADD_SUBDIRECTORY(network)
129ADD_SUBDIRECTORY(orxonox)
Note: See TracBrowser for help on using the repository browser.