-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
77 lines (58 loc) · 1.65 KB
/
CMakeLists.txt
File metadata and controls
77 lines (58 loc) · 1.65 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
cmake_minimum_required(VERSION 3.19)
project(notonlymodbusscope
LANGUAGES CXX
DESCRIPTION "Create logs from value read via Modbus"
VERSION 0.0.1
)
set(SCOPESOURCE ScopeSource)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_AUTORCC ON)
option(USE_GCOV "Enable gcov support" OFF)
# Find the QtCore library
find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}")
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS
Widgets
Xml
Network
PrintSupport
SerialBus
SerialPort
REQUIRED
)
qt_standard_project_setup()
set(QT_LIB
Qt::Widgets
Qt::Xml
Qt::Network
Qt::PrintSupport
Qt::SerialBus
Qt::SerialPort
)
add_compile_options(-Wall -Wextra -Werror)
if (MINGW)
add_compile_options(-Wa,-mbig-obj)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Code Coverage Report
if(USE_GCOV)
message(STATUS "Enabling coverage")
add_compile_options(--coverage)
add_link_options(--coverage)
endif()
endif()
enable_testing()
add_subdirectory(libraries)
add_subdirectory(adapters)
add_subdirectory(src)
add_subdirectory(tests)