terom@5: set(PROJECT_SHORT_NAME "kg") terom@5: set(PROJECT_LONG_NAME "Kisna Glista") terom@374: hrnt@0: project(${PROJECT_SHORT_NAME}) hrnt@0: cmake_minimum_required(VERSION 2.6) hrnt@0: hrnt@0: # Avoid source tree pollution hrnt@0: if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) hrnt@0: 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") hrnt@0: endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) hrnt@0: terom@374: # Where to find project source code (hh+cc) terom@374: set(PROJECT_SOURCECODE_DIR "${CMAKE_SOURCE_DIR}/src") terom@374: hrnt@0: # Where to install project data files hrnt@0: set(PROJECT_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_SHORT_NAME}") hrnt@0: hrnt@0: # Where to look for Find*.cmake and other modules hrnt@0: set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") hrnt@0: hrnt@0: # Add a sensible build type default and warning because empty means no optimization and no debug info. hrnt@0: if(NOT CMAKE_BUILD_TYPE) hrnt@0: message("WARNING: CMAKE_BUILD_TYPE is not defined!\n Defaulting to CMAKE_BUILD_TYPE=Release. Use ccmake to set a proper value.") hrnt@0: set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) hrnt@0: endif(NOT CMAKE_BUILD_TYPE) hrnt@0: terom@397: # Compile-time version script terom@397: include ("cmake/BuildVersion.cmake") terom@396: terom@395: # skip source code definitions if just building docs terom@395: if (NOT KG_DOC_ONLY) terom@395: add_subdirectory(src) terom@395: add_subdirectory(data) terom@395: endif (NOT KG_DOC_ONLY) terom@395: terom@374: add_subdirectory(doc) hrnt@0: