Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/tutorial/CMakeLists.txt @ 9037

Last change on this file since 9037 was 8882, checked in by smerkli, 13 years ago

just testing

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