Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/cmake/BuildConfig.cmake @ 2618

Last change on this file since 2618 was 2618, checked in by rgrieder, 15 years ago
  • Functionised CheckOGREPlugins.cmake
  • Updated LibraryConfigMSVC.cmake and LibraryConfigMinGW.cmake
  • Some more changes in LibraryConfig.cmake and BuildConfig.cmake
  • Property svn:eol-style set to native
File size: 4.0 KB
Line 
1 #
2 #   ORXONOX - the hottest 3D action shooter ever to exist
3 #                    > www.orxonox.net <
4 #
5 #
6 #   License notice:
7 #
8 #   This program is free software; you can redistribute it and/or
9 #   modify it under the terms of the GNU General Public License
10 #   as published by the Free Software Foundation; either version 2
11 #   of the License, or (at your option) any later version.
12 #
13 #   This program is distributed in the hope that it will be useful,
14 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #   GNU General Public License for more details.
17 #
18 #   You should have received a copy of the GNU General Public License
19 #   along with this program; if not, write to the Free Software
20 #   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 #
22 #   Author:
23 #      Reto Grieder
24 #   Co-authors:
25 #      ...
26 #
27
28################ Misc Options ###################
29
30# Set binary output directories
31SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
32SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
33SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
34
35# Sets where to find the external libraries like OgreMain.dll at runtime
36# On Unix you should not have to change this at all.
37IF(NOT ORXONOX_LIBRARY_BIN_DIR)
38  SET(ORXONOX_LIBRARY_BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
39ENDIF(NOT ORXONOX_LIBRARY_BIN_DIR)
40
41# Set Debug build to default when not having multi-config generator like msvc
42IF(NOT CMAKE_CONFIGURATION_TYPES)
43  IF(NOT CMAKE_BUILD_TYPE)
44    SET(CMAKE_BUILD_TYPE Debug CACHE STRING
45        "Build types are: Debug, Release, MinSizeRel, RelWithDebInfo" FORCE)
46  ENDIF(NOT CMAKE_BUILD_TYPE)
47  MARK_AS_ADVANCED(CLEAR CMAKE_BUILD_TYPE)
48ELSE(NOT CMAKE_CONFIGURATION_TYPES)
49  IF(CMAKE_BUILD_TYPE)
50    SET(CMAKE_BUILD_TYPE CACHE STRING FORCE)
51  ENDIF(CMAKE_BUILD_TYPE)
52  MARK_AS_ADVANCED(CMAKE_BUILD_TYPE)
53ENDIF(NOT CMAKE_CONFIGURATION_TYPES)
54
55OPTION(EXTRA_WARNINGS "Enable some extra warnings (heavily pollutes the output)")
56IF(EXTRA_WARNINGS)
57  SET(ORXONOX_WARNING_FLAGS "-Wextra --Wno-unsued-parameter")
58ELSE(EXTRA_WARNINGS)
59  SET(ORXONOX_WARNING_FLAGS "-Wall")
60ENDIF(EXTRA_WARNINGS)
61
62SET(ORXONOX_MEDIA_DIRECTORY "${CMAKE_SOURCE_DIR}/../media")
63# More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
64# Render systems may be optional, but at least one has to be found in FindOgre
65SET(OGRE_PLUGINS_INT RenderSystem_GL RenderSystem_Direct3D9 Plugin_ParticleFX)
66IF(WIN32)
67  # CG program manager is probably DirectX related (not available under unix)
68  LIST(APPEND OGRE_PLUGINS_INT Plugin_CgProgramManager)
69ENDIF(WIN32)
70SET(OGRE_PLUGINS ${OGRE_PLUGINS_INT} CACHE STRING
71   "Specify which OGRE plugins to load. Existance check is performed.")
72
73# Check the plugins and determine the plugin folder
74# You can give a hint by setting the environment variable ENV{OGRE_PLUGIN_DIR}
75INCLUDE(CheckOGREPlugins)
76CHECK_OGRE_PLUGINS(${OGRE_PLUGINS})
77
78
79############## Compiler Config ##################
80INCLUDE(BuildConfigGCC)
81INCLUDE(BuildConfigMSVC)
82# User can create his own file if required
83IF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake)
84  INCLUDE(${CMAKE_BINARY_DIR}/BuildConfigUser)
85ENDIF(EXISTS ${CMAKE_BINARY_DIR}/BuildConfigUser.cmake)
86
87
88################ Test options ###################
89
90OPTION(ENABLE_TESTS "Enable build tests.")
91IF(ENABLE_TESTS)
92  ENABLE_TESTING()
93ENDIF(ENABLE_TESTS)
94
95OPTION(NETWORK_TESTING_ENABLED "Build network testing tools: i.e. chatclient chatserver and alike.")
96OPTION(NETWORKTRAFFIC_TESTING_ENABLED "Build dummyserver4 and dummyclient4.")
97
98
99################### Macros ######################
100
101# Also define macros to easily extend the compiler flags
102# Additional argument is a condition
103MACRO(ADD_CXX_FLAGS _flag _cond)
104  IF(${_cond})
105    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
106  ENDIF(${_cond})
107ENDMACRO(ADD_CXX_FLAGS _flag)
108MACRO(ADD_C_FLAGS _flag)
109  IF(${_cond})
110    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}")
111  ENDIF(${_cond})
112ENDMACRO(ADD_C_FLAGS _flag)
Note: See TracBrowser for help on using the repository browser.