Skip to content

Commit 0bab0e2

Browse files
committed
style: format CMakeLists
1 parent 003204b commit 0bab0e2

File tree

1 file changed

+42
-26
lines changed

1 file changed

+42
-26
lines changed

CMakeLists.txt

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set(PROJECT text-highlight-plugin)
33
project(${PROJECT} VERSION 1.0)
44

55
set(CMAKE_CXX_STANDARD 20)
6+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
67

78
set(KF_DEP_VERSION "${QT_MAJOR_VERSION}")
89
find_package(ECM ${KF_DEP_VERSION} QUIET REQUIRED NO_MODULE)
@@ -17,43 +18,58 @@ find_package(Qt${QT_MAJOR_VERSION}Widgets CONFIG REQUIRED)
1718

1819
find_package(KF${QT_MAJOR_VERSION}TextEditor ${KF_DEP_VERSION} QUIET REQUIRED)
1920

20-
find_package(KF${QT_MAJOR_VERSION}
21-
REQUIRED COMPONENTS
22-
CoreAddons # Core addons on top of QtCore
23-
I18n # For localization
24-
TextEditor # The editor component
21+
find_package(
22+
KF${QT_MAJOR_VERSION} REQUIRED
23+
COMPONENTS CoreAddons # Core addons on top of QtCore
24+
I18n # For localization
25+
TextEditor # The editor component
2526
)
2627

2728
# This line defines the actual target
28-
if (QT_MAJOR_VERSION EQUAL 6)
29-
kcoreaddons_add_plugin(${PROJECT}
30-
INSTALL_NAMESPACE "kf6/ktexteditor")
31-
else ()
32-
kcoreaddons_add_plugin(${PROJECT}
33-
INSTALL_NAMESPACE "ktexteditor")
34-
endif ()
29+
if(QT_MAJOR_VERSION EQUAL 6)
30+
kcoreaddons_add_plugin(${PROJECT} INSTALL_NAMESPACE "kf6/ktexteditor")
31+
else()
32+
kcoreaddons_add_plugin(${PROJECT} INSTALL_NAMESPACE "ktexteditor")
33+
endif()
3534

3635
include(ECMQtDeclareLoggingCategory)
3736
include(ECMOptionalAddSubdirectory)
3837

3938
target_sources(
40-
${PROJECT}
41-
PRIVATE
42-
text_highlight_plugin.cpp
43-
text_highlight_plugin_view.cpp
44-
text_highlight_plugin.json
39+
${PROJECT} PRIVATE text_highlight_plugin.cpp text_highlight_plugin_view.cpp
40+
text_highlight_plugin.json plugin.qrc)
4541

46-
plugin.qrc
47-
)
48-
49-
add_compile_options(-O3 -Wall -Wextra -Wpedantic -Wno-dev)
42+
add_compile_options(
43+
-O3
44+
-Wall
45+
-Wextra
46+
-Wpedantic
47+
-Wno-dev
48+
-Wformat
49+
-Wformat=2
50+
-Wconversion
51+
-Wimplicit-fallthrough
52+
-Werror=format-security
53+
-U_FORTIFY_SOURCE
54+
-D_FORTIFY_SOURCE=3
55+
-D_GLIBCXX_ASSERTIONS
56+
-fstrict-flex-arrays=3
57+
-fstack-clash-protection
58+
-fstack-protector-strong
59+
-Wl,-z,nodlopen
60+
-Wl,-z,noexecstack
61+
-Wl,-z,relro
62+
-Wl,-z,now
63+
-Wl,--as-needed
64+
-Wl,--no-copy-dt-needed-entries)
5065

5166
# This makes the plugin translatable
5267
target_compile_definitions(${PROJECT} PRIVATE TRANSLATION_DOMAIN="${PROJECT}")
5368

54-
target_link_libraries(${PROJECT}
55-
PRIVATE
56-
KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::I18n KF${QT_MAJOR_VERSION}::TextEditor
57-
)
69+
target_link_libraries(
70+
${PROJECT}
71+
PRIVATE KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::I18n
72+
KF${QT_MAJOR_VERSION}::TextEditor)
5873

59-
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
74+
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES
75+
FATAL_ON_MISSING_REQUIRED_PACKAGES)

0 commit comments

Comments
 (0)