# # gcd/CMakeLists.txt -- # cmake_minimum_required(VERSION 3.12) project(gcd VERSION 0.4.0 LANGUAGES C) option(BUILD_COVERAGE "Build with test coverage analysis enabled" OFF) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_EXTENSIONS OFF) if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU") add_compile_options(-Wall -Wextra -Werror) endif() if(BUILD_COVERAGE) set(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage") set(CMAKE_C_FLAGS "-g -O0 -Wall -W -fprofile-arcs -ftest-coverage") set(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage") endif(BUILD_COVERAGE) find_package(Threads) find_package(PkgConfig) add_subdirectory(doc) add_subdirectory(src) add_subdirectory(test) enable_testing() add_test(NAME misc COMMAND check-gcd)