author | Tero Marttila <terom@fixme.fi> |
Thu, 15 Jan 2009 20:38:23 +0200 | |
changeset 395 | 91d96387b359 |
parent 374 | 1862c5f2cfc3 |
child 396 | e1a24791d192 |
permissions | -rw-r--r-- |
5 | 1 |
set(PROJECT_SHORT_NAME "kg") |
2 |
set(PROJECT_LONG_NAME "Kisna Glista") |
|
374 | 3 |
|
4 |
# XXX: wrong |
|
0 | 5 |
set(PROJECT_VERSION_MAJOR 0) |
6 |
set(PROJECT_VERSION_MINOR 1) |
|
7 |
||
8 |
project(${PROJECT_SHORT_NAME}) |
|
9 |
cmake_minimum_required(VERSION 2.6) |
|
10 |
||
11 |
# Avoid source tree pollution |
|
12 |
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
|
13 |
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") |
|
14 |
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
|
15 |
||
374 | 16 |
# Where to find project source code (hh+cc) |
17 |
set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src") |
|
18 |
||
19 |
# Project version |
|
20 |
# XXX: hardcoded |
|
21 |
set(PROJECT_VERSION "0.1.0") |
|
22 |
||
0 | 23 |
# Where to install project data files |
24 |
set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}") |
|
25 |
||
26 |
# Where to look for Find*.cmake and other modules |
|
27 |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") |
|
28 |
||
29 |
# Add a sensible build type default and warning because empty means no optimization and no debug info. |
|
30 |
if(NOT CMAKE_BUILD_TYPE) |
|
31 |
message("WARNING: CMAKE_BUILD_TYPE is not defined!\n Defaulting to CMAKE_BUILD_TYPE=Release. Use ccmake to set a proper value.") |
|
32 |
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) |
|
33 |
endif(NOT CMAKE_BUILD_TYPE) |
|
34 |
||
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
|
35 |
# 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
|
36 |
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
|
37 |
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
|
38 |
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
|
39 |
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
|
40 |
|
374 | 41 |
add_subdirectory(doc) |
0 | 42 |