Migrate to KDE configurations
Can be not complete: link error
This commit is contained in:
parent
a6f818864a
commit
3d92ac2abc
9 changed files with 115 additions and 47 deletions
|
@ -1,18 +1,32 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(tutorial_kirigami2 VERSION 0.1.0 LANGUAGES CXX)
|
||||
|
||||
set(KF_MIN_VERSION "6.0.0")
|
||||
set(QT_MIN_VERSION "6.6")
|
||||
set(QT_MIN_VERSION 6.6)
|
||||
set(KF_MIN_VERSION 6.8)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
|
||||
|
||||
# only enable QML debugging on debug builds
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ")
|
||||
|
||||
include(FeatureSummary)
|
||||
include(KDEInstallDirs)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
include(ECMQmlModule)
|
||||
include(ECMQtDeclareLoggingCategory)
|
||||
include(ECMDeprecationSettings)
|
||||
include(ECMAddTests)
|
||||
include(KDEGitCommitHooks)
|
||||
include(KDEClangFormat)
|
||||
include(GenerateExportHeader)
|
||||
include(ECMGenerateHeaders)
|
||||
include(ECMSetupVersion)
|
||||
include(ECMAddQch)
|
||||
|
||||
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
|
||||
Core
|
||||
|
@ -24,11 +38,33 @@ find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
|
|||
)
|
||||
|
||||
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
|
||||
Kirigami2
|
||||
Kirigami
|
||||
I18n
|
||||
Config
|
||||
CoreAddons
|
||||
IconThemes
|
||||
ColorScheme
|
||||
)
|
||||
|
||||
ecm_set_disabled_deprecation_versions(QT ${QT_MIN_VERSION} KF ${KF_MIN_VERSION})
|
||||
|
||||
ecm_setup_version(${PROJECT_VERSION}
|
||||
VARIABLE_PREFIX TUTORIAL_KIRIGAMI2
|
||||
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/tutorial-kirigami2-version.h
|
||||
)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_definitions(-DBUILD_TESTING)
|
||||
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
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)
|
||||
|
||||
ki18n_install(po)
|
||||
|
||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue