dotherside/CMakeLists.txt

38 lines
915 B
CMake
Raw Normal View History

2020-04-17 20:21:40 +02:00
cmake_minimum_required(VERSION 3.2)
2016-05-16 22:14:06 +02:00
2020-04-17 20:20:36 +02:00
project(DOtherSide)
option(ENABLE_DOCS "Enable docs" ON)
option(ENABLE_TESTS "Enable tests" ON)
option(ENABLE_DYNAMIC_LIBS "Enable dynamic libraries" ON)
option(ENABLE_STATIC_LIBS "Enable static libraries" ON)
2016-05-16 22:14:06 +02:00
# Add additional source path for cmake
2019-11-18 00:05:58 +01:00
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)
2016-05-16 22:14:06 +02:00
# Add strict warning checking for C++
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
2019-11-18 00:05:58 +01:00
# Add Coverage option
option(ENABLE_COVERAGE "Enable coverage" OFF)
2016-05-16 22:14:06 +02:00
2019-11-18 00:05:58 +01:00
add_compile_options(-Wall -Wno-long-long -pedantic)
2016-05-16 22:14:06 +02:00
2019-11-18 00:05:58 +01:00
if (ENABLE_COVERAGE)
message(STATUS "Enabling coverage")
set(CMAKE_BUILD_TYPE Debug)
add_compile_options(-g -O0 --coverage)
add_link_options(--coverage)
2019-11-18 00:05:58 +01:00
endif()
endif()
2016-05-16 22:14:06 +02:00
add_subdirectory(lib)
if(ENABLE_DOCS)
add_subdirectory(doc)
endif()
if(ENABLE_TESTS)
add_subdirectory(test)
endif()