# SPDX-FileCopyrightText: 2026 Matvey Shcherbinin # SPDX-License-Identifier: BSD-2-Clause # # Top level build file. The sources live one directory down, but the project # declaration belongs here so that the repository root is what gets configured, # which is what packagers and the KDE CI both assume. cmake_minimum_required(VERSION 3.21) # Kept in step with the metainfo release and the welcome screen build label. # The old 2.0 was inherited from the pre-port tree and matched nothing shipped. project(KOutNet VERSION 0.2 LANGUAGES CXX) set(QT_MIN_VERSION 6.4) # 6.8 and not 6.0 because Kirigami.Units.cornerRadius, which the timeline and # the pickers round their corners with, was added in 6.8. set(KF_MIN_VERSION 6.8) find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDEGitCommitHooks) include(ECMDeprecationSettings) include(ECMInstallIcons) include(ECMQtDeclareLoggingCategory) include(ECMSetupVersion) include(FeatureSummary) # After the KDE includes on purpose: KDECompilerSettings picks a standard of # its own, and this project wants 23 (libQuotient's cxx_std_23 interface wants # it too). set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOMOC ON) # Qt's Linux binary packages are linked against glibc 2.34, and anything older # has to build Qt from sources, so 2.34 is the floor here. Nothing compiled in # this project reaches a symbol past GLIBC_2.2.5, and the lowest symbol any # dependency wants is __libc_single_threaded() at GLIBC_2.32 (libquotient and # Frameworks' ConfigCore), so a hand-built Qt runs on 2.32. Higher versions seen # in KF6 and libsodium are not requirements but the glibc those packages were # built against: 2.33 and 2.34 renamed those symbols on the way to time64. # # Checked at configure time, since the alternative is a binary that builds and # then will not load. Non-glibc systems are left to be judged on their own. if(CMAKE_SYSTEM_NAME STREQUAL "Linux") include(CheckCXXSourceCompiles) check_cxx_source_compiles(" #include #if defined(__GLIBC__) # if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 34) # error glibc older than 2.34 # endif #endif int main() { return 0; } " KOUTNET_GLIBC_AT_LEAST_2_34) if(NOT KOUTNET_GLIBC_AT_LEAST_2_34) message(FATAL_ERROR "KOutNet needs glibc 2.34 or newer, and this one is older. The code " "here would compile, but Qt's Linux binaries are linked against " "2.34, and on anything older Qt has to be built from sources first. " "Newer is fine.") endif() endif() # The About dialog and the welcome screen read the version from this header, so # project() above stays the only place it is written down. ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX KOUTNET VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/koutnet-version.h ) # Anything deprecated before the minimum versions this project claims to # support has no business compiling, or the claim is not worth much. ecm_set_disabled_deprecation_versions( QT ${QT_MIN_VERSION} KF ${KF_MIN_VERSION} ) add_subdirectory(src) # Formatting is a commit-time concern rather than a review-time one. The hook # only lands in a git checkout, so builds from a tarball are unaffected. kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)