Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: sandbox/src/OrxonoxConfig.cmake @ 7049

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

Synchronised sandbox with current code trunk. There should be a few bug fixes.

  • Property svn:eol-style set to native
File size: 3.7 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 #  Author:
21 #    Reto Grieder
22 #  Description:
23 #    Configures the header files OrxonoxConfig.h and SpecialConfig.h
24 #    and sets some other options. All the build related options should be
25 #    found and set here if possible.
26 #
27
28#################### Options ####################
29
30# Default linking is SHARED
31SET(ORXONOX_DEFAULT_LINK SHARED)
32
33# Use, i.e. don't skip the full RPATH for the build tree
34SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
35
36# Global switch to disable Precompiled Header Files
37IF(PCH_COMPILER_SUPPORT)
38  OPTION(PCH_ENABLE "Global PCH switch" TRUE)
39ENDIF()
40
41# Global switch to disable multiple file compilations
42OPTION(DISABLE_COMPILATIONS "Global multi-file compilation switch" FALSE)
43
44# Use WinMain() or main()?
45IF(WIN32)
46  OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
47ENDIF()
48
49################ Platform Config ################
50
51# Check endianness
52INCLUDE(TestBigEndian)
53TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)
54IF(NOT ORXONOX_BIG_ENDIAN)
55  SET(ORXONOX_LITTLE_ENDIAN TRUE)
56ENDIF()
57
58# 32/64 bit system check
59IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
60  SET(ORXONOX_ARCH_64 TRUE)
61ELSE()
62  SET(ORXONOX_ARCH_32 TRUE)
63ENDIF()
64
65# Platforms
66SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
67SET(ORXONOX_PLATFORM_APPLE ${APPLE})
68SET(ORXONOX_PLATFORM_UNIX ${UNIX})
69IF(UNIX AND NOT APPLE)
70  SET(ORXONOX_PLATFORM_LINUX TRUE)
71ENDIF()
72
73# Check __forceinline
74IF(MSVC)
75  INCLUDE(CheckCXXSourceCompiles)
76  SET(_source "int main() { return 0; } __forceinline void test() { return; }")
77  CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
78ENDIF(MSVC)
79
80# Check iso646.h include (literal operators)
81INCLUDE(CheckIncludeFileCXX)
82CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
83
84# XCode and Visual Studio support multiple configurations. In order to tell
85# about the active one we have to define the macro for each configuration
86ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
87ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
88ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
89ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
90
91############## Configured Headers ###############
92
93SET(GENERATED_FILE_COMMENT
94   "DO NOT EDIT THIS FILE! <br>
95    It has been automatically generated by CMake from OrxonoxConfig.h.in")
96# Copy and configure OrxonoxConfig which gets included in every file
97CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
98# This file only gets included by very few classes to avoid a large recompilation
99CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)
100
101SET(ORXONOX_CONFIG_FILES
102  ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h
103  ${CMAKE_CURRENT_SOURCE_DIR}/OrxonoxConfig.h.in
104  ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h
105  ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in
106)
Note: See TracBrowser for help on using the repository browser.