-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
96 lines (77 loc) · 2.26 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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
cmake_minimum_required(VERSION 3.20)
project(
"Libre Modelrail Studio" VERSION "0.0.1"
HOMEPAGE_URL "https://github.com/hasselmm/LibreModeltrainStudio"
LANGUAGES CXX
)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(LmrsSupport)
enable_testing()
include(CPack)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(
Qt6 6.5
COMPONENTS CoreTools Charts LinguistTools Multimedia QuickWidgets SerialPort Sql Svg Test Xml
OPTIONAL_COMPONENTS ZlibPrivate
QUIET REQUIRED
)
find_package(WrapOpenSSL QUIET REQUIRED)
if (TARGET Qt6::ZlibPrivate)
message(STATUS "Using Qt6::ZlibPrivate")
add_library(Lmrs::Zlib ALIAS Qt6::ZlibPrivate)
else()
find_package(WrapZLIB QUIET REQUIRED)
add_library(Lmrs::Zlib ALIAS WrapZLIB::WrapZLIB)
endif()
qt_standard_project_setup()
add_definitions(
-DLMRS_VERSION_STRING=\"${CMAKE_PROJECT_VERSION}\"_L1
-DLMRS_HOMEPAGE_URL=\"${CMAKE_PROJECT_HOMEPAGE_URL}\"_L1
-DQT_DEPRECATED_WARNINGS_SINCE=QT_VERSION_CHECK\(6,4,0\)
-DQT_NO_CAST_FROM_ASCII=1
-DQT_NO_URL_CAST_FROM_STRING=1
-DQT_STRICT_ITERATORS=1
)
add_compile_options(
-Wall
-Wextra
-Werror=conversion
-Werror=format
-Werror=ignored-qualifiers
-Werror=implicit-fallthrough
-Werror=missing-declarations
-Werror=missing-field-initializers
-Werror=pessimizing-move
-Werror=reorder
-Werror=return-type
-Werror=sign-compare
-Werror=switch
-Werror=switch-enum
-Werror=tautological-compare
-Werror=unused
-Werror=unused-parameter
-Werror=unused-result
)
if (CLANG)
add_compile_options(
-Werror=missing-prototypes
)
endif()
find_package(CompilerCache)
find_package(Doxygen)
find_package(Sphinx COMPONENTS Breathe MystParser QtHelp)
add_custom_target(documentation SOURCES README.md)
add_subdirectory(lmrs)
add_subdirectory(apps)
add_subdirectory(docs)
add_subdirectory(tools)
add_subdirectory(tests)
file(GLOB_RECURSE cmake_sources CONFIGURE_DEPENDS cmake/*.cmake)
add_custom_target (cmake SOURCES ${cmake_sources})
file(GLOB_RECURSE github_sources CONFIGURE_DEPENDS .github/**/*.yml)
add_custom_target (github SOURCES ${github_sources})