equal
deleted
inserted
replaced
|
1 set(PROJECT_SHORT_NAME "exampleproject") |
|
2 set(PROJECT_LONG_NAME "Example Project") |
|
3 set(PROJECT_VERSION_MAJOR 0) |
|
4 set(PROJECT_VERSION_MINOR 1) |
|
5 |
|
6 project(${PROJECT_SHORT_NAME}) |
|
7 cmake_minimum_required(VERSION 2.6) |
|
8 |
|
9 # Avoid source tree pollution |
|
10 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
|
11 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") |
|
12 endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
|
13 |
|
14 # Where to install project data files |
|
15 set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}") |
|
16 |
|
17 # Where to look for Find*.cmake and other modules |
|
18 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") |
|
19 |
|
20 # Add a sensible build type default and warning because empty means no optimization and no debug info. |
|
21 if(NOT CMAKE_BUILD_TYPE) |
|
22 message("WARNING: CMAKE_BUILD_TYPE is not defined!\n Defaulting to CMAKE_BUILD_TYPE=Release. Use ccmake to set a proper value.") |
|
23 set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) |
|
24 endif(NOT CMAKE_BUILD_TYPE) |
|
25 |
|
26 add_subdirectory(src) |
|
27 add_subdirectory(data) |
|
28 |