-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (44 loc) · 1.6 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
cmake_minimum_required(VERSION 3.16)
set(PROJECT text-highlight-plugin)
project(${PROJECT} VERSION 1.0)
set(CMAKE_CXX_STANDARD 20)
set(KF_DEP_VERSION "${QT_MAJOR_VERSION}")
find_package(ECM ${KF_DEP_VERSION} QUIET REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
find_package(Qt${QT_MAJOR_VERSION}Widgets CONFIG REQUIRED)
find_package(KF${QT_MAJOR_VERSION}TextEditor ${KF_DEP_VERSION} QUIET REQUIRED)
find_package(KF${QT_MAJOR_VERSION}
REQUIRED COMPONENTS
CoreAddons # Core addons on top of QtCore
I18n # For localization
TextEditor # The editor component
)
# This line defines the actual target
if (QT_MAJOR_VERSION EQUAL 6)
kcoreaddons_add_plugin(${PROJECT}
INSTALL_NAMESPACE "kf6/ktexteditor")
else ()
kcoreaddons_add_plugin(${PROJECT}
INSTALL_NAMESPACE "ktexteditor")
endif ()
include(ECMQtDeclareLoggingCategory)
include(ECMOptionalAddSubdirectory)
target_sources(
${PROJECT}
PRIVATE
text_highlight_plugin.cpp
text_highlight_plugin_view.cpp
text_highlight_plugin.json
plugin.qrc
)
add_compile_options(-O3 -Wall -Wextra -Wpedantic -Wno-dev)
# This makes the plugin translatable
target_compile_definitions(${PROJECT} PRIVATE TRANSLATION_DOMAIN="${PROJECT}")
target_link_libraries(${PROJECT}
PRIVATE
KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::TextEditor
)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)