This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (31 loc) · 1.22 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
# CMake basic setup.
cmake_minimum_required(VERSION 3.5)
project(Complex VERSION 1.4.0 LANGUAGES CXX)
message("!- Project: " ${PROJECT_NAME})
# C 17 standart required.
set(CMAKE_CXX_STANDARD 17)
# Get conan packages (gtest) and conan CMake commands.
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
# Setup all the CMake variables by target.
# Activate the call to the macro conan_target_link_libraries().
conan_basic_setup(TARGETS)
# Add the 'complex' subdirectory to the build.
add_subdirectory(complex)
# Add 'main' and 'tests' sources to the main executable.
add_executable(main src/main.cpp src/ut/complexTests.cpp)
# Specifies include directories to use when compiling a given target.
target_include_directories(main
PUBLIC
${PROJECT_SOURCE_DIR}/complex
${PROJECT_SOURCE_DIR}/src/ut
)
# Link all libraries to the executable.
target_link_libraries(main PRIVATE complex CONAN_PKG::gtest)
message("!- Conan libs: " ${CONAN_LIBS})
if(CODE_COVERAGE)
message("!- Using code coverage")
# Use CodeCoverage for coverage reports.
include(${PROJECT_SOURCE_DIR}/cmake/CodeCoverage.cmake)
append_coverage_compiler_flags()
setup_target_for_coverage_gcovr_html(NAME maincov EXECUTABLE main)
endif()