CMakeLists.txt
author Tero Marttila <terom@fixme.fi>
Tue, 27 Jan 2009 00:25:58 +0200
changeset 439 9823e6cd1086
parent 397 13fa0546ef87
permissions -rw-r--r--
some README text
5
617813994ab1 move proto/p2 -> src/proto2
terom
parents: 0
diff changeset
     1
set(PROJECT_SHORT_NAME "kg")
617813994ab1 move proto/p2 -> src/proto2
terom
parents: 0
diff changeset
     2
set(PROJECT_LONG_NAME "Kisna Glista")
374
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
     3
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     4
project(${PROJECT_SHORT_NAME})
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     5
cmake_minimum_required(VERSION 2.6)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     6
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     7
# Avoid source tree pollution
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     8
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     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")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    10
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    11
374
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    12
# Where to find project source code (hh+cc)
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    13
set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src")
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    14
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    15
# Where to install project data files
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    16
set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    17
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    18
# Where to look for Find*.cmake and other modules
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    19
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    20
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    21
# Add a sensible build type default and warning because empty means no optimization and no debug info.
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    22
if(NOT CMAKE_BUILD_TYPE)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    23
	message("WARNING: CMAKE_BUILD_TYPE is not defined!\n         Defaulting to CMAKE_BUILD_TYPE=Release. Use ccmake to set a proper value.")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    24
	set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    25
endif(NOT CMAKE_BUILD_TYPE)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    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
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    36
add_subdirectory(doc)
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    37