Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/OrxonoxConfig.cmake @ 5839

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

Merged resource2 branch back to trunk.

IMPORTANT NOTE:
Upon this merge you need to specifically call your data directory "data_extern" when checking it out (when you don't provide a name, it will be just called 'trunk').
The new CMake variable is EXTERNAL_DATA_DIRECTORY. DATA_DIRECTORY now points to the one the source part of the repository.
UPDATE YOUR DATA DIRECTORY AS WELL!!!

  • Property svn:eol-style set to native
File size: 3.5 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# Use WinMain() or main()?
42IF(WIN32)
43  OPTION(ORXONOX_USE_WINMAIN "Use WinMain (doesn't show console) or main" FALSE)
44ENDIF()
45
46################ Platform Config ################
47
48# Check endianness
49INCLUDE(TestBigEndian)
50TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)
51IF(NOT ORXONOX_BIG_ENDIAN)
52  SET(ORXONOX_LITTLE_ENDIAN TRUE)
53ENDIF()
54
55# 32/64 bit system check
56IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
57  SET(ORXONOX_ARCH_64 TRUE)
58ELSE()
59  SET(ORXONOX_ARCH_32 TRUE)
60ENDIF()
61
62# Platforms
63SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
64SET(ORXONOX_PLATFORM_APPLE ${APPLE})
65SET(ORXONOX_PLATFORM_UNIX ${UNIX})
66IF(UNIX AND NOT APPLE)
67  SET(ORXONOX_PLATFORM_LINUX TRUE)
68ENDIF()
69
70# Check __forceinline
71IF(MSVC)
72  INCLUDE(CheckCXXSourceCompiles)
73  SET(_source "int main() { return 0; } __forceinline void test() { return; }")
74  CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
75ENDIF(MSVC)
76
77# Check iso646.h include (literal operators)
78INCLUDE(CheckIncludeFileCXX)
79CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
80
81# XCode and Visual Studio support multiple configurations. In order to tell
82# about the active one we have to define the macro for each configuration
83ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
84ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
85ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
86ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
87
88############## Configured Headers ###############
89
90SET(GENERATED_FILE_COMMENT
91   "DO NOT EDIT THIS FILE! <br>
92    It has been automatically generated by CMake from OrxonoxConfig.h.in")
93# Copy and configure OrxonoxConfig which gets included in every file
94CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
95# This file only gets included by very few classes to avoid a large recompilation
96CONFIGURE_FILE(SpecialConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h)
97
98SET(ORXONOX_CONFIG_FILES
99  ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h
100  ${CMAKE_CURRENT_SOURCE_DIR}/OrxonoxConfig.h.in
101  ${CMAKE_CURRENT_BINARY_DIR}/SpecialConfig.h
102  ${CMAKE_CURRENT_SOURCE_DIR}/SpecialConfig.h.in
103)
Note: See TracBrowser for help on using the repository browser.