CMakeLists.txt
author Tero Marttila <terom@fixme.fi>
Tue, 13 Jan 2009 21:36:43 +0200
changeset 392 6c4dc68360eb
parent 374 1862c5f2cfc3
child 395 91d96387b359
permissions -rw-r--r--
remove unused graphics_default, and default to the highest resolution available in fullscreen mode
set(PROJECT_SHORT_NAME "kg")
set(PROJECT_LONG_NAME "Kisna Glista")

# XXX: wrong
set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 1)

project(${PROJECT_SHORT_NAME})
cmake_minimum_required(VERSION 2.6)

# Avoid source tree pollution
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
	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")
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)

# Where to find project source code (hh+cc)
set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src")

# Project version
# XXX: hardcoded
set(PROJECT_VERSION "0.1.0")

# Where to install project data files
set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}")

# Where to look for Find*.cmake and other modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

# Add a sensible build type default and warning because empty means no optimization and no debug info.
if(NOT CMAKE_BUILD_TYPE)
	message("WARNING: CMAKE_BUILD_TYPE is not defined!\n         Defaulting to CMAKE_BUILD_TYPE=Release. Use ccmake to set a proper value.")
	set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)

add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(doc)