project(TestGitlabCI) cmake_minimum_required(VERSION 3.0) set(PROGRAM_NAME "TestGitlabCI" CACHE STRING "name of the current project" FORCE) set(PROGRAM_VERSION "0.1.0" CACHE STRING "version of the current project" FORCE) set(PROGRAM_DESCRIPTION_NO_QUOTE "My amazing project description" CACHE STRING "description of the current project" FORCE) set(PROGRAM_DESCRIPTION "\"${PROGRAM_DESCRIPTION_NO_QUOTE}\"" CACHE STRING "description with double quotes of the current project" FORCE) set(LIBRARY_DIRECTORY "lib" CACHE STRING "define the library directory (especially for Fedora with the wtf lib64)" FORCE) set(DOC_MODE no CACHE BOOL "Doc mode") set(SELF_TESTS_MODE yes CACHE BOOL "Self test mode") message(STATUS "SELF_TESTS_MODE = ${SELF_TESTS_MODE}") if(CMAKE_BUILD_TYPE STREQUAL "Coverage") message(STATUS "Build for tests COVERAGE") set(CTEST_COVERAGE_COMMAND "gcov") set(SELF_TESTS_MODE yes) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -Wall -Werror -g -O0 -fprofile-arcs -ftest-coverage") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -Wall -Werror -g -O2") endif() if(DOC_MODE) add_subdirectory(doc) endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) add_subdirectory(src) if(SELF_TESTS_MODE) include(CTest) add_subdirectory(TESTS) endif(SELF_TESTS_MODE)