-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
47 lines (35 loc) · 1.43 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.21.0)
project(stm32_gtest)
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON) # Define explicitly to use of the standard C17 declared in the previous line
set(CMAKE_C_EXTENSIONS OFF) # Disabling vendor-specific extensions
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) # Define explicitly to use of the standard C++17 declared in the previous line
set(CMAKE_CXX_EXTENSIONS OFF) # Disabling vendor-specific extensions
option(ENABLE_COVERAGE "Enable a Code Coverage build." OFF)
### CMAKE MODULES
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)
# Doxygen module
include(Docs)
if (ENABLE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
endif()
message(STATUS "EXTERNAL: Clone Google Test Framework from Git repository...")
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.15.2
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# It must to be declare before the test folder
enable_testing()
# Variables name for target
set(LIBRARY_NAME library_gpio)
set(DRIVERS_LIBRARY_TARGET drivers_library)
set(MIDDLEWARE_LIBRARY_TARGET middleware_library)
add_subdirectory(source)
add_subdirectory(tests)