CMakeLists.txt
author Tero Marttila <terom@fixme.fi>
Tue, 13 Jan 2009 21:14:12 +0200
changeset 391 59c2499fe7bb
parent 374 1862c5f2cfc3
child 395 91d96387b359
permissions -rw-r--r--
add compressed read/write NetworkPacket API and move zlib stuff out of NetworkServer/Client
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
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
     4
# XXX: wrong
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     5
set(PROJECT_VERSION_MAJOR 0)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     6
set(PROJECT_VERSION_MINOR 1)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     7
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     8
project(${PROJECT_SHORT_NAME})
c8174cf25e06 initial import
hrnt
parents:
diff changeset
     9
cmake_minimum_required(VERSION 2.6)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    10
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    11
# Avoid source tree pollution
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    12
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    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")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    14
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    15
374
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    16
# Where to find project source code (hh+cc)
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    17
set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src")
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    18
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    19
# Project version
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    20
# XXX: hardcoded
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    21
set(PROJECT_VERSION "0.1.0")
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    22
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    23
# Where to install project data files
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    24
set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    25
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    26
# Where to look for Find*.cmake and other modules
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    27
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    28
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    29
# Add a sensible build type default and warning because empty means no optimization and no debug info.
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    30
if(NOT CMAKE_BUILD_TYPE)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    31
	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
    32
	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
    33
endif(NOT CMAKE_BUILD_TYPE)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    34
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    35
add_subdirectory(src)
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    36
add_subdirectory(data)
374
1862c5f2cfc3 integrate doxygen into our cmake build system
terom
parents: 5
diff changeset
    37
add_subdirectory(doc)
0
c8174cf25e06 initial import
hrnt
parents:
diff changeset
    38