-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
124 lines (93 loc) · 3.7 KB
/
CMakeLists.txt
File metadata and controls
124 lines (93 loc) · 3.7 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
# SPDX-FileCopyrightText: 2021 Mathis Brüchert <mbb-mail@gmx.de>
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.20)
# TODO move to release service
set(RELEASE_SERVICE_VERSION_MAJOR "1")
set(RELEASE_SERVICE_VERSION_MINOR "5")
set(RELEASE_SERVICE_VERSION "1.5.2")
project(marknote VERSION ${RELEASE_SERVICE_VERSION})
include(FeatureSummary)
set(QT_MIN_VERSION 6.6)
set(KF_MIN_VERSION 6.21)
set(KPIM_MIME_VERSION "6.1.0")
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMSetupVersion)
include(KDEClangFormat)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(KDEGitCommitHooks)
include(ECMAddAppIcon)
include(ECMAddTests)
include(ECMDeprecationSettings)
include(ECMFindQmlModule)
include(ECMQmlModule)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-unused-parameter)
add_compile_options(-Wno-missing-include-dirs)
endif()
ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX MARKNOTE
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/marknote-version.h
)
if (NOT ANDROID AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
option(WITH_KRUNNER "Build with Plasma Runner support." ON)
endif()
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami I18n Config CoreAddons IconThemes ColorScheme Notifications)
if (NOT ANDROID AND KF6CoreAddons_VERSION VERSION_LESS "6.19.0")
option(WITH_KCRASH "Build with KCrash support as KCoreAddons is not new enough." ON)
endif()
if (WITH_KRUNNER)
find_package(Qt6DBus ${QT_MIN_VERSION} REQUIRED)
find_package(KF6WindowSystem ${KF_MIN_VERSION} REQUIRED)
endif()
if (WITH_KCRASH)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Crash)
endif()
ecm_find_qmlmodule(org.kde.syntaxhighlighting ${KF_MIN_VERSION})
if (NOT ANDROID)
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets)
endif()
if (BUILD_TESTING)
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
endif()
find_package(KF6KirigamiAddons 1.11.0 REQUIRED)
set_package_properties(KF6KirigamiAddons PROPERTIES
TYPE REQUIRED
PURPOSE "Required application components and runtime dependency"
)
ecm_set_disabled_deprecation_versions(QT 6.9.0
KF 6.19.0
)
find_package(KPim6Mime ${KPIM_MIME_VERSION} CONFIG REQUIRED)
find_package(md4c)
set_package_properties(md4c PROPERTIES
TYPE OPTIONAL
DESCRIPTION "MD4C stands for \"Markdown for C\" and that's exactly what this project is about."
URL "https://github.com/mity/md4c"
PURPOSE "Improve output of markdown to html conversion"
)
add_definitions(-DQT_NO_FOREACH -DQT_NO_KEYWORDS)
add_subdirectory(src)
ki18n_install(po)
install(PROGRAMS org.kde.marknote.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES marknote.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
install(FILES org.kde.marknote.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES org.kde.marknote.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
if (WITH_KRUNNER)
install(FILES plasma-runner-marknote.desktop DESTINATION ${KDE_INSTALL_DATAROOTDIR}/krunner/dbusplugins)
endif()
ecm_qt_install_logging_categories(
EXPORT MARKNOTE
FILE marknote.categories
SORT DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)