-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
36 lines (32 loc) · 1.07 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.18)
project(Arduino-Filters CXX)
set(CMAKE_CXX_STANDARD 14)
enable_testing()
# Add coverage target
option(AH_WITH_COVERAGE
"Generate coverage information." Off)
if (AH_WITH_COVERAGE)
add_custom_target(coverage
${CMAKE_CURRENT_LIST_DIR}/scripts/coverage.sh
${CMAKE_CXX_COMPILER_ID}
${CMAKE_CXX_COMPILER_VERSION}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fno-inline")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fno-inline")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
add_dependencies(coverage Arduino-Helpers::tests)
endif()
# Add documentation target
find_program(AH_DOXYGEN doxygen)
if (AH_DOXYGEN)
add_custom_target(documentation
doxygen
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/doxygen)
endif()
# Compiler warnings
option(AH_WARNINGS_AS_ERRORS "Enable -Werror" On)
include(cmake/Warnings.cmake)
# Build the source files and tests
add_subdirectory(mock)
add_subdirectory(src)
add_subdirectory(test)