forked from tttapa/Control-Surface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (43 loc) · 1.65 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
37
38
39
40
41
42
43
44
45
46
47
cmake_minimum_required(VERSION 3.18)
project(Control-Surface 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_package(Doxygen)
find_package(Python3 COMPONENTS Interpreter)
if (DOXYGEN_FOUND AND Python3_Interpreter_FOUND)
# Add XBM target
add_custom_target(xbm-doxygen
Python3::Interpreter ${CMAKE_CURRENT_LIST_DIR}/src/Display/Bitmaps/Scripts/XBM-export.py
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/docs/Doxygen)
# Add example documentation target
add_custom_target(examples-doxygen
Python3::Interpreter ${CMAKE_CURRENT_LIST_DIR}/doxygen/scripts/examples.py
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/doxygen)
# Add documentation target
add_custom_target(documentation
Doxygen::doxygen
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/doxygen
DEPENDS xbm-doxygen examples-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)