-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
147 lines (118 loc) · 3.89 KB
/
Copy pathCMakeLists.txt
File metadata and controls
147 lines (118 loc) · 3.89 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
cmake_minimum_required(VERSION 3.25)
project(oxygen)
set(PROJECT_VERSION "6.7.90")
set(PROJECT_VERSION_MAJOR 6)
include(GenerateExportHeader)
include(WriteBasicConfigVersionFile)
include(FeatureSummary)
################# Qt/KDE #################
set(PROJECT_DEP_VERSION "6.7.90")
set(QT5_MIN_VERSION "5.15.2")
set(KF5_MIN_VERSION "5.102.0")
set(QT_MIN_VERSION "6.11.0")
set(KF6_MIN_VERSION "6.30.0")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# We need this because we can't include KDECMakeSettings here, because that
# would need KDEInstallDirs, which we can only include in the qt{5,6} builds
# to get the correct installation dirs for each Qt version.
option(BUILD_TESTING "Build the testing tree." ON)
if(BUILD_TESTING)
enable_testing()
endif()
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} )
set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS ON)
option(BUILD_QT5 "Build Qt5 style" ON)
option(BUILD_QT6 "Build with Qt6" ON)
# For KDE CI only. As the current infrastructure doesn't allow us to set CMAKE options per build variant
if($ENV{CI_JOB_NAME_SLUG} MATCHES "qt5")
set(BUILD_QT5 ON)
set(BUILD_QT6 OFF)
elseif($ENV{CI_JOB_NAME_SLUG} MATCHES "qt6")
set(BUILD_QT5 OFF)
set(BUILD_QT6 ON)
endif()
include(ECMInstallIcons)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat)
include(KDEGitCommitHooks)
find_package(XCB COMPONENTS XCB)
set_package_properties(XCB PROPERTIES
DESCRIPTION "X protocol C-language Binding"
URL "http://xcb.freedesktop.org"
TYPE OPTIONAL
PURPOSE "Required to pass style properties to native Windows on X11 Platform"
)
if(NOT APPLE)
set(OXYGEN_HAVE_X11 ${XCB_XCB_FOUND})
endif()
if(BUILD_QT5)
block(SCOPE_FOR VARIABLES)
set(QT_MAJOR_VERSION 5)
unset(QUERY_EXECUTABLE CACHE)
include(KDEInstallDirs5)
include (KDECMakeSettings)
find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets DBus Quick)
find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS
I18n
Config
CoreAddons
GuiAddons
WidgetsAddons
Service
Completion
FrameworkIntegration
WindowSystem)
if(OXYGEN_HAVE_X11)
find_package(Qt5X11Extras ${QT5_MIN_VERSION} REQUIRED CONFIG)
endif()
add_subdirectory(liboxygen liboxygen5)
add_subdirectory(kstyle kstyle5)
endblock()
endif()
if(BUILD_QT6)
block(SCOPE_FOR VARIABLES)
set(QT_MAJOR_VERSION 6)
unset(QUERY_EXECUTABLE CACHE)
include(KDEInstallDirs6)
include (KDECMakeSettings)
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets DBus Quick)
find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
I18n
Config
CoreAddons
GuiAddons
KCMUtils
WidgetsAddons
Service
Completion
FrameworkIntegration
WindowSystem)
find_package(Plasma ${PROJECT_DEP_VERSION} REQUIRED)
# https://bugreports.qt.io/browse/QTBUG-114706
add_library(Qt::Core ALIAS Qt6::Core)
add_library(Qt::Gui ALIAS Qt6::Gui)
add_library(Qt::OpenGL ALIAS Qt6::OpenGL)
add_library(Qt::Network ALIAS Qt6::Network)
if(Qt6_VERSION_MINOR GREATER 6)
add_library(Qt::PlatformModuleInternal ALIAS Qt6::PlatformModuleInternal)
endif()
add_subdirectory(liboxygen liboxygen6)
add_subdirectory(kstyle kstyle6)
add_subdirectory(color-schemes)
add_subdirectory(cursors)
add_subdirectory(desktoptheme)
add_subdirectory(kdecoration)
add_subdirectory(lookandfeel)
add_subdirectory(wallpapers)
ki18n_install(po)
endblock()
endif()
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)