Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/consolecommands3/CMakeLists.txt @ 7643

Last change on this file since 7643 was 7163, checked in by dafrick, 14 years ago

Merged presentation3 branch into trunk.

  • Property svn:eol-style set to native
File size: 4.3 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 some basics and controls the configuration scripts
24 #
25
26CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
27
28# Keep devs from using the root directory as binary directory (messes up the source tree)
29IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
30  MESSAGE(FATAL_ERROR "Please do not use the root directory as CMake output directory!
31  mkdir build; cd build; cmake ..
32  And you will have to clean the source directory by deleting CMakeCache.txt and the folder CMakeFiles")
33ENDIF()
34
35PROJECT(Orxonox C CXX)
36
37################ General Config #################
38
39# Version info
40SET(ORXONOX_VERSION_MAJOR 0)
41SET(ORXONOX_VERSION_MINOR 0)
42SET(ORXONOX_VERSION_PATCH 4)
43SET(ORXONOX_VERSION 0.0.4)
44SET(ORXONOX_VERSION_NAME "Arcturus")
45
46# Standard path suffixes
47SET(DEFAULT_RUNTIME_PATH bin)
48SET(DEFAULT_LIBRARY_PATH lib)
49SET(DEFAULT_ARCHIVE_PATH lib/static)
50SET(DEFAULT_MODULE_PATH  lib/modules)
51SET(DEFAULT_DOC_PATH     doc)
52SET(DEFAULT_DATA_PATH    data)
53SET(DEFAULT_CONFIG_PATH  config)
54SET(DEFAULT_LOG_PATH     log)
55
56# Set output directories
57SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_RUNTIME_PATH})
58SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
59SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
60SET(CMAKE_MODULE_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH})
61SET(CMAKE_DOC_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH})
62# Data directories are only inputs, no delclaration here
63SET(CMAKE_CONFIG_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
64SET(CMAKE_LOG_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH})
65
66# Set the extension of the dynamic modules
67SET(ORXONOX_MODULE_EXTENSION ".module")
68
69# Sets where to find the external libraries like OgreMain.dll at runtime
70# On Unix you should not have to change this at all.
71# This only applies to development runs in the build tree
72SET(RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
73
74# Take care of some CMake 2.6.0 leftovers
75MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
76
77# This sets where to look for CMake modules (e.g. "Find*.cmake" files)
78SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_SOURCE_DIR}/cmake/tools)
79
80# Set Debug build to default when not having multi-config generator like msvc
81IF(NOT CMAKE_CONFIGURATION_TYPES)
82  IF(NOT CMAKE_BUILD_TYPE)
83    SET(CMAKE_BUILD_TYPE Debug CACHE STRING
84        "Build types are: Debug, Release, MinSizeRel, RelWithDebInfo" FORCE)
85  ENDIF()
86  MARK_AS_ADVANCED(CLEAR CMAKE_BUILD_TYPE)
87
88  MESSAGE(STATUS "*** Build type is ${CMAKE_BUILD_TYPE} ***")
89ELSE()
90  IF(CMAKE_BUILD_TYPE)
91    SET(CMAKE_BUILD_TYPE CACHE STRING FORCE)
92  ENDIF()
93  MARK_AS_ADVANCED(CMAKE_BUILD_TYPE)
94ENDIF()
95
96# Enable expensive optimisations: use this for a binary release build
97OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
98
99########### Subfolders and Subscripts ###########
100
101# Library finding
102INCLUDE(LibraryConfig)
103
104# General build and compiler options and configurations
105INCLUDE(CompilerConfig)
106
107# Configure installation paths and options
108INCLUDE(InstallConfig)
109
110# Configure data directory location and installation
111ADD_SUBDIRECTORY(data)
112
113# Create the actual project
114ADD_SUBDIRECTORY(src)
115
116# Configure the binary output directory. Do this after src!
117ADD_SUBDIRECTORY(bin)
118
119# Last but not least: Try to make a doc target with Doxygen
120ADD_SUBDIRECTORY(doc)
Note: See TracBrowser for help on using the repository browser.