-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
executable file
·137 lines (109 loc) · 3.9 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
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
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2021-2024 Eike Hein <[email protected]>
cmake_minimum_required(VERSION 3.25)
find_package(ECM 6.1.0 REQUIRED NO_MODULE)
set(CMAKE_CXX_STANDARD 17)
set(CXX_STANDARD_REQUIRED ON)
set(QT_MIN_VERSION "6.8.0")
set(KF6_MIN_VERSION "6.8.0")
project(Hyelicht
VERSION 2.0
DESCRIPTION "Controller application for the Hyelicht shelf. Paint on the shelf \
with colors, turn on the fireplace mode, and more.")
string(TOLOWER ${PROJECT_NAME} PROJECT_LOWERCASE_NAME)
set(HYELICHT_DOMAIN_NAME "com.hyerimandeike.${PROJECT_LOWERCASE_NAME}")
set(CMAKE_AUTOMOC ON)
set(AUTOMOC_MOC_OPTIONS -Muri=${HYELICHT_DOMAIN_NAME})
set(CMAKE_AUTORCC ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(CMakePackageConfigHelpers)
include(FeatureSummary)
include(ECMAddAppIcon)
include(ECMInstallIcons)
include(ECMFindQmlModule)
include(ECMQtDeclareLoggingCategory)
include(GNUInstallDirs)
include(KDEInstallDirs)
include(ECMConfiguredInstall)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
# For convenience, default BUILD_ONBOARD and BUILD_CLI to off on Android.
if(ANDROID)
set(HYELICHT_OPTIONAL_FEATURES_DEFAULT FALSE)
else()
set(HYELICHT_OPTIONAL_FEATURES_DEFAULT TRUE)
endif()
set(BUILD_CLI_HELP "Build the `hyelichtctl` CLI frontend to the HTTP REST API.")
option(BUILD_CLI ${BUILD_CLI_HELP} ${HYELICHT_OPTIONAL_FEATURES_DEFAULT})
add_feature_info(BUILD_CLI BUILD_CLI ${BUILD_CLI_HELP})
set(BUILD_DOCS_HELP "Generate documentation using Doxygen.")
option(BUILD_DOCS ${BUILD_DOCS_HELP} FALSE)
add_feature_info(BUILD_DOCS BUILD_DOCS ${BUILD_DOCS_HELP})
set(BUILD_ONBOARD_HELP "Build onboard features and set onboard behavior defaults.")
option(BUILD_ONBOARD ${BUILD_ONBOARD_HELP} ${HYELICHT_OPTIONAL_FEATURES_DEFAULT})
add_feature_info(BUILD_ONBOARD BUILD_ONBOARD ${BUILD_ONBOARD_HELP})
set(CLANG_TIDY_HELP "Enable clang-tidy during the build process.")
option(CLANG_TIDY ${CLANG_TIDY_HELP} FALSE)
add_feature_info(CLANG_TIDY CLANG_TIDY ${CLANG_TIDY_HELP})
set(DEBUG_QML_HELP "Enable QML debugger/profiler support.")
option(DEBUG_QML ${DEBUG_QML_HELP} FALSE)
add_feature_info(DEBUG_QML DEBUG_QML ${DEBUG_QML_HELP})
if(BUILD_ONBOARD)
set(qtOnboardComponents
"HttpServer"
"SerialPort"
)
endif()
if(ANDROID)
include(ECMAddAndroidApk)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)
endif()
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
Core
Network
Qml
Quick
RemoteObjects
ShaderTools
${qtOnboardComponents}
${qtAndroidComponents}
)
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED
Config
CoreAddons
I18n
)
if(BUILD_DOCS)
find_package(Doxygen 1.9.8 REQUIRED dot)
if(DOXYGEN_FOUND)
add_subdirectory(docs)
endif()
endif()
ecm_find_qmlmodule(QtQml REQUIRED)
ecm_find_qmlmodule(QtQuick.Controls REQUIRED)
ecm_find_qmlmodule(QtQuick.Effects REQUIRED)
ecm_find_qmlmodule(QtQuick.Layouts REQUIRED)
ecm_find_qmlmodule(QtQuick.Window REQUIRED)
if(CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*;-fix")
endif()
if(DEBUG_QML)
message(STATUS "To enable the QML debugger/profiler, run with: '-qmljsdebugger=port:1234'")
add_definitions(-DQT_QML_DEBUG)
endif()
add_definitions(
-DQT_USE_QSTRINGBUILDER
-DQT_NO_CAST_TO_ASCII
-DQT_STRICT_ITERATORS
-DQT_NO_URL_CAST_FROM_STRING
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_USE_FAST_OPERATOR_PLUS
)
# New in Qt 6.5, see https://doc.qt.io/qt-6/qt-cmake-policy-qtp0001.html
qt_policy(SET QTP0001 NEW)
# New in Qt 6.8, see https://doc.qt.io/qt-6/qt-cmake-policy-qtp0004.html
qt_policy(SET QTP0004 NEW)
add_subdirectory(data)
add_subdirectory(src)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)