forked from tttapa/Arduino-Filters
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
49 lines (42 loc) · 1.46 KB
/
Copy pathCMakeLists.txt
File metadata and controls
49 lines (42 loc) · 1.46 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.18)
project(Arduino-Filters CXX)
# GoogleTest requires at least C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
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)