CMakeLists.txt
changeset 396 e1a24791d192
parent 395 91d96387b359
child 397 13fa0546ef87
equal deleted inserted replaced
395:91d96387b359 396:e1a24791d192
     1 set(PROJECT_SHORT_NAME "kg")
     1 set(PROJECT_SHORT_NAME "kg")
     2 set(PROJECT_LONG_NAME "Kisna Glista")
     2 set(PROJECT_LONG_NAME "Kisna Glista")
     3 
       
     4 # XXX: wrong
       
     5 set(PROJECT_VERSION_MAJOR 0)
       
     6 set(PROJECT_VERSION_MINOR 1)
       
     7 
     3 
     8 project(${PROJECT_SHORT_NAME})
     4 project(${PROJECT_SHORT_NAME})
     9 cmake_minimum_required(VERSION 2.6)
     5 cmake_minimum_required(VERSION 2.6)
    10 
     6 
    11 # Avoid source tree pollution
     7 # Avoid source tree pollution
    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")
     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")
    14 endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
    10 endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
    15 
    11 
    16 # Where to find project source code (hh+cc)
    12 # Where to find project source code (hh+cc)
    17 set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src")
    13 set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src")
    18 
       
    19 # Project version
       
    20 # XXX: hardcoded
       
    21 set(PROJECT_VERSION "0.1.0")
       
    22 
    14 
    23 # Where to install project data files
    15 # Where to install project data files
    24 set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}")
    16 set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}")
    25 
    17 
    26 # Where to look for Find*.cmake and other modules
    18 # Where to look for Find*.cmake and other modules
    30 if(NOT CMAKE_BUILD_TYPE)
    22 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.")
    23 	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)
    24 	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)
    25 endif(NOT CMAKE_BUILD_TYPE)
    34 
    26 
       
    27 # include cmake stuff
       
    28 include ("cmake/FindVersion.cmake")
       
    29 
       
    30 # Determine PROJECT_VERSION
       
    31 FindProjectVersion ("${CMAKE_SOURCE_DIR}")
       
    32 
    35 # skip source code definitions if just building docs
    33 # skip source code definitions if just building docs
    36 if (NOT KG_DOC_ONLY)
    34 if (NOT KG_DOC_ONLY)
    37     add_subdirectory(src)
    35     add_subdirectory(src)
    38     add_subdirectory(data)
    36     add_subdirectory(data)
    39 endif (NOT KG_DOC_ONLY)
    37 endif (NOT KG_DOC_ONLY)