Commit 0709bb5d authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Clean CMakeLists file and add clang-format ECM module

parent a153d955
......@@ -2,10 +2,13 @@ cmake_minimum_required(VERSION 3.0)
project(kontrast)
set(QT_MIN_VERSION "5.14.0")
set(KF5_MIN_VERSION "5.70.0")
include(FeatureSummary)
################# set KDE specific information #################
find_package(ECM 0.0.8 REQUIRED NO_MODULE)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
......@@ -16,18 +19,28 @@ include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMPoQmTools)
include(KDEClangFormat)
################# Find dependencies #################
find_package(Qt5 REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg Sql)
find_package(KF5 REQUIRED COMPONENTS Kirigami2 I18n CoreAddons Config Declarative)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg Sql)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n CoreAddons Config Declarative)
################# Enable C++11 features for clang and gcc #################
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
################# build and install #################
add_subdirectory(src)
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
install(PROGRAMS org.kde.kontrast.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kontrast.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES 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})
qt5_add_resources(kontrast_SRCS resources.qrc)
add_executable(kontrast
main.cpp
kontrast.cpp
savedcolormodel.cpp
resources.qrc
${kontrast_SRCS})
target_link_libraries(kontrast
......@@ -17,6 +17,4 @@ target_link_libraries(kontrast
KF5::CoreAddons
KF5::ConfigCore)
target_compile_features(kontrast PRIVATE cxx_std_17)
install(TARGETS kontrast ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment