Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
# SPDX-FileCopyrightText: 2019 Christoph Cullmann <cullmann@kde.org>
# SPDX-FileCopyrightText: 2019 Gernot Gebhard <gebhard@absint.com>
#
# SPDX-License-Identifier: MIT

# This file got automatically created by ECM, do not edit
# See https://clang.llvm.org/docs/ClangFormatStyleOptions.html for the config options
# and https://community.kde.org/Policies/Frameworks_Coding_Style#Clang-format_automatic_code_formatting
# for clang-format tips & tricks
---
Language: JavaScript
DisableFormat: true
---
Language: Json
DisableFormat: false
IndentWidth: 4
---

# Style for C++
Language: Cpp

# base is WebKit coding style: https://webkit.org/code-style-guidelines/
# below are only things set that diverge from this style!
BasedOnStyle: WebKit

# enforce C++11 (e.g. for std::vector<std::vector<lala>>
Standard: Cpp11

# 4 spaces indent
TabWidth: 4

# 2 * 80 wide lines
ColumnLimit: 160

# sort includes inside line separated groups
SortIncludes: true

# break before braces on function, namespace and class definitions.
BreakBeforeBraces: Linux

# CrlInstruction *a;
PointerAlignment: Right

# horizontally aligns arguments after an open bracket.
AlignAfterOpenBracket: Align

# don't move all parameters to new line
AllowAllParametersOfDeclarationOnNextLine: false

# no single line functions
AllowShortFunctionsOnASingleLine: None

# no single line enums
AllowShortEnumsOnASingleLine: false

# always break before you encounter multi line strings
AlwaysBreakBeforeMultilineStrings: true

# don't move arguments to own lines if they are not all on the same
BinPackArguments: false

# don't move parameters to own lines if they are not all on the same
BinPackParameters: false

# In case we have an if statement with multiple lines the operator should be at the beginning of the line
# but we do not want to break assignments
BreakBeforeBinaryOperators: NonAssignment

# format C++11 braced lists like function calls
Cpp11BracedListStyle: true

# do not put a space before C++11 braced lists
SpaceBeforeCpp11BracedList: false

# remove empty lines
KeepEmptyLinesAtTheStartOfBlocks: false

# no namespace indentation to keep indent level low
NamespaceIndentation: None

# we use template< without space.
SpaceAfterTemplateKeyword: false

# Always break after template declaration
AlwaysBreakTemplateDeclarations: true

# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE , wl_resource_for_each, wl_resource_for_each_safe ]

# keep lambda formatting multi-line if not empty
AllowShortLambdasOnASingleLine: Empty

# We do not want clang-format to put all arguments on a new line
AllowAllArgumentsOnNextLine: false
35 changes: 28 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.15)

project(switcher)

set(QT_MIN_VERSION "5.9.0")
set(KF5_MIN_VERSION "5.42.0")
find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE)

find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Widgets X11Extras)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Runner I18n)
set(QT_MAJOR_VERSION "6")
set(QT_MIN_VERSION "6.4.0")
set(KF_MAJOR_VERSION "6")
set(KF6_MIN_VERSION "6.4.0")

set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(KDEClangFormat)
include(KDEGitCommitHooks)


find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION}
CONFIG REQUIRED
COMPONENTS
Widgets)
find_package(KF${KF_MAJOR_VERSION} ${KF6_MIN_VERSION}
REQUIRED COMPONENTS
Runner
I18n
WindowSystem
# Pulled in by Plasma
Config)

add_subdirectory(src)



feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

# add clang-format target for all our real source files
file(GLOB ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
Loading