Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: sandbox_qt/CMakeLists.txt @ 7425

Last change on this file since 7425 was 7421, checked in by rgrieder, 14 years ago

Basic stuff up and running for the Qt sandbox.
No GUI support yet.

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