author | Tero Marttila <terom@fixme.fi> |
Wed, 21 Jan 2009 23:07:22 +0200 | |
branch | new_graphics |
changeset 412 | 721c60072091 |
parent 397 | 13fa0546ef87 |
permissions | -rw-r--r-- |
5 | 1 |
set(PROJECT_SHORT_NAME "kg") |
2 |
set(PROJECT_LONG_NAME "Kisna Glista") |
|
374 | 3 |
|
0 | 4 |
project(${PROJECT_SHORT_NAME}) |
5 |
cmake_minimum_required(VERSION 2.6) |
|
6 |
||
7 |
# Avoid source tree pollution |
|
8 |
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
|
9 |
message(FATAL_ERROR "In-source builds are not permitted. Make a separate folder for building:\nmkdir build; cd build; cmake ..\nBefore that, remove the files already created:\nrm -rf CMakeCache.txt CMakeFiles") |
|
10 |
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
|
11 |
||
374 | 12 |
# Where to find project source code (hh+cc) |
13 |
set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src") |
|
14 |
||
0 | 15 |
# Where to install project data files |
16 |
set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}") |
|
17 |
||
18 |
# Where to look for Find*.cmake and other modules |
|
19 |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") |
|
20 |
||
21 |
# Add a sensible build type default and warning because empty means no optimization and no debug info. |
|
22 |
if(NOT CMAKE_BUILD_TYPE) |
|
23 |
message("WARNING: CMAKE_BUILD_TYPE is not defined!\n Defaulting to CMAKE_BUILD_TYPE=Release. Use ccmake to set a proper value.") |
|
24 |
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) |
|
25 |
endif(NOT CMAKE_BUILD_TYPE) |
|
26 |
||
397
13fa0546ef87
hopefully version stuff is now run properly on every make...
Tero Marttila <terom@fixme.fi>
parents:
396
diff
changeset
|
27 |
# Compile-time version script |
13fa0546ef87
hopefully version stuff is now run properly on every make...
Tero Marttila <terom@fixme.fi>
parents:
396
diff
changeset
|
28 |
include ("cmake/BuildVersion.cmake") |
396
e1a24791d192
build scripts autodetect project version using 91d96387b359+ tip, and version is included in window title
Tero Marttila <terom@fixme.fi>
parents:
395
diff
changeset
|
29 |
|
395
91d96387b359
add KG_DOC_ONLY build option to not compile code or find library dependancies
Tero Marttila <terom@fixme.fi>
parents:
374
diff
changeset
|
30 |
# skip source code definitions if just building docs |
91d96387b359
add KG_DOC_ONLY build option to not compile code or find library dependancies
Tero Marttila <terom@fixme.fi>
parents:
374
diff
changeset
|
31 |
if (NOT KG_DOC_ONLY) |
91d96387b359
add KG_DOC_ONLY build option to not compile code or find library dependancies
Tero Marttila <terom@fixme.fi>
parents:
374
diff
changeset
|
32 |
add_subdirectory(src) |
91d96387b359
add KG_DOC_ONLY build option to not compile code or find library dependancies
Tero Marttila <terom@fixme.fi>
parents:
374
diff
changeset
|
33 |
add_subdirectory(data) |
91d96387b359
add KG_DOC_ONLY build option to not compile code or find library dependancies
Tero Marttila <terom@fixme.fi>
parents:
374
diff
changeset
|
34 |
endif (NOT KG_DOC_ONLY) |
91d96387b359
add KG_DOC_ONLY build option to not compile code or find library dependancies
Tero Marttila <terom@fixme.fi>
parents:
374
diff
changeset
|
35 |
|
374 | 36 |
add_subdirectory(doc) |
0 | 37 |