Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/output/CMakeLists.txt @ 8768

Last change on this file since 8768 was 8474, checked in by rgrieder, 13 years ago

Changed current version to 0.0.5 (I think I messed that up last time because the version should have been 0.0.5 a long time ago).

  • Property svn:eol-style set to native
File size: 5.8 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
26# Defined LINUX
27IF(UNIX AND NOT APPLE)
28  SET(LINUX TRUE)
29ENDIF()
30
31IF(WIN32)
32  IF(MSVC10)
33    CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3 FATAL_ERROR)
34  ELSE()
35    CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
36  ENDIF()
37ELSE()
38  CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
39ENDIF()
40
41# Keep devs from using the root directory as binary directory (messes up the source tree)
42IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
43  MESSAGE(FATAL_ERROR "Please do not use the root directory as CMake output directory!
44  mkdir build; cd build; cmake ..
45  And you will have to clean the source directory by deleting CMakeCache.txt and the folder CMakeFiles")
46ENDIF()
47
48PROJECT(Orxonox C CXX)
49
50################ General Config #################
51
52# Version info
53SET(ORXONOX_VERSION_MAJOR 0)
54SET(ORXONOX_VERSION_MINOR 0)
55SET(ORXONOX_VERSION_PATCH 5)
56SET(ORXONOX_VERSION
57  ${ORXONOX_VERSION_MAJOR}.${ORXONOX_VERSION_MINOR}.${ORXONOX_VERSION_PATCH}
58)
59SET(ORXONOX_VERSION_NAME "Arcturus")
60
61# Standard path suffixes
62SET(DEFAULT_RUNTIME_PATH bin)
63SET(DEFAULT_LIBRARY_PATH lib)
64SET(DEFAULT_ARCHIVE_PATH lib/static)
65SET(DEFAULT_MODULE_PATH  lib/modules)
66SET(DEFAULT_DOC_PATH     doc)
67SET(DEFAULT_DATA_PATH    data)
68SET(DEFAULT_CONFIG_PATH  config)
69SET(DEFAULT_LOG_PATH     log)
70SET(DEFAULT_BUNDLE_PATH  bundle)
71
72# Set output directories
73SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_RUNTIME_PATH})
74SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
75SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
76SET(CMAKE_MODULE_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH})
77SET(CMAKE_DOC_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH})
78# Data directories are only inputs, no delclaration here
79SET(CMAKE_CONFIG_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
80SET(CMAKE_LOG_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH})
81
82# Set the extension of the dynamic modules
83SET(ORXONOX_MODULE_EXTENSION ".module")
84
85# Sets where to find the external libraries like OgreMain.dll at runtime
86# On Unix you should not have to change this at all.
87# This only applies to development runs in the build tree
88SET(RUNTIME_LIBRARY_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
89
90# Take care of some CMake 2.6.0 leftovers
91MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
92
93# This sets where to look for CMake modules (e.g. "Find*.cmake" files)
94SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_SOURCE_DIR}/cmake/tools)
95
96# Flag variables for extra configuration "RelForDevs" should be hidden
97MARK_AS_ADVANCED(
98  CMAKE_CXX_FLAGS_RELFORDEVS
99  CMAKE_C_FLAGS_RELFORDEVS
100  CMAKE_EXE_LINKER_FLAGS_RELFORDEVS
101  CMAKE_MODULE_LINKER_FLAGS_RELFORDEVS
102  CMAKE_SHARED_LINKER_FLAGS_RELFORDEVS
103)
104
105IF(NOT CMAKE_CONFIGURATION_TYPES)
106  # Set Debug build to default when not having multi-config generator like MSVC or XCODE
107  IF(NOT CMAKE_BUILD_TYPE)
108    SET(CMAKE_BUILD_TYPE Debug CACHE STRING
109        "Build types are: Debug, RelForDevs, RelWithDebInfo, Release, MinSizeRel" FORCE)
110  ENDIF()
111  MARK_AS_ADVANCED(CLEAR CMAKE_BUILD_TYPE)
112
113  MESSAGE(STATUS "*** Build type is ${CMAKE_BUILD_TYPE} ***")
114ELSE()
115  # Make sure no build type is ever set
116  IF(CMAKE_BUILD_TYPE)
117    SET(CMAKE_BUILD_TYPE CACHE STRING FORCE)
118  ENDIF()
119  MARK_AS_ADVANCED(FORCE CMAKE_BUILD_TYPE)
120  # Add our extra configuration "RelForDevs"
121  SET(CMAKE_CONFIGURATION_TYPES "Debug;RelForDevs;RelWithDebInfo;Release;MinSizeRel"
122      CACHE STRING "Semicolon separated list of supported configuration types." FORCE)
123ENDIF()
124
125# Debug builds can not be installed
126INSTALL(SCRIPT cmake/InstallCheck.cmake)
127
128IF(APPLE)
129  # Set 10.5 as the base SDK by default
130  SET(XCODE_ATTRIBUTE_SDKROOT macosx10.5)
131
132  # 10.6 sets x86_64 as the default architecture.
133  # Because Carbon isn't supported on 64-bit and we still need it, force the architectures to ppc and i386
134  IF(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
135    SET(CMAKE_OSX_ARCHITECTURES "i386")
136  ENDIF()
137  IF(CMAKE_OSX_ARCHITECTURES MATCHES "ppc64")
138    SET(CMAKE_OSX_ARCHITECTURES "ppc")
139  ENDIF()
140  IF(NOT CMAKE_OSX_ARCHITECTURES)
141    SET(CMAKE_OSX_ARCHITECTURES "i386")
142  ENDIF()
143ENDIF()
144
145########### Subfolders and Subscripts ###########
146
147# General build and compiler options and configurations
148INCLUDE(CompilerConfig)
149
150# Library finding
151INCLUDE(LibraryConfig)
152
153# Configure installation paths and options
154INCLUDE(InstallConfig)
155
156# Configure data directory location and installation
157ADD_SUBDIRECTORY(data)
158
159# Create the actual project
160ADD_SUBDIRECTORY(src)
161
162# Configure the binary output directory. Do this after src!
163ADD_SUBDIRECTORY(bin)
164
165# System specific files (mostly for installation)
166ADD_SUBDIRECTORY(contrib)
167
168# Last but not least: Try to make a doc target with Doxygen
169ADD_SUBDIRECTORY(doc)
170
171########### CPack Packaging ###########
172
173# Currently only testing on Apple
174#IF(APPLE)
175#  INCLUDE(BundleConfig)
176#ENDIF(APPLE)
Note: See TracBrowser for help on using the repository browser.