diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/.gitlab-ci.yml b/local/recipes/kde/kf6-extra-cmake-modules/source/.gitlab-ci.yml
index cd89544ce2..12d34778f2 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/.gitlab-ci.yml
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/.gitlab-ci.yml
@@ -5,14 +5,13 @@ include:
- project: sysadmin/ci-utilities
file:
- /gitlab-templates/linux.yml
- - /gitlab-templates/linux-static.yml
- - /gitlab-templates/freebsd.yml
- /gitlab-templates/android-qt6.yml
- /gitlab-templates/linux-qt6.yml
+ - /gitlab-templates/linux-qt6-next.yml
- /gitlab-templates/linux-qt6-static.yml
- - /gitlab-templates/windows.yml
- - /gitlab-templates/windows-static.yml
- /gitlab-templates/freebsd-qt6.yml
- /gitlab-templates/windows-qt6.yml
- /gitlab-templates/alpine-qt6.yml
+ - /gitlab-templates/xml-lint.yml
+ - /gitlab-templates/yaml-lint.yml
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/.kde-ci.yml b/local/recipes/kde/kf6-extra-cmake-modules/source/.kde-ci.yml
index 903c72d1d9..ddaac3e6ba 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/.kde-ci.yml
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/.kde-ci.yml
@@ -3,4 +3,4 @@
Options:
per-test-timeout: 120
- require-passing-tests-on: [ 'Linux', 'FreeBSD', 'Windows' ]
+ require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows']
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/.redbear-src-version b/local/recipes/kde/kf6-extra-cmake-modules/source/.redbear-src-version
new file mode 100644
index 0000000000..2ece8e17b5
--- /dev/null
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/.redbear-src-version
@@ -0,0 +1 @@
+6.28.0
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/CMakeLists.txt
index 8895e8a7c2..c7983171be 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/CMakeLists.txt
@@ -5,13 +5,13 @@
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================
-cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.29)
#
# Preliminary setup
#
-set(VERSION "6.10.0") # handled by release scripts
+set(VERSION "6.28.0") # handled by release scripts
project(ECM
VERSION "${VERSION}"
@@ -40,7 +40,7 @@ set(SHARE_INSTALL_DIR share
set(CMAKECONFIG_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/cmake/)
set(FIND_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/find-modules/)
-set(KDE_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/kde-modules/)
+set(KDE_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/kde-modules)
set(MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/modules/)
set(TOOLCHAIN_MODULES_INSTALL_DIR ${SHARE_INSTALL_DIR}/ECM/toolchain/)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/docs/sphinx/ext/ecm.py b/local/recipes/kde/kf6-extra-cmake-modules/source/docs/sphinx/ext/ecm.py
index a09e4890af..173a28b38d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/docs/sphinx/ext/ecm.py
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/docs/sphinx/ext/ecm.py
@@ -41,11 +41,6 @@ QtHelpBuilder.build_keywords = new_build_keywords
from docutils.parsers.rst import Directive, directives
from docutils.transforms import Transform
-try:
- from docutils.utils.error_reporting import SafeString, ErrorString
-except ImportError:
- # error_reporting was not in utils before version 0.11:
- from docutils.error_reporting import SafeString, ErrorString
from docutils import io, nodes
@@ -80,13 +75,13 @@ class ECMModule(Directive):
f = io.FileInput(source_path=path, encoding=encoding,
error_handler=e_handler)
except UnicodeEncodeError:
- raise self.severe('Problems with "%s" directive path:\n'
- 'Cannot encode input file path "%s" '
- '(wrong locale?).' %
- (self.name, SafeString(path)))
+ msg = ('Problems with "%s" directive path:\n'
+ 'Cannot encode input file path "%s" '
+ '(wrong locale?).' % (self.name, path))
+ raise self.severe(msg)
except IOError as error:
- raise self.severe('Problems with "%s" directive path:\n%s.' %
- (self.name, ErrorString(error)))
+ msg = 'Problems with "%s" directive path:\n%s.' % (self.name, error)
+ raise self.severe(msg)
raw_lines = f.read().splitlines()
f.close()
rst = None
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7Zip.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7Zip.cmake
index df55ea9fea..91efb864b6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7Zip.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7Zip.cmake
@@ -32,6 +32,8 @@ target:
Since 5.113.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
if(WIN32)
find_program(7Zip_EXECUTABLE NAMES 7z 7za)
else()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7z.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7z.cmake
index 5f824f8f4a..cc462441fc 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7z.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Find7z.cmake
@@ -34,6 +34,8 @@ Deprecated: since 5.113, use :find-module:`Find7Zip`.
Since 5.85.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_program(7z_EXECUTABLE NAMES 7z.exe 7za.exe)
include(FindPackageHandleStandardArgs)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindCanberra.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindCanberra.cmake
index 86cb739f44..66b440217b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindCanberra.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindCanberra.cmake
@@ -33,6 +33,8 @@ exported library, it must be made available by the package config file.
Since 5.56.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_Canberra QUIET IMPORTED_TARGET libcanberra)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindEGL.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindEGL.cmake
index 747901b3a9..5fe1d19eeb 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindEGL.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindEGL.cmake
@@ -38,6 +38,8 @@ exported library, it must be made available by the package config file.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)
@@ -57,13 +59,15 @@ find_path(EGL_INCLUDE_DIR
HINTS
${PKG_EGL_INCLUDE_DIRS}
)
-find_library(EGL_LIBRARY
- NAMES
- EGL
- libEGL
- HINTS
- ${PKG_EGL_LIBRARY_DIRS}
-)
+if(NOT EMSCRIPTEN)
+ find_library(EGL_LIBRARY
+ NAMES
+ EGL
+ libEGL
+ HINTS
+ ${PKG_EGL_LIBRARY_DIRS}
+ )
+endif()
# NB: We do *not* use the version information from pkg-config, as that
# is the implementation version (eg: the Mesa version)
@@ -95,7 +99,9 @@ if(EGL_INCLUDE_DIR)
endif()
cmake_push_check_state(RESET)
-list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}")
+if(NOT EMSCRIPTEN)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}")
+endif()
list(APPEND CMAKE_REQUIRED_INCLUDES "${EGL_INCLUDE_DIR}")
check_cxx_source_compiles("
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindFFmpeg.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindFFmpeg.cmake
index b0f4521a57..bba5b5606c 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindFFmpeg.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindFFmpeg.cmake
@@ -18,7 +18,7 @@ The following components are available::
AVUTIL SWRESAMPLE SWSCALE POSTPROCESS
If no components are specified in the find_module call, the following ones
-will be choosen as default::
+will be chosen as default::
AVFORMAT AVUTIL AVCODEC
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGLIB2.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGLIB2.cmake
index 01d1c0cfe6..16995affc6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGLIB2.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGLIB2.cmake
@@ -36,6 +36,8 @@ imported target:
Since 5.41.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_GLIB2 QUIET glib-2.0)
@@ -81,7 +83,7 @@ find_library(GLIB2_GIO_LIBRARIES
)
# search the glibconfig.h include dir under the same root where the library is found
-get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH)
+get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" DIRECTORY)
find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
PATH_SUFFIXES glib-2.0/include
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGperf.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGperf.cmake
index 95247afd20..7dd5810a54 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGperf.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGperf.cmake
@@ -52,6 +52,8 @@ A simple invocation would be:
Since 5.35.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(Gperf)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGradle.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGradle.cmake
index f08ccc2bff..b40739f2a8 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGradle.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindGradle.cmake
@@ -27,6 +27,8 @@ Installs a Android AAR library that has been created with ``gradle_add_aar``.
Since 5.76.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
include(FindPackageHandleStandardArgs)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIcoTool.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIcoTool.cmake
index 11243cd47f..063a2fecd9 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIcoTool.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIcoTool.cmake
@@ -30,6 +30,8 @@ target:
Since 5.49.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(IcoTool)
find_program(IcoTool_EXECUTABLE NAMES icotool)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindInotify.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindInotify.cmake
index 5206b733f8..c735dfdbf7 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindInotify.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindInotify.cmake
@@ -9,7 +9,7 @@ FindInotify
Try to find inotify on this system. This finds:
- libinotify on Unix like systems, or
- - the kernel's inotify on Linux systems.
+ - the kernel's inotify.
This will define the following variables:
@@ -20,39 +20,63 @@ This will define the following variables:
``Inotify_INCLUDE_DIRS``
This has to be passed to target_include_directories()
-On Linux and SunOS, the libraries and include directories are empty,
-even though ``Inotify_FOUND`` may be set to TRUE. This is because
+On some platforms like Linux and SunOS, the libraries and include directories
+are empty, even though ``Inotify_FOUND`` may be set to TRUE. This is because
no special includes or libraries are needed. On other systems
these may be needed to use inotify.
Since 5.32.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
+# Reset the cache var before searching for sys/inotify.h
+# This is required, because on systems with native inotify we reset Inotify_INCLUDE_DIRS
+# to an empty string. Rerunning CMake in this case will reuse the empty variable
+# and we will not get into if(Inotify_INCLUDE_DIRS) the second time
+unset(Inotify_INCLUDE_DIRS CACHE)
+find_path(Inotify_INCLUDE_DIRS sys/inotify.h PATHS /usr/include NO_DEFAULT_PATH)
find_path(Inotify_INCLUDE_DIRS sys/inotify.h)
if(Inotify_INCLUDE_DIRS)
-# On Linux and SunOS, there is no library to link against, on the BSDs there is.
-# On the BSD's, inotify is implemented through a library, libinotify.
- if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "SunOS")
+ # On OSes with a kernel implementation, there is no library to link against.
+ # On some others inotify is implemented through a library, libinotify.
+ # If we found a header, but not a library, assume a kernel implementation
+ find_library(Inotify_LIBRARIES NAMES inotify)
+ if(NOT Inotify_LIBRARIES)
set(Inotify_FOUND TRUE)
- set(Inotify_LIBRARIES "")
- set(Inotify_INCLUDE_DIRS "")
+ set(Inotify_LIBRARIES "" CACHE STRING "" FORCE)
+ set(Inotify_INCLUDE_DIRS "" CACHE STRING "" FORCE)
else()
- find_library(Inotify_LIBRARIES NAMES inotify)
- include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(Inotify
- FOUND_VAR
- Inotify_FOUND
- REQUIRED_VARS
- Inotify_LIBRARIES
- Inotify_INCLUDE_DIRS
- )
- mark_as_advanced(Inotify_LIBRARIES Inotify_INCLUDE_DIRS)
- include(FeatureSummary)
- set_package_properties(Inotify PROPERTIES
- URL "https://github.com/libinotify-kqueue/"
- DESCRIPTION "inotify API on the *BSD family of operating systems."
- )
+ # On FreeBSD 15+ we may end up with both in-kernel and libinotify
+ # implementation. To discern between them, compare prefixes of
+ # ${Inotify_INCLUDE_DIRS} and ${Inotify_LIBRARIES}: if we get
+ # /usr/include and /usr/local/lib/libinotify.so then assume that the
+ # kernel implementation is available and user wants it, instead of libinotify
+ cmake_path(GET Inotify_INCLUDE_DIRS PARENT_PATH includes_prefix)
+ cmake_path(GET Inotify_LIBRARIES PARENT_PATH lib_prefix)
+ cmake_path(GET lib_prefix PARENT_PATH lib_prefix)
+ cmake_path(COMPARE ${includes_prefix} EQUAL ${lib_prefix} prefixes_match)
+
+ if(NOT prefixes_match)
+ set(Inotify_FOUND TRUE)
+ set(Inotify_LIBRARIES "" CACHE STRING "" FORCE)
+ set(Inotify_INCLUDE_DIRS "" CACHE STRING "" FORCE)
+ else()
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Inotify
+ FOUND_VAR
+ Inotify_FOUND
+ REQUIRED_VARS
+ Inotify_LIBRARIES
+ Inotify_INCLUDE_DIRS
+ )
+ include(FeatureSummary)
+ set_package_properties(Inotify PROPERTIES
+ URL "https://github.com/libinotify-kqueue/"
+ DESCRIPTION "inotify API on the *BSD family of operating systems."
+ )
+ endif()
endif()
if(NOT TARGET Inotify::Inotify)
add_library(Inotify::Inotify INTERFACE IMPORTED)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIsoCodes.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIsoCodes.cmake
index 58b0d019fd..b202912f29 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIsoCodes.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindIsoCodes.cmake
@@ -20,6 +20,8 @@ Once done this will define:
Since 5.80.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_iso_codes QUIET iso-codes)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF5.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF5.cmake
index ed7215c8d3..71f5fa727c 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF5.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF5.cmake
@@ -25,6 +25,8 @@ will be set to true. Otherwise, it will be set to false.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(KF5)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF6.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF6.cmake
index 9e50d6a876..1651d23371 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF6.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindKF6.cmake
@@ -25,6 +25,8 @@ will be set to true. Otherwise, it will be set to false.
Since 6.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(KF6)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibExiv2.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibExiv2.cmake
index 83e1d6b790..5748e6be21 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibExiv2.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibExiv2.cmake
@@ -39,6 +39,8 @@ exported library, it must be made available by the package config file.
Since 5.53.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_EXIV2 QUIET exiv2)
@@ -86,6 +88,12 @@ if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2)
IMPORTED_LOCATION "${LibExiv2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LibExiv2_INCLUDE_DIRS}"
)
+
+ if("${LibExiv2_LIBRARIES}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
+ set_target_properties(LibExiv2::LibExiv2 PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${PC_EXIV2_LINK_LIBRARIES}"
+ )
+ endif()
if (LibExiv2_VERSION VERSION_LESS 0.28.0)
# exiv2 0.27 or older still uses std::auto_ptr, which is no longer available
# by default when using newer C++ versions
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibGit2.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibGit2.cmake
index 51b4858748..c889a959e6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibGit2.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibGit2.cmake
@@ -39,6 +39,8 @@ exported library, it must be made available by the package config file.
Since 1.3.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(LibGit2)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibMount.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibMount.cmake
index ad213c6313..b596ddba80 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibMount.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibMount.cmake
@@ -29,6 +29,8 @@ If ``LibMount_FOUND`` is TRUE, it will also define the following imported target
Since 5.83.0
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBMOUNT QUIET IMPORTED_TARGET mount)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibcap.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibcap.cmake
index 2433a76dc1..b8e9fea5e3 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibcap.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindLibcap.cmake
@@ -22,6 +22,8 @@ In addition, the following targets are defined:
Since 5.80.0
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_program(SETCAP_EXECUTABLE NAMES setcap DOC "The setcap executable")
find_library(Libcap_LIBRARIES NAMES cap DOC "The cap (capabilities) library")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindOpenEXR.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindOpenEXR.cmake
index e4efe3154f..e433591609 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindOpenEXR.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindOpenEXR.cmake
@@ -32,6 +32,8 @@ exported library, it must be made available by the package config file.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(OpenEXR)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPhoneNumber.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPhoneNumber.cmake
index 303aaa1460..5b3144ae7e 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPhoneNumber.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPhoneNumber.cmake
@@ -32,6 +32,8 @@ will be defined.
Since 5.54.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(ECMFindModuleHelpersStub)
ecm_find_package_version_check(PhoneNumber)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPoppler.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPoppler.cmake
index 55ac3017d4..ce37758a57 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPoppler.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPoppler.cmake
@@ -52,6 +52,8 @@ package config file.
Since 5.19
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(Poppler)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPulseAudio.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPulseAudio.cmake
index 1dae48dffd..96d52592d0 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPulseAudio.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindPulseAudio.cmake
@@ -36,6 +36,8 @@ imported target:
Since 5.41.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# Support PulseAudio_MINIMUM_VERSION for compatibility:
if(NOT PulseAudio_FIND_VERSION)
set(PulseAudio_FIND_VERSION "${PulseAudio_MINIMUM_VERSION}")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQHelpGenerator.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQHelpGenerator.cmake
index b259010597..15c9b8d87b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQHelpGenerator.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQHelpGenerator.cmake
@@ -12,6 +12,8 @@ Finds the Qt5 QHelpGenerator
QHelpGenerator_EXECUTABLE - Path to executable
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
find_package(Qt${QT_MAJOR_VERSION}Help QUIET)
if (TARGET Qt5::qhelpgenerator)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQtWaylandScanner.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQtWaylandScanner.cmake
index 1a73b80fac..d3f74fa07f 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQtWaylandScanner.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindQtWaylandScanner.cmake
@@ -83,6 +83,8 @@ WaylandScanner is required and will be searched for.
Since 1.4.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
include("${ECM_MODULE_DIR}/ECMQueryQt.cmake")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindReuseTool.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindReuseTool.cmake
index 67254639d5..1ea18ce77b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindReuseTool.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindReuseTool.cmake
@@ -12,6 +12,8 @@ Finds the REUSE Tool by FSFE: https://github.com/fsfe/reuse-tool
REUSETOOL_EXECUTABLE - Path to executable
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_program(REUSETOOL_EXECUTABLE NAMES reuse)
include(FindPackageHandleStandardArgs)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSasl2.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSasl2.cmake
index 7693b0e944..a8673ce8a9 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSasl2.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSasl2.cmake
@@ -34,6 +34,8 @@ will be available:
Since 5.41.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# NOTE: libsasl2.pc doesn't export the include dir.
find_package(PkgConfig QUIET)
pkg_check_modules(PC_Sasl2 libsasl2)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSeccomp.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSeccomp.cmake
index 26b29dea3d..67b9ecb5a1 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSeccomp.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSeccomp.cmake
@@ -27,6 +27,8 @@ imported target:
Since 5.44.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_Libseccomp QUIET libseccomp)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSharedMimeInfo.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSharedMimeInfo.cmake
index 39fba66996..28d536d2e8 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSharedMimeInfo.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindSharedMimeInfo.cmake
@@ -32,6 +32,8 @@ perform this task).
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(SharedMimeInfo)
@@ -69,7 +71,7 @@ mark_as_advanced(UPDATE_MIME_DATABASE_EXECUTABLE)
function(UPDATE_XDG_MIMETYPES _path)
get_filename_component(_xdgmimeDir "${_path}" NAME)
if("${_xdgmimeDir}" STREQUAL packages )
- get_filename_component(_xdgmimeDir "${_path}" PATH)
+ get_filename_component(_xdgmimeDir "${_path}" DIRECTORY)
else()
set(_xdgmimeDir "${_path}")
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindTaglib.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindTaglib.cmake
index e3a0014fcc..dc921f27bd 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindTaglib.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindTaglib.cmake
@@ -31,6 +31,8 @@ target:
Since 5.72.0
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_TAGLIB QUIET taglib)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindUDev.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindUDev.cmake
index bab092f8a0..90e3b585b6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindUDev.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindUDev.cmake
@@ -32,6 +32,8 @@ target:
Since 5.57.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PC_UDEV QUIET libudev)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWayland.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWayland.cmake
index 926fd48552..4be45bbd89 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWayland.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWayland.cmake
@@ -56,6 +56,8 @@ package config file.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(Wayland)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandProtocols.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandProtocols.cmake
index a4449885d9..19088b4003 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandProtocols.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandProtocols.cmake
@@ -18,6 +18,8 @@ This will define the following variables:
The wayland protocols data directory
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_wayland_protocols QUIET wayland-protocols)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandScanner.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandScanner.cmake
index 2fa1fd6e8b..69760b43e3 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandScanner.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindWaylandScanner.cmake
@@ -75,6 +75,8 @@ export this code.
Since 1.4.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(WaylandScanner)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindX11_XCB.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindX11_XCB.cmake
index f571bacff4..0cd637659d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindX11_XCB.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindX11_XCB.cmake
@@ -41,6 +41,8 @@ exported library, it must be made available by the package config file.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(X11_XCB)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindXCB.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindXCB.cmake
index f18c2fd095..7ccd91b979 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindXCB.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/FindXCB.cmake
@@ -62,6 +62,8 @@ package config file.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake)
ecm_find_package_version_check(XCB)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findepoxy.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findepoxy.cmake
index 25eaf271ad..182fca9510 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findepoxy.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findepoxy.cmake
@@ -37,6 +37,8 @@ Bear in mind, however, that if the target is in the link interface of an
exported library, it must be made available by the package config file.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_epoxy QUIET epoxy)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findgzip.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findgzip.cmake
index 095c35226d..253f880f8a 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findgzip.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/find-modules/Findgzip.cmake
@@ -29,6 +29,8 @@ target:
Since 5.85.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
find_program(gzip_EXECUTABLE NAMES gzip)
include(FindPackageHandleStandardArgs)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECMakeSettings.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECMakeSettings.cmake
index 3e4ac32fe0..08cb21ad29 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECMakeSettings.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECMakeSettings.cmake
@@ -90,6 +90,10 @@ Since 5.17.0
- ``APPLE_SUPPRESS_X11_WARNING`` option since 5.14.0
- ``CMAKE_AUTORCC`` enabled by default when supported by CMake (>= 3.0) since 5.62.0
+Since 6.25.0
+
+Disable ``CMAKE_CXX_SCAN_FOR_MODULES`` by default.
+
Translations (deprecated)
~~~~~~~~~~~~~~~~~~~~~~~~~
A fetch-translations target will be set up that will download translations
@@ -112,6 +116,13 @@ All ``KDE_L10N_*`` options have been deprecated since 5.102.0, as translations
are meanwhile present inside the source code repositories.
#]=======================================================================]
+# Explicitly pushing current policies on the stack, because this module
+# by its very purpose one day might also want to set policies to the caller scope
+# and consumers be asked to include using NO_POLICY_SCOPE.
+cmake_policy(PUSH)
+
+cmake_policy(VERSION 3.16)
+
################# RPATH handling ##################################
if(NOT KDE_SKIP_RPATH_SETTINGS)
@@ -160,8 +171,6 @@ endif()
find_program(APPSTREAMCLI appstreamcli)
function(appstreamtest)
- cmake_policy(PUSH)
- cmake_policy(SET CMP0064 NEW) # enable TEST operator
if(TEST appstreamtest)
# already configured
elseif(APPSTREAMCLI)
@@ -169,7 +178,6 @@ function(appstreamtest)
else()
message(STATUS "Could not set up the appstream test. appstreamcli is missing.")
endif()
- cmake_policy(POP)
endfunction()
if(NOT KDE_SKIP_TEST_SETTINGS)
@@ -240,6 +248,12 @@ if(NOT KDE_SKIP_BUILD_SETTINGS)
# and in KDE plugins don't have a prefix.
set(CMAKE_SHARED_MODULE_PREFIX "")
+ # We use private Qt modules in various places, disable the warning about it
+ set(QT_NO_PRIVATE_MODULE_WARNING ON)
+
+ # KDE code doesn't use modules, disable module scanning to avoid unnecessary work
+ set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
+
unset(EXECUTABLE_OUTPUT_PATH)
unset(LIBRARY_OUTPUT_PATH)
unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
@@ -388,3 +402,6 @@ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/po AND NOT TARGET fetch-translations)
execute_process(${fetch_commands})
endif()
endif()
+
+# see begin
+cmake_policy(POP)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEClangFormat.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEClangFormat.cmake
index e85edb285c..b6bccaeec2 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEClangFormat.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEClangFormat.cmake
@@ -49,6 +49,8 @@ file in the directory with the following contents:
Since 5.64
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# try to find clang-format in path
find_program(KDE_CLANG_FORMAT_EXECUTABLE clang-format)
@@ -59,7 +61,7 @@ if(KDE_CLANG_FORMAT_EXECUTABLE)
file(READ ${CLANG_FORMAT_FILE} CLANG_FORMAT_CONTENTS LIMIT 1000)
string(FIND "${CLANG_FORMAT_CONTENTS}" "This file got automatically created by ECM, do not edit" matchres)
if(${matchres} EQUAL -1)
- message(WARNING "The .clang-format file already exists. Please remove it in order to use the file provided by ECM")
+ message(DEBUG "Using existing .clang-format file provided by project.")
else()
configure_file(${CMAKE_CURRENT_LIST_DIR}/clang-format.cmake ${CLANG_FORMAT_FILE} @ONLY)
endif()
@@ -108,6 +110,7 @@ function(KDE_CLANG_FORMAT)
else()
add_custom_command(TARGET clang-format
COMMAND
+ POST_BUILD
${CMAKE_COMMAND} -E echo "Could not set up the clang-format target as the clang-format executable is missing."
)
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECompilerSettings.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECompilerSettings.cmake
index 97657fb782..826750747b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECompilerSettings.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDECompilerSettings.cmake
@@ -53,6 +53,12 @@ none of the above variables will be modified.
The following CMake C++ standard default variables are set:
+For ``KDE_COMPILERSETTINGS_LEVEL`` >= 6.13:
+
+- ``CMAKE_CXX_STANDARD``: ``20``
+- ``CMAKE_CXX_STANDARD_REQUIRED``: ``TRUE``
+- ``CMAKE_CXX_EXTENSIONS``: ``OFF``
+
For ``KDE_COMPILERSETTINGS_LEVEL`` >= 5.85:
- ``CMAKE_CXX_STANDARD``: ``17``
@@ -156,6 +162,11 @@ Inclusion of this module defines the following variables:
Since 5.85
+``ECM_FORCE_ASSERTS``
+ Enable Q_ASSERT regardless of ``CMAKE_BUILD_TYPE``. Off by default.
+
+ Since 6.24
+
Example usages:
.. code-block:: cmake
@@ -207,6 +218,10 @@ Example usages:
Since pre-1.0.0.
#]=======================================================================]
+# Not setting cmake_policy, given this module is supposed to be in the same
+# policy scope as the includer (see also recommendation to use NO_POLICY_SCOPE)
+# So code here needs to be kept compatible with each new cmake version and new policies.
+
############################################################
# Select and check KDE_COMPILERSETTINGS_LEVEL
# For a specified version of KDE_COMPILERSETTINGS_LEVEL always the same set
@@ -386,7 +401,10 @@ if (NOT CMAKE_C_STANDARD)
endif()
endif()
if (NOT CMAKE_CXX_STANDARD)
- if (KDE_INTERNAL_COMPILERSETTINGS_LEVEL VERSION_GREATER_EQUAL 5.85.0)
+ if (KDE_INTERNAL_COMPILERSETTINGS_LEVEL VERSION_GREATER_EQUAL 6.13.0)
+ set(CMAKE_CXX_STANDARD 20)
+ set(CMAKE_CXX_EXTENSIONS OFF)
+ elseif (KDE_INTERNAL_COMPILERSETTINGS_LEVEL VERSION_GREATER_EQUAL 5.85.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
else()
@@ -635,6 +653,11 @@ if (MSVC)
# C4661: 'identifier' : no suitable definition provided for explicit
# template instantiation request
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4661")
+ # Enable warnings:
+ # C5249: 'bitfield' of type 'enumeration_name' has named enumerators
+ # with values that cannot be represented in the given bit field width
+ # of 'bitfield_width'.
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w35249")
if (CMAKE_CXX_STANDARD GREATER_EQUAL 11)
# Ensure __cplusplus is correct, otherwise it defaults to 199711L which isn't true
@@ -783,6 +806,11 @@ if (CMAKE_GENERATOR STREQUAL "Ninja" AND
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
+option(ECM_FORCE_ASSERTS "Enable Q_ASSERT regardless of build type" OFF)
+if (ECM_FORCE_ASSERTS)
+ add_definitions(-DQT_FORCE_ASSERTS)
+endif()
+
include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake")
include("${ECM_MODULE_DIR}/ECMCoverageOption.cmake")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerLegacySettings.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerLegacySettings.cmake
index 895291c06f..c958b75f1d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerLegacySettings.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerLegacySettings.cmake
@@ -15,6 +15,10 @@ module to get more strict settings.
Kept as is, to be removed on next backward-compatibility-breakage occasion.
#]=======================================================================]
+# Not setting cmake_policy, given this module is supposed to be in the same
+# policy scope as the includer (see also recommendation to use NO_POLICY_SCOPE)
+# So code here needs to be kept compatible with each new cmake version and new policies.
+
if (NOT CMAKE_CXX_STANDARD)
if (ECM_GLOBAL_FIND_VERSION VERSION_GREATER_EQUAL 5.84.0)
set(CMAKE_CXX_STANDARD 17)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerSettings.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerSettings.cmake
index 67bc7f357d..e6ac7f6279 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerSettings.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEFrameworkCompilerSettings.cmake
@@ -30,6 +30,10 @@ Qt-defined keywords like signals and slots will not be defined.
Since pre-1.0.0.
#]=======================================================================]
+# Not setting cmake_policy, given this module is supposed to be in the same
+# policy scope as the includer (see also recommendation to use NO_POLICY_SCOPE)
+# So code here needs to be kept compatible with each new cmake version and new policies.
+
# No-one else should be using this module, at least by the time when requiring
# ECM 5.85 as minimum, where also settings levels had been introduced for
# KDECompilerSettings to satisfy the needs for stricter out-of-the-box
@@ -50,9 +54,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
if (QT_MAJOR_VERSION EQUAL "6")
find_package(Qt6Core)
set(ENABLE_BSYMBOLICFUNCTIONS ${QT_FEATURE_reduce_relocations})
- set(CMAKE_CXX_STANDARD 20)
- set(CMAKE_CXX_EXTENSIONS OFF)
- set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
else ()
set(ENABLE_BSYMBOLICFUNCTIONS ON)
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEGitCommitHooks.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEGitCommitHooks.cmake
index 6122cc7a5c..8ab9d3bfbe 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEGitCommitHooks.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEGitCommitHooks.cmake
@@ -24,18 +24,21 @@ This function will create a pre-commit hook which contains all the given checks.
In addition to that, you can pass in paths to custom scripts that will be run as the pre-commit hook.
If a custom hooks directory is set via ``core.hooksPath``, a warning is issued.
+The created pre-commit script will also execute any custom user-provided
+scripts located in .git/hooks/pre-commit.d directory.
+
Checks:
- ``CLANG_FORMAT`` With this check enabled the ``git clang-format`` tool will be used to make sure that
the changed parts are properly formatted. In case the changes are not properly formatted an error
message with the command to preview the formatting changes and to format the files in place
- will be displayed. This tool will reuse the exsting ``.clang-format`` file, in case you
+ will be displayed. This tool will reuse the existing ``.clang-format`` file, in case you
want to use the one provided by ECM you can include ``include(KDEClangFormat)`` which will copy
the file to the source dir. It is also recommended to reformat the entire project before enforcing
the formatting using this commit hook.
- - ``JSON_SCHEMA`` Since 5.110, uses the check-jsonschema CLI tool to ensure that all files are valid JSON and
+- ``JSON_SCHEMA`` Since 5.110, uses the check-jsonschema CLI tool to ensure that all files are valid JSON and
match the KPluginMetaData spec. This only applied if the JSON file has a "KPlugin" object in its root.
- To ignore invalid files, for example for testing error handling, given files can be exlcuded in the .kde-ci.yml file
+ To ignore invalid files, for example for testing error handling, given files can be excluded in the .kde-ci.yml file
Define Options.json-validate-ignore with an array of the files you want to ignore
Example usage:
@@ -48,6 +51,8 @@ Example usage:
Since 5.79
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# try to find clang-format in path
find_program(KDE_CLANG_FORMAT_EXECUTABLE clang-format)
find_program(KDE_CHECK_JSONSCHEMA_EXECUTABLE check-jsonschema)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs.cmake
index 86c39368d9..176ca054c1 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs.cmake
@@ -11,5 +11,7 @@ Compatibility wrapper around :kde-module:`KDEInstallDirs5`.
Since 5.82.0, prior to that equivalent to :kde-module:`KDEInstallDirs5`.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/KDEInstallDirs${QT_MAJOR_VERSION}.cmake)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs5.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs5.cmake
index 31b9c59be1..66635ed6ff 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs5.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs5.cmake
@@ -186,11 +186,21 @@ deprecated counterparts) may be passed to the ``DESTINATION`` options of
``install()`` commands for the corresponding file type. They are set in the
CMake cache, and so the defaults above can be overridden by users.
-Note that the ``KDE_INSTALL_
``, ``CMAKE_INSTALL_`` or deprecated
-form of the variable can be changed using CMake command line variable
-definitions; in either case, all forms of the variable will be affected. The
-effect of passing multiple forms of the same variable on the command line
-(such as ``KDE_INSTALL_BINDIR`` and ``CMAKE_INSTALL_BINDIR`` is undefined.
+Note that if the ``KDE_INSTALL_``, ``CMAKE_INSTALL_`` or deprecated
+form of the variable are set before ``include(KDEInstallDirs)``, they won't be
+overwritten by ``KDEInstallDirs``. This is useful if you eg. want to use CMake
+command line variable definitions to set custom values. There are however some
+other implications you need to be aware of: ``GNUInstallDirs`` defines
+``CMAKE_INSTALL_`` variables, before hence ``KDEInstallDirs`` will not
+overwrite them if it is included later. In most cases this is unintended and
+if you need to include ``GNUInstallDirs`` you should always do that after after
+you included ``KDEInstallDirs``.
+
+If you set custom values to ``KDE_INSTALL_`` or ``CMAKE_INSTALL_``
+as described above always both forms of the variable will be affected.
+The effect of passing multiple forms of the same variable eg. on the command
+line (such as ``KDE_INSTALL_BINDIR`` and ``CMAKE_INSTALL_BINDIR``) is undefined
+and should be avoided.
The variable ``KDE_INSTALL_TARGETS_DEFAULT_ARGS`` is also defined (along with
the deprecated form ``INSTALL_TARGETS_DEFAULT_ARGS``). This should be used
@@ -227,6 +237,8 @@ for the prefix into a process.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/KDEInstallDirsCommon.cmake)
if(WIN32)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs6.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs6.cmake
index 034399869a..b68b8bc17c 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs6.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirs6.cmake
@@ -100,6 +100,8 @@ where ```` is one of (default values in parentheses):
documentation bundles in QCH format for Qt-extending libraries (``DATAROOTDIR/doc/qch`` or qtpaths's ``QT_INSTALL_DOCS``)
``QCHDIR``
documentation bundles in QCH format (``DATAROOTDIR/doc/qch``)
+``QTMETATYPESDIR``
+ Qt metatypes files (``metatypes`` or qtpaths's ``QT_INSTALL_ARCHDATA/metatypes``). Since 6.27.
``MANDIR``
man documentation (``DATAROOTDIR/man``)
``INFODIR``
@@ -149,11 +151,22 @@ The ``KDE_INSTALL_`` variables may be passed to the ``DESTINATION`` options
``install()`` commands for the corresponding file type. They are set in the
CMake cache, and so the defaults above can be overridden by users.
-Note that the ``KDE_INSTALL_`` or ``CMAKE_INSTALL_`` variables
-can be changed using CMake command line variable definitions; in either case,
-both forms of the variable will be affected. The effect of passing multiple
-forms of the same variable on the command line
-(such as ``KDE_INSTALL_BINDIR`` and ``CMAKE_INSTALL_BINDIR`` is undefined.
+Note that if the ``KDE_INSTALL_`` or ``CMAKE_INSTALL_`` variables are set
+before ``include(KDEInstallDirs)``, they won't be overwritten by ``KDEInstallDirs``.
+This is useful if you eg. want to use CMake command line variable definitions to
+set custom values. There are however some other implications you need to be aware of:
+``GNUInstallDirs`` defines ``CMAKE_INSTALL_`` variables, before hence
+``KDEInstallDirs`` will not overwrite them if it is included later. In most cases
+this is unintended and if you need to include ``GNUInstallDirs`` you should always do
+that after after you included ``KDEInstallDirs``. Be aware that Qt uses
+``GNUInstallDirs`` since Qt6 and hence ``find_package(Qt6 ...)`` is equivalent to
+``include(GNUInstallDirs)`` in this case.
+
+If you set custom values to ``KDE_INSTALL_`` or ``CMAKE_INSTALL_``
+as described above always both forms of the variable will be affected.
+The effect of passing multiple forms of the same variable eg. on the command
+line (such as ``KDE_INSTALL_BINDIR`` and ``CMAKE_INSTALL_BINDIR``) is undefined
+and should be avoided.
The variable ``KDE_INSTALL_TARGETS_DEFAULT_ARGS`` is also defined.
This should be used when libraries or user-executable applications are installed,
@@ -183,6 +196,8 @@ file that allows to easily incorporate the necessary environment variables
for the prefix into a process.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
set(KDE_INSTALL_DIRS_NO_DEPRECATED TRUE)
include(${CMAKE_CURRENT_LIST_DIR}/KDEInstallDirsCommon.cmake)
@@ -227,6 +242,18 @@ if(KDE_INSTALL_USE_QT_SYS_PATHS)
file(RELATIVE_PATH qt_qml_dir ${qt_install_prefix_dir} ${qt_qml_dir})
endif()
_define_absolute(QMLDIR ${qt_qml_dir} "QtQuick2 imports")
+
+ ecm_query_qt(qt_archdata_dir QT_INSTALL_ARCHDATA)
+
+ if(_qt_prefix_is_cmake_install_prefix)
+ file(RELATIVE_PATH qt_archdata_dir ${qt_install_prefix_dir} ${qt_archdata_dir})
+ endif()
+
+ if (qt_archdata_dir)
+ _define_absolute(QTMETATYPESDIR "${qt_archdata_dir}/metatypes" "Qt metatypes files")
+ else()
+ _define_non_cache(QTMETATYPESDIR "metatypes")
+ endif()
else()
set(_pluginsDirParent LIBDIR)
if (ANDROID)
@@ -238,6 +265,8 @@ else()
_define_relative(QMLDIR LIBDIR "qml"
"QtQuick2 imports")
+
+ _define_non_cache(QTMETATYPESDIR "metatypes")
endif()
_define_relative(PLUGINDIR QTPLUGINDIR ""
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirsCommon.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirsCommon.cmake
index cf266719e8..30726b7217 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirsCommon.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEInstallDirsCommon.cmake
@@ -54,6 +54,7 @@ set(_gnu_install_dirs_vars
SYSCONFDIR
SHAREDSTATEDIR
LOCALSTATEDIR
+ RUNSTATEDIR
LIBDIR
INCLUDEDIR
OLDINCLUDEDIR
@@ -88,15 +89,14 @@ macro(_define_relative varname parent subdir docstring)
if(${ARGC} GREATER 5)
set(_aliasname "${ARGV5}")
endif()
+
set(_cmakename)
if(NOT KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES)
- list(FIND _gnu_install_dirs_vars "${varname}" _list_offset)
- set(_cmakename_is_deprecated FALSE)
- if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED OR NOT _list_offset EQUAL -1)
+ # The CMake name (CMAKE_INSTALL_) is only supported for those variables
+ # defined by the GNUInstallDirs. Also in older ECM versions we supported CMAKE_INSTALL_
+ # for all variables and if deprecated behaviour is enabled we still do
+ if((${varname} IN_LIST _gnu_install_dirs_vars) OR NOT KDE_INSTALL_DIRS_NO_DEPRECATED)
set(_cmakename CMAKE_INSTALL_${varname})
- if(_list_offset EQUAL -1)
- set(_cmakename_is_deprecated TRUE)
- endif()
endif()
endif()
@@ -121,7 +121,9 @@ macro(_define_relative varname parent subdir docstring)
endif()
if(KDE_INSTALL_${varname})
+ # The name was given (eg. on the command line or in the projects CMakeLists.txt)
# make sure the cache documentation is set correctly
+
get_property(_iscached CACHE KDE_INSTALL_${varname} PROPERTY VALUE SET)
if (_iscached)
# make sure the docs are still set if it was passed on the command line
@@ -132,33 +134,51 @@ macro(_define_relative varname parent subdir docstring)
PROPERTY TYPE PATH)
endif()
elseif(${_oldstylename})
- message(DEPRECATION "${_oldstylename} is deprecated, use KDE_INSTALL_${varname} instead.")
- # The old name was given (probably on the command line): move
- # it to the new name
+ # If KDE_INSTALL_DIRS_NO_DEPRECATED is true, _oldstylename will be empty due to
+ # the logic on top of this macro, hence you will never end up here in this case
+ message(DEPRECATION "${_oldstylename} is deprecated, use KDE_INSTALL_${varname} instead.")
+ # The old name was given (probably on the command line): move it to the new name
set(KDE_INSTALL_${varname} "${${_oldstylename}}"
CACHE PATH
"${docstring} (${_docpath})"
FORCE)
elseif(${_aliasname})
- # The alias variable was given (probably on the command line): move
- # it to the new name
+ # The alias variable was given (probably on the command line): move it to the new name
set(KDE_INSTALL_${varname} "${${_aliasname}}"
CACHE PATH
"${docstring} (${_docpath})"
FORCE)
elseif(${_cmakename})
- if(_cmakename_is_deprecated)
- message(DEPRECATION "${_cmakename} is deprecated, use KDE_INSTALL_${varname} instead.")
+ # CMake name was given (eg. on the command line)
+ if(NOT ${varname} IN_LIST _gnu_install_dirs_vars)
+ # CMake name is NOT one of those defined by GNUInstallDirs. This is deprecated.
+ if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED)
+ # Deprecated behavior is enabled, so allow this anyways
+ message(DEPRECATION "${_cmakename} is deprecated, use KDE_INSTALL_${varname} instead.")
+
+ set(KDE_INSTALL_${varname} "${${_cmakename}}"
+ CACHE PATH
+ "${docstring} (${_docpath})"
+ FORCE)
+ endif()
+ else()
+ # CMake name is one of those defined by GNUInstallDirs.
+ # Note: If KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES is true, _cmakename will be empty due to
+ # the logic on top of this macro, hence you will never end up here in this case
+
+ message(WARNING "KDE_INSTALL_${varname} got its value from ${_cmakename}. In most cases this is unintended, check if you included GNUInstallDirs before KDEInstallDirs. Some third party modules include GNUInstallDirs too so eg. find_package(Qt6 ...) is equivalent to include(GNUInstallDirs). If you set ${_cmakename} deliberately before including KDEInstallDirs its recommended to use KDE_INSTALL_${varname} instead to suppress this message.")
+
+ # The CMAKE_ name was given (probably on the command line): move it to the new name
+ set(KDE_INSTALL_${varname} "${${_cmakename}}"
+ CACHE PATH
+ "${docstring} (${_docpath})"
+ FORCE)
endif()
- # The CMAKE_ name was given (probably on the command line): move
- # it to the new name
- set(KDE_INSTALL_${varname} "${${_cmakename}}"
- CACHE PATH
- "${docstring} (${_docpath})"
- FORCE)
- else()
- # insert an empty value into the cache, indicating the default
- # should be used (including compatibility vars above)
+ endif()
+
+ if(NOT KDE_INSTALL_${varname})
+ # KDE_INSTALL_${varname} has not been set yet elsewhere so insert an empty value
+ # into the cache, indicating the default should be used (including compatibility vars above)
set(KDE_INSTALL_${varname} ""
CACHE PATH "${docstring} (${_docpath})")
set(KDE_INSTALL_${varname} "${_realpath}")
@@ -210,8 +230,7 @@ macro(_define_non_cache varname value)
endif()
if(NOT KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES)
- list(FIND _gnu_install_dirs_vars "${varname}" _list_offset)
- if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED OR NOT _list_offset EQUAL -1)
+ if(NOT KDE_INSTALL_DIRS_NO_DEPRECATED OR (${varname} IN_LIST _gnu_install_dirs_vars))
set(CMAKE_INSTALL_${varname} "${KDE_INSTALL_${varname}}")
set(CMAKE_INSTALL_FULL_${varname} "${KDE_INSTALL_FULL_${varname}}")
endif()
@@ -261,7 +280,12 @@ _define_absolute(INCLUDEDIR "include"
"C and C++ header files"
INCLUDE_INSTALL_DIR)
-_define_absolute(LOCALSTATEDIR "var"
+set(_default_localstate_dir "var")
+if (CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+ set(_default_localstate_dir "/var")
+endif()
+
+_define_absolute(LOCALSTATEDIR ${_default_localstate_dir}
"modifiable single-machine data")
_define_absolute(SHAREDSTATEDIR "com"
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEMetaInfoPlatformCheck.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEMetaInfoPlatformCheck.cmake
index 7e354ddc25..9d38ad864f 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEMetaInfoPlatformCheck.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEMetaInfoPlatformCheck.cmake
@@ -18,6 +18,8 @@ The check can be ignored by setting ``KF_IGNORE_PLATFORM_CHECK`` to ``ON``.
Since 5.93
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
option(KF_IGNORE_PLATFORM_CHECK "Ignore the supported platform check against metainfo.yaml" OFF)
if ("$ENV{KF_IGNORE_PLATFORM_CHECK}" STREQUAL "ON")
message(WARNING "KF_IGNORE_PLATFORM_CHECK set to ON from the environment")
@@ -74,6 +76,6 @@ if (NOT "${KF_IGNORE_PLATFORM_CHECK}")
endforeach()
if (NOT _MetainfoFoundSupportedPlatform)
- message(FATAL_ERROR "Your current platform '${CMAKE_SYSTEM_NAME}' is not supported. The list of supported platorms is '${_MetainfoSupportedPlatforms}'.If you think this is a mistake or you are working on enabling the platform please build with the KF_IGNORE_PLATFORM_CHECK variable set to true")
+ message(FATAL_ERROR "Your current platform '${CMAKE_SYSTEM_NAME}' is not supported. The list of supported platforms is '${_MetainfoSupportedPlatforms}'.If you think this is a mistake or you are working on enabling the platform please build with the KF_IGNORE_PLATFORM_CHECK variable set to true")
endif()
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEPackageAppTemplates.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEPackageAppTemplates.cmake
index e6ba4086fe..76508b319a 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEPackageAppTemplates.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDEPackageAppTemplates.cmake
@@ -64,14 +64,26 @@ Deprecated:
Multiple templates can be passed at once.
-This function does nothing when cross-compiling.
+Unless setting KDE_INSTALL_APP_TEMPLATES, this function is skipped when cross-compiling.
Since 5.18
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
+include(KDEInstallDirs)
+
+if(NOT CMAKE_CROSSCOMPILING)
+ set(default_kde_install_app_templates ON)
+else()
+ set(default_kde_install_app_templates OFF)
+endif()
+
+option(KDE_INSTALL_APP_TEMPLATES "Skip installation of KAppTemplate/KDevelop compatible application templates" ${default_kde_install_app_templates})
+
function(kde_package_app_templates)
- if (CMAKE_CROSSCOMPILING)
+ if (NOT KDE_INSTALL_APP_TEMPLATES)
return()
endif()
@@ -110,7 +122,7 @@ function(kde_package_app_templates)
foreach(_templateName ${ARG_TEMPLATES})
get_filename_component(_tmp_file ${_templateName} ABSOLUTE)
get_filename_component(_baseName ${_tmp_file} NAME_WE)
- set(_template ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.tar.bz2)
+ set(_template ${CMAKE_BINARY_DIR}/${KDE_INSTALL_KAPPTEMPLATESDIR}/${_baseName}.tar.bz2)
# also enlist directories as deps to catch file removals
file(GLOB_RECURSE _subdirs_entries LIST_DIRECTORIES true CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${_templateName}/*")
@@ -130,6 +142,7 @@ function(kde_package_app_templates)
# Make tar archive reproducible, the arguments are only available with GNU tar
add_custom_command(OUTPUT ${_template}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${KDE_INSTALL_KAPPTEMPLATESDIR}
COMMAND ${_tar_executable} ARGS
--exclude .kdev_ignore --exclude .svn
--sort=name
@@ -143,6 +156,7 @@ function(kde_package_app_templates)
)
else()
add_custom_command(OUTPUT ${_template}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${KDE_INSTALL_KAPPTEMPLATESDIR}
COMMAND ${CMAKE_COMMAND} -E tar "cvfj" ${_template} .
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_templateName}
DEPENDS ${_subdirs_entries}
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDESetupPrefixScript.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDESetupPrefixScript.cmake
index b2bae93b29..a1cc261a24 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDESetupPrefixScript.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/KDESetupPrefixScript.cmake
@@ -15,6 +15,15 @@ if (CMAKE_CROSSCOMPILING)
return()
endif()
+find_package(Python3 COMPONENTS Interpreter)
+if (Python3_EXECUTABLE)
+ execute_process(COMMAND ${Python3_EXECUTABLE} -Esc "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '${CMAKE_INSTALL_PREFIX}', 'base': '${CMAKE_INSTALL_PREFIX}'}))" OUTPUT_VARIABLE sysconfig_output)
+ string(STRIP ${sysconfig_output} PYTHON_INSTALL_DIR)
+
+ set(SH_EXPORT_PYTHONPATH "export PYTHONPATH=\"${PYTHON_INSTALL_DIR}\":$PYTHONPATH")
+ set(FISH_EXPORT_PYTHONPATH "set -x --path PYTHONPATH \"${PYTHON_INSTALL_DIR}\" $PYTHONPATH")
+endif()
+
configure_file(${CMAKE_CURRENT_LIST_DIR}/prefix.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/prefix.sh @ONLY)
find_program(FISH_EXECUTABLE fish)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/appstreamtest.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/appstreamtest.cmake
index 02fd02ca53..7eb0a1d8e5 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/appstreamtest.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/appstreamtest.cmake
@@ -1,3 +1,5 @@
+cmake_policy(VERSION 3.16)
+
file(GLOB install_done "${INSTALL_FILES}")
if (install_done)
file(READ "${INSTALL_FILES}" out)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/clang-format.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/clang-format.cmake
index bb67ea6844..9b5ae0af2d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/clang-format.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/clang-format.cmake
@@ -12,6 +12,10 @@
Language: JavaScript
DisableFormat: true
---
+Language: Json
+DisableFormat: false
+IndentWidth: 4
+---
# Style for C++
Language: Cpp
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/kde-git-commit-hooks/pre-commit.in b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/kde-git-commit-hooks/pre-commit.in
index 6db4187f4d..c4e5954ed1 100755
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/kde-git-commit-hooks/pre-commit.in
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/kde-git-commit-hooks/pre-commit.in
@@ -1,3 +1,25 @@
#!/usr/bin/env bash
${PRE_COMMIT_SCRIPTS}
+
+RESULT=$?
+if [ $RESULT != 0 ]; then
+ exit $RESULT
+fi
+
+# If the user has custom commit hooks defined in pre-commit.d directory,
+# execute them
+PRE_COMMIT_D_DIR="$(dirname "$0")/pre-commit.d/"
+
+if [ -d "$PRE_COMMIT_D_DIR" ]; then
+ for PRE_COMMIT_D_HOOK in "$PRE_COMMIT_D_DIR"/*; do
+ ./"$PRE_COMMIT_D_HOOK"
+ RESULT=$?
+ if [ $RESULT != 0 ]; then
+ echo "$PRE_COMMIT_D_HOOK returned non-zero: $RESULT, commit aborted"
+ exit $RESULT
+ fi
+ done
+fi
+
+exit 0
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.cmake
index 43b41e9f7f..2d75471a95 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.cmake
@@ -14,3 +14,5 @@ export QT_QUICK_CONTROLS_STYLE_PATH=@KDE_INSTALL_FULL_QMLDIR@/QtQuick/Controls.2
export MANPATH=@KDE_INSTALL_FULL_DATADIR@/man:${MANPATH:-/usr/local/share/man:/usr/share/man}
export SASL_PATH=@KDE_INSTALL_FULL_LIBDIR@/sasl2:${SASL_PATH:-/usr/@CMAKE_INSTALL_LIBDIR@/sasl2}
+
+@SH_EXPORT_PYTHONPATH@
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.fish.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.fish.cmake
index d59c1b87ea..3cb4c4a0c2 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.fish.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/kde-modules/prefix.sh.fish.cmake
@@ -20,3 +20,5 @@ set -x --path QT_PLUGIN_PATH "@KDE_INSTALL_FULL_QTPLUGINDIR@" $QT_PLUGIN_PATH
set -x --path QML2_IMPORT_PATH "@KDE_INSTALL_FULL_QMLDIR@" $QML2_IMPORT_PATH
set -x --path QT_QUICK_CONTROLS_STYLE_PATH "@KDE_INSTALL_FULL_QMLDIR@/QtQuick/Controls.2/" $QT_QUICK_CONTROLS_STYLE_PATH
+
+@FISH_EXPORT_PYTHONPATH@
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/CheckAtomic.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/CheckAtomic.cmake
index d154b11777..29e4aee6b0 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/CheckAtomic.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/CheckAtomic.cmake
@@ -14,6 +14,8 @@ std:atomic.
Since 5.75.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(CheckCXXSourceCompiles)
include(CheckLibraryExists)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAndroidApk.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAndroidApk.cmake
index 17fcc97049..a47033016f 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAndroidApk.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAndroidApk.cmake
@@ -47,8 +47,32 @@ The following variables impact the behavior:
This allows to separate e.g. development files from what ends up in the APK.
Since 6.0.0
+
+For automatically deriving APK versions from CMake this creates a ``ecm-version.gradle``
+file which defines the following variables:
+``ecmVersionName``: Set to ``PROJECT_VERSION``
+``ecmVersionCode``: Derived from the current time in local builds, and from ``CI_PIPELINE_CREATED_AT``
+ in builds from Gitlab pipelines. This ensures a strictly increasing version code as well as
+ synchronized version codes for APKs of multiple architectures when build in a Gitlab pipeline.
+
+This can be included by calling ``apply from: '../ecm-version.gradle'`` in the project's ``build.gradle``
+file and is typically used in manifest placeholders:
+
+```
+defaultConfig {
+ versionName ecmVersionName
+ versionCode ecmVersionCode
+ manifestPlaceholders = [versionName: ecmVersionName, versionCode: ecmVersionCode]
+ ...
+}
+```
+
+Since 6.12.0
+
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# make ExecuteCoreModules test pass on Qt5
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
if (QT_MAJOR_VERSION EQUAL 5)
@@ -69,12 +93,22 @@ function (ecm_add_android_apk TARGET)
return()
endif()
+ # F-Droid assumes that APKs of different versions have different filenames;
+ # therefore, on CI we add the CI_PIPELINE_CREATED_AT timestamp to the APK filename
+ set(APK_NAME_TIMESTAMP "")
+ if (DEFINED ENV{CI_PIPELINE_CREATED_AT})
+ # remove all non-digits from an ISO 8601 formatted timestamp like 2025-05-21T16:00:54Z
+ string(REGEX REPLACE "^([0-9]+)-([0-9]+)-([0-9]+)T([0-9]+):([0-9]+):([0-9]+).*$" "-\\1\\2\\3\\4\\5\\6" APK_NAME_TIMESTAMP "$ENV{CI_PIPELINE_CREATED_AT}")
+ endif()
+
+ configure_file(${_ECM_TOOLCHAIN_DIR}/ecm-version.gradle.in ${CMAKE_BINARY_DIR}/ecm-version.gradle)
+
set(APK_NAME "${TARGET}")
if (ARGS_PACKAGE_NAME)
set(APK_NAME "${ARGS_PACKAGE_NAME}")
endif()
- set(APK_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${TARGET}_build_apk/")
+ set(APK_OUTPUT_DIR "${CMAKE_BINARY_DIR}/${APK_NAME}_build_apk/")
set(APK_EXECUTABLE_PATH "${APK_OUTPUT_DIR}/libs/${CMAKE_ANDROID_ARCH_ABI}/lib${APK_NAME}_${CMAKE_ANDROID_ARCH_ABI}.so")
set(QML_IMPORT_PATHS "")
@@ -151,7 +185,7 @@ function (ecm_add_android_apk TARGET)
file(WRITE ${CMAKE_BINARY_DIR}/ranlib "${CMAKE_RANLIB}")
set(CREATEAPK_TARGET_NAME "create-apk-${APK_NAME}")
- set(APK_NAME_FULL "${APK_NAME}-${CMAKE_ANDROID_ARCH_ABI}.apk")
+ set(APK_NAME_FULL "${APK_NAME}${APK_NAME_TIMESTAMP}-${CMAKE_ANDROID_ARCH_ABI}.apk")
add_custom_target(${CREATEAPK_TARGET_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "Generating ${APK_NAME_FULL} with $"
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAppIcon.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAppIcon.cmake
index 30f59bebea..8b6ba4c337 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAppIcon.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddAppIcon.cmake
@@ -83,6 +83,8 @@ macOS notes
Since 1.7.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ecm_add_app_icon appsources_or_target)
set(options)
set(oneValueArgs OUTFILE_BASENAME)
@@ -368,7 +370,7 @@ macro(_ecm_add_app_icon_categorize_icons icons type known_sizes)
if (offset GREATER -1)
list(APPEND ${type}_at_${size}px "${icon_full}")
- elseif()
+ else()
message(STATUS "not found ${type}_at_${size}px ${icon_full}")
endif()
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQch.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQch.cmake
index 4f5261a995..85b4fd8e68 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQch.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQch.cmake
@@ -256,6 +256,8 @@ Example usage:
Since 5.36.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake)
include(ECMQueryQt)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQtDesignerPlugin.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQtDesignerPlugin.cmake
index d847e66cc9..3123088ec9 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQtDesignerPlugin.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddQtDesignerPlugin.cmake
@@ -178,6 +178,8 @@ Example usage:
Since 5.62.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(FeatureSummary)
include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddTests.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddTests.cmake
index 47a4d5c135..ce0586f0d0 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddTests.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMAddTests.cmake
@@ -1,5 +1,6 @@
# SPDX-FileCopyrightText: 2013 Alexander Richardson
# SPDX-FileCopyrightText: 2015 Alex Merry
+# SPDX-FileCopyrightText: 2025 Friedrich W. H. Kossebau
#
# SPDX-License-Identifier: BSD-3-Clause
@@ -12,8 +13,10 @@ Convenience functions for adding tests.
::
ecm_add_tests(
+ [COMPILE_DEFINITIONS [ [...]]] # Since 6.13.0
+ [ENVIRONMENT ] # Since 6.13.0
LINK_LIBRARIES [ [...]]
- [NAME_PREFIX ]
+ [NAME_PREFIX (| NO_NAME_PREFIX] # Since 6.22.0)
[GUI]
[TARGET_NAMES_VAR ]
[TEST_NAMES_VAR ]
@@ -21,15 +24,20 @@ Convenience functions for adding tests.
)
A convenience function for adding multiple tests, each consisting of a
-single source file. For each file in , an executable target will be
-created (the name of which will be the basename of the source file). This
-will be linked against the libraries given with ``LINK_LIBRARIES``. Each
-executable will be added as a test with the same name.
+single source file. For each file in , an executable target is
+created (whose name is the base name of the source file) with the compiler
+definitions passed with ``COMPILE_DEFINITIONS``. This will be linked
+against the libraries given with ``LINK_LIBRARIES``. Each executable will
+be added as a test with the same name and can have an environment provided
+by ``ENVIRONMENT``.
If ``NAME_PREFIX`` is given, this prefix will be prepended to the test names, but
not the target names. As a result, it will not prevent clashes between tests
with the same name in different parts of the project, but it can be used to
give an indication of where to look for a failing test.
+If ``NAME_PREFIX`` is not set, it will default to a value depending on the
+strategy as controlled by the variable ``ECM_TEST_NAME_PREFIX_STRATEGY``, if
+set in the current scope and ``NO_NAME_PREFIX`` is not set (since 6.22).
If the flag ``GUI`` is passed the test binaries will be GUI executables, otherwise
the resulting binaries will be console applications (regardless of the value
@@ -58,17 +66,31 @@ generator expressions. Since 5.111.
ecm_add_test(
+ [COMPILE_DEFINITIONS [ [...]]] # Since 6.13.0
+ [ENVIRONMENT ] # Since 6.13.0
LINK_LIBRARIES [ [...]]
[TEST_NAME ]
- [NAME_PREFIX ]
+ [NAME_PREFIX (| NO_NAME_PREFIX] # Since 6.22.0)
[GUI]
+ [TARGET_NAME_VAR ]
+ [TEST_NAME_VAR ]
[WORKING_DIRECTORY ] # Since 5.111
)
This is a single-test form of ``ecm_add_tests`` that allows multiple source files
to be used for a single test. If using multiple source files, ``TEST_NAME`` must
-be given; this will be used for both the target and test names (and, as with
-``ecm_add_tests()``, the ``NAME_PREFIX`` argument will be prepended to the test name).
+be given; this will be used for both the target and test names.
+
+As with ``ecm_add_tests()``, the ``NAME_PREFIX`` argument will be prepended to
+the test name.
+If ``NAME_PREFIX`` is not set, it will default to a value depending on the
+strategy as controlled by the variable ``ECM_TEST_NAME_PREFIX_STRATEGY``, if
+set in the current scope and ``NO_NAME_PREFIX`` is not set (since 6.22).
+
+The ``TARGET_NAME_VAR`` and ``TEST_NAME_VAR`` arguments, if given, should specify a
+variable name to receive the generated target and test name,
+respectively. This makes it convenient to apply properties to them as a
+whole, for example, using ``set_target_properties()`` or ``set_tests_properties()``.
``WORKING_DIRECTORY`` sets the test property `WORKING_DIRECTORY
`_
@@ -76,18 +98,259 @@ in which to execute the test. By default the test will be run in
``${CMAKE_CURRENT_BINARY_DIR}``. The working directory can be specified using
generator expressions. Since 5.111.
+::
+
+ ecm_test_set_dir_properties( # Since 6.22.0
+ [DIR ]
+ [PREFIX_NAME ]
+ [PREFIX_NAME_IGNORE | PREFIX_NAME_NOT_IGNORE]
+ [FIRST_PREFIX_NAME]
+ [LAST_PREFIX_NAME]
+ )
+
+
+The function can be used to set properties to individual directories to
+influence the behaviour of the test functions. The properties will be set to
+the current source directory. For source directories which themselves do not
+have a CMakeLists.txt file and thus are not added by any `add_subdirectory()
+`_ calls,
+the ``DIR`` argument can be used to instead set the property to any such
+subdirectory ````.
+
+``PREFIX_NAME`` can be used to override by ```` the name derived from
+the given directory.
+
+``PREFIX_NAME_IGNORE`` or ``PREFIX_NAME_NOT_IGNORE`` can be used to override
+the filtering done by ``ECM_TEST_NAME_PREFIX_IGNORE_DIRS`` for the name of the
+given directory.
+
+``FIRST_PREFIX_NAME`` and ``LAST_PREFIX_NAME`` can be used to limit the range
+of directories in the path used for deriving the prefix name.
+
+::
+
+ ecm_test_get_name_prefix( # Since 6.22.0
+
+ )
+
+The ``name_prefix_var`` argument should specify a variable name to receive the
+default test prefix name for the current scope, based on
+the value of ``ECM_TEST_NAME_PREFIX_STRATEGY`` and the respective further setup.
+
+::
+
+ ECM_TEST_NAME_PREFIX_STRATEGY # Since 6.22.0
+
+This variable is specifying the strategy to use when estimating the default
+test name prefix to use by the macros ``ecm_add_tests()`` and ``ecm_add_test()``
+when no explicit ``NAME_PREFIX`` argument is passed. The supported values are:
+
+ * ``VARIABLE``: The default name prefix is taken from the value of the variable
+ ``ECM_TEST_NAME_PREFIX`` in the scope where the macros are called.
+
+ * ``PATH``: The default name prefix is derived from the relative path of the
+ current source directory where the macros are called, by replacing the
+ dir separators with "-".
+ See also ``ECM_TEST_NAME_PREFIX_IGNORE_DIRS`` for skipping some directory names.
+
+When unset, the ``VARIABLE`` strategy is used.
+
+::
+
+ ECM_TEST_NAME_PREFIX # Since 6.22.0
+
+When ``ECM_TEST_NAME_PREFIX_STRATEGY`` is set to ``VARIABLE``,
+the current value of the variable is used as default for the test name prefix.
+
+::
+
+ ECM_TEST_NAME_PREFIX_IGNORE_DIRS # Since 6.22.0
+
+When ``ECM_TEST_NAME_PREFIX_STRATEGY`` is set to ``PATH``, this variable is used
+to filter out directory names in the relative path of the current source directory
+when deriving the name prefix. By default the variable is set to
+"src", "test", "tests", "autotest", "autotests" when including the ``ECMAddTest`` module,
+if not already defined.
+
+
+Example usage:
+
+.. code-block:: cmake
+
+ set(ECM_TEST_NAME_PREFIX_STRATEGY "PATH")
+ list(APPEND ECM_TEST_NAME_PREFIX_IGNORE_DIRS "plugins")
+
+ # Being in subdir "src/plugins/foo" this test will get
+ # the test name prefix set to "foo-", next to base name "mytest":
+ ecm_add_test(
+ mytest.cpp
+ LINK_LIBRARIES mylib
+ )
+
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(ECMMarkAsTest)
include(ECMMarkNonGuiExecutable)
+# set variable on the include scope, as consumers are supposed to have access to it
+if(NOT DEFINED ECM_TEST_NAME_PREFIX_IGNORE_DIRS)
+ set(ECM_TEST_NAME_PREFIX_IGNORE_DIRS "src" "test" "tests" "autotest" "autotests")
+endif()
+
+function(_ecm_test_name_prefix_from_project_path _name_prefix_varname)
+ # estimate names of chain of dirs of current source dir to main dir
+ file(RELATIVE_PATH _project_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
+
+ if(_project_path MATCHES "^\\.\\./")
+ message(FATAL_ERROR "The PATH strategy can not be used with directories outside the root source dir.")
+ endif()
+
+ string(REPLACE "/" ";" _dirs ${_project_path})
+
+ # derive prefix names
+ set(_names)
+ set(_subpath ${CMAKE_SOURCE_DIR})
+ set(_lastcmakesubpath ${_subpath}) # path of current including CMakeLists.txt
+ set(_relativelastcmakesubpath)
+ get_directory_property(_cmakesubdirs DIRECTORY ${_lastcmakesubpath} "SUBDIRECTORIES")
+ foreach(_dir ${_dirs})
+ string(APPEND _subpath "/${_dir}")
+
+ # subdir with CMakeLists.txt?
+ if(_subpath IN_LIST _cmakesubdirs)
+ set(_lastcmakesubpath ${_subpath})
+ set(_relativelastcmakesubpath)
+ set(_property_name_suffix)
+ # prepare nexs subdir
+ get_directory_property(_cmakesubdirs DIRECTORY ${_lastcmakesubpath} "SUBDIRECTORIES")
+ else()
+ string(APPEND _relativelastcmakesubpath "/${_dir}")
+ # keep in sync with writing the properties in ecm_test_set_dir_properties
+ string(SHA1 _relativelastcmakesubpath_hash ${_relativelastcmakesubpath})
+ set(_property_name_suffix ":${_relativelastcmakesubpath_hash}")
+ endif()
+
+ get_directory_property(_substitute_name DIRECTORY ${_lastcmakesubpath} "ECM_TEST_NAME_PREFIX_DIR_NAME${_property_name_suffix}")
+
+ get_directory_property(_first_name DIRECTORY ${_lastcmakesubpath} "ECM_TEST_NAME_PREFIX_DIR_FIRST${_property_name_suffix}")
+
+ if(_first_name)
+ # drop any current names
+ set(_names)
+ endif()
+
+ if (_substitute_name)
+ list(APPEND _names ${_substitute_name})
+ else()
+ get_directory_property(_ignore_dir DIRECTORY ${_lastcmakesubpath} "ECM_TEST_NAME_PREFIX_DIR_IGNORE${_property_name_suffix}")
+ if (_ignore_dir STREQUAL "")
+ if(_dir IN_LIST ECM_TEST_NAME_PREFIX_IGNORE_DIRS)
+ set(_ignore_dir TRUE)
+ else()
+ set(_ignore_dir FALSE)
+ endif()
+ endif()
+ if(NOT _ignore_dir)
+ list(APPEND _names ${_dir})
+ endif()
+ endif()
+
+ get_directory_property(_last_name DIRECTORY ${_lastcmakesubpath} "ECM_TEST_NAME_PREFIX_DIR_LAST${_property_name_suffix}")
+ if(_last_name)
+ # finish estimating prefix names
+ break()
+ endif()
+ endforeach()
+
+ # create final prefix name
+ string(JOIN "-" _name_prefix ${_names})
+ if (_name_prefix)
+ string(APPEND _name_prefix "-")
+ endif()
+
+ set(${_name_prefix_varname} ${_name_prefix} PARENT_SCOPE)
+endfunction()
+
+function(ecm_test_set_dir_properties)
+ set(options PREFIX_NAME_IGNORE PREFIX_NAME_NOT_IGNORE FIRST_PREFIX_NAME LAST_PREFIX_NAME)
+ set(oneValueArgs PREFIX_NAME DIR)
+ set(multiValueArgs)
+ cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if(ARG_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "Unknown keywords given to ECM_TEST_SET_DIR_PROPERTIES(): \"${ARG_UNPARSED_ARGUMENTS}\"")
+ endif()
+ if(ARG_PREFIX_NAME_IGNORE AND ARG_PREFIX_NAME_NOT_IGNORE)
+ message(FATAL_ERROR "Pass either PREFIX_NAME_IGNORE or PREFIX_NAME_NOT_IGNORE to ECM_TEST_SET_DIR_PROPERTIES.")
+ endif()
+ set(_subdir)
+ if(ARG_DIR)
+ get_filename_component(_subdir ${ARG_DIR} REALPATH)
+ if(NOT IS_DIRECTORY "${_subdir}")
+ message(FATAL_ERROR "DIR argument passed to ECM_TEST_SET_DIR_PROPERTIES is not a directory: \"${ARG_DIR}\"")
+ endif()
+ if (_subdir STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+ set(_subdir)
+ else()
+ file(RELATIVE_PATH _subdir ${CMAKE_CURRENT_SOURCE_DIR} ${_subdir})
+ if(_subdir MATCHES "^\\.\\./")
+ message(FATAL_ERROR "DIR argument passed to ECM_TEST_SET_DIR_PROPERTIES is not a subdirectory: \"${ARG_DIR}\"")
+ endif()
+ endif()
+ endif()
+
+ if(_subdir)
+ # map to a hash, as cmake does not specify allowed property characters
+ # keep in sync with reading the properties in _ecm_test_name_prefix_from_project_path
+ string(SHA1 _subdir_hash "/${_subdir}")
+ set(_property_name_suffix ":${_subdir_hash}")
+ else()
+ set(_property_name_suffix)
+ endif()
+
+ if (ARG_PREFIX_NAME)
+ set_directory_properties(PROPERTIES "ECM_TEST_NAME_PREFIX_DIR_NAME${_property_name_suffix}" "${ARG_PREFIX_NAME}")
+ endif()
+ if (ARG_PREFIX_NAME_IGNORE)
+ set_directory_properties(PROPERTIES "ECM_TEST_NAME_PREFIX_DIR_IGNORE${_property_name_suffix}" "TRUE")
+ endif()
+ if (ARG_PREFIX_NAME_NOT_IGNORE)
+ set_directory_properties(PROPERTIES "ECM_TEST_NAME_PREFIX_DIR_IGNORE${_property_name_suffix}" "FALSE")
+ endif()
+ if (ARG_FIRST_PREFIX_NAME)
+ set_directory_properties(PROPERTIES "ECM_TEST_NAME_PREFIX_DIR_FIRST${_property_name_suffix}" "TRUE")
+ endif()
+ if (ARG_LAST_PREFIX_NAME)
+ set_directory_properties(PROPERTIES "ECM_TEST_NAME_PREFIX_DIR_LAST${_property_name_suffix}" "TRUE")
+ endif()
+endfunction()
+
+function(ecm_test_get_name_prefix _name_prefix_varname)
+ if(NOT ECM_TEST_NAME_PREFIX_STRATEGY)
+ set(_strategy "VARIABLE")
+ else()
+ set(_strategies "VARIABLE" "PATH")
+ if (NOT ECM_TEST_NAME_PREFIX_STRATEGY IN_LIST _strategies)
+ message(FATAL_ERROR "ECM_TEST_NAME_PREFIX_STRATEGY set to unknown value ${ECM_TEST_NAME_PREFIX_STRATEGY}")
+ endif()
+ set(_strategy ${ECM_TEST_NAME_PREFIX_STRATEGY})
+ endif()
+
+ if (${_strategy} STREQUAL "PATH")
+ _ecm_test_name_prefix_from_project_path(_name_prefix)
+ else()
+ set(_name_prefix ${ECM_TEST_NAME_PREFIX})
+ endif()
+ set(${_name_prefix_varname} ${_name_prefix} PARENT_SCOPE)
+endfunction()
+
function(ecm_add_test)
- set(options GUI)
- # TARGET_NAME_VAR and TEST_NAME_VAR are undocumented args used by
- # ecm_add_tests
+ set(options GUI NO_NAME_PREFIX)
set(oneValueArgs TEST_NAME NAME_PREFIX TARGET_NAME_VAR TEST_NAME_VAR WORKING_DIRECTORY)
- set(multiValueArgs LINK_LIBRARIES)
+ set(multiValueArgs COMPILE_DEFINITIONS ENVIRONMENT LINK_LIBRARIES)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(_sources ${ARG_UNPARSED_ARGUMENTS})
list(LENGTH _sources _sourceCount)
@@ -101,6 +364,15 @@ function(ecm_add_test)
message(FATAL_ERROR "ecm_add_test() called with multiple source files but without setting \"TEST_NAME\"")
endif()
+ if (NOT ARG_NAME_PREFIX)
+ if(NOT ARG_NO_NAME_PREFIX)
+ ecm_test_get_name_prefix(ARG_NAME_PREFIX)
+ endif()
+ else()
+ if(ARG_NO_NAME_PREFIX)
+ message(FATAL_ERROR "ecm_add_test() called with both \"NO_NAME_PREFIX\" and \"NAME_PREFIX\"")
+ endif()
+ endif()
set(_testname ${ARG_NAME_PREFIX}${_targetname})
set(gui_args)
if(ARG_GUI)
@@ -116,7 +388,7 @@ function(ecm_add_test)
endif()
add_test(NAME ${_testname} COMMAND ${_targetname} ${test_args})
target_link_libraries(${_targetname} ${ARG_LINK_LIBRARIES})
- target_compile_definitions(${_targetname} PRIVATE -DQT_FORCE_ASSERTS)
+ target_compile_definitions(${_targetname} PRIVATE -DQT_FORCE_ASSERTS ${ARG_COMPILE_DEFINITIONS})
ecm_mark_as_test(${_targetname})
if (CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(_plugin_path ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
@@ -129,7 +401,11 @@ function(ecm_add_test)
endif()
set(_plugin_path "${_plugin_path}${PATHSEP}$ENV{QT_PLUGIN_PATH}")
endif()
- set_property(TEST ${_testname} PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${_plugin_path}")
+ list(APPEND ARG_ENVIRONMENT "QT_PLUGIN_PATH=${_plugin_path}")
+ endif()
+ if (ARG_ENVIRONMENT)
+ list(JOIN ARG_ENVIRONMENT ";" env)
+ set_property(TEST ${_testname} PROPERTY ENVIRONMENT "${env}")
endif()
if (ARG_TARGET_NAME_VAR)
set(${ARG_TARGET_NAME_VAR} "${_targetname}" PARENT_SCOPE)
@@ -140,10 +416,20 @@ function(ecm_add_test)
endfunction()
function(ecm_add_tests)
- set(options GUI)
+ set(options GUI NO_NAME_PREFIX)
set(oneValueArgs NAME_PREFIX TARGET_NAMES_VAR TEST_NAMES_VAR WORKING_DIRECTORY)
- set(multiValueArgs LINK_LIBRARIES)
+ set(multiValueArgs COMPILE_DEFINITIONS ENVIRONMENT LINK_LIBRARIES)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ set(_name_prefix "")
+ if(ARG_NO_NAME_PREFIX)
+ if(ARG_NAME_PREFIX)
+ message(FATAL_ERROR "ecm_add_tests() called with both \"NO_NAME_PREFIX\" and \"NAME_PREFIX\"")
+ endif()
+ elseif(ARG_NAME_PREFIX)
+ set(_name_prefix "NAME_PREFIX" "${ARG_NAME_PREFIX}")
+ endif()
+
if(ARG_GUI)
set(_exe_type GUI)
else()
@@ -157,7 +443,9 @@ function(ecm_add_tests)
set(target_names)
foreach(_test_source ${ARG_UNPARSED_ARGUMENTS})
ecm_add_test(${_test_source}
- NAME_PREFIX ${ARG_NAME_PREFIX}
+ ${_name_prefix}
+ COMPILE_DEFINITIONS ${ARG_COMPILE_DEFINITIONS}
+ ENVIRONMENT ${ARG_ENVIRONMENT}
LINK_LIBRARIES ${ARG_LINK_LIBRARIES}
TARGET_NAME_VAR target_name
TEST_NAME_VAR test_name
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCheckOutboundLicense.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCheckOutboundLicense.cmake
index 204d5ec7fb..cf775bdea3 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCheckOutboundLicense.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCheckOutboundLicense.cmake
@@ -65,6 +65,8 @@ the CMake ``GLOB`` argument of the ``FILE`` function.
Since 5.75.0
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(FeatureSummary)
option(SKIP_LICENSE_TESTS "Skip outbound license tests" OFF)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMConfiguredInstall.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMConfiguredInstall.cmake
index 2b40450507..afc8359272 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMConfiguredInstall.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMConfiguredInstall.cmake
@@ -31,6 +31,8 @@ This will install the file as foo.txt with any cmake variable replacements made
Since 5.73.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ecm_install_configured_files)
set(options COPYONLY ESCAPE_QUOTES @ONLY)
set(oneValueArgs DESTINATION COMPONENT)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCoverageOption.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCoverageOption.cmake
index 30b2c82a54..fef7e2df98 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCoverageOption.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCoverageOption.cmake
@@ -22,6 +22,8 @@ links against ``libgcov``.
Since 1.3.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
option(BUILD_COVERAGE "Build the project with gcov support" OFF)
if(BUILD_COVERAGE)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCreateQmFromPoFiles.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCreateQmFromPoFiles.cmake
index 98e656d31a..0b4b690aa4 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCreateQmFromPoFiles.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMCreateQmFromPoFiles.cmake
@@ -76,6 +76,8 @@ been installed by ecm_create_qm_from_po_files(), and compiles it into ``mylib``.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
message(AUTHOR_WARNING "ECMCreateQmFromPoFiles is deprecated and will be removed before the release of Extra CMake Modules 1.0. Use ECMPoQmTools instead.")
# Stolen from FindGettext.cmake
@@ -107,7 +109,7 @@ function(_ECM_QM_CREATE_TARGET install_destination catalog_name)
else()
# Qt < 5.3.1 does not define Qt5::lconvert
get_target_property(lrelease_location Qt5::lrelease LOCATION)
- get_filename_component(lrelease_path ${lrelease_location} PATH)
+ get_filename_component(lrelease_path ${lrelease_location} DIRECTORY)
find_program(lconvert_executable
NAMES lconvert-qt5 lconvert
PATHS ${lrelease_path}
@@ -204,7 +206,7 @@ endfunction()
#
# This is a macro so that the value written in ${ARGS_CREATE_LOADER} is
# correctly propagated to ECM_CREATE_QM_FROM_PO_FILES parent scope. If it were
-# not a macro, ECM_CREATE_QM_FROM_PO_FILES would have to ckeck if
+# not a macro, ECM_CREATE_QM_FROM_PO_FILES would have to check if
# CREATE_LOADER is in the arguments and propagate the value itself.
macro(_ECM_CREATE_QM_FROM_PO_FILES_LEGACY)
set(options)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMDeprecationSettings.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMDeprecationSettings.cmake
index 913e9aa906..9caced1256 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMDeprecationSettings.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMDeprecationSettings.cmake
@@ -48,6 +48,8 @@ Example usage:
Since 5.91
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function (ecm_set_disabled_deprecation_versions)
cmake_parse_arguments(ARGS "SHOW_DEPRECATIONS;DISABLE_NEWER_WARNINGS" "" "" ${ARGN})
@@ -104,6 +106,10 @@ function (ecm_set_disabled_deprecation_versions)
# Add 1 to the major version and store it as a hex value
math(EXPR next_major_version "(${CMAKE_MATCH_1} + 1) * 65536 " OUTPUT_FORMAT HEXADECIMAL)
add_definitions(-D${DEPRECATION_NAME}_DEPRECATED_WARNINGS_SINCE=${next_major_version})
+ elseif(IS_QT_DEPRECATION)
+ # For KF, this is implicitly the version we disable depreactions. Qt6 needs this explicitly
+ # Qt6 has a new define called QT_WARN_DEPRECATED_UP_TO, but the old one works fine for now and we don't need to make assumptions about the Qt version
+ add_definitions(-D${DEPRECATION_NAME}_DEPRECATED_WARNINGS_SINCE=${DEPRECATION_HEX_VERSION})
endif()
endforeach()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMEnableSanitizers.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMEnableSanitizers.cmake
index 07db1c8012..dc5377df01 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMEnableSanitizers.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMEnableSanitizers.cmake
@@ -15,6 +15,7 @@ The following sanitizers are supported:
- Thread Sanitizer
- Leak Sanitizer
- Undefined Behaviour Sanitizer
+- Realtime Sanitizer
All of them are implemented in Clang, depending on your version, and
there is an work in progress in GCC, where some of them are currently
@@ -45,9 +46,10 @@ The options are:
- leak
- undefined
- fuzzer
+- realtime
-The sanitizers "address", "memory" and "thread" are mutually exclusive. You
-cannot enable two of them in the same build.
+The sanitizers "address", "memory", "thread" and "realtime" are mutually
+exclusive. You cannot enable two of them in the same build.
"leak" requires the "address" sanitizer.
@@ -74,6 +76,8 @@ This is an example of usage::
Since 1.3.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# MACRO check_compiler_version
#-----------------------------
macro (check_compiler_version gcc_required_version clang_required_version msvc_required_version)
@@ -117,6 +121,16 @@ macro (enable_sanitizer_flags sanitize_option)
set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls")
set(XSAN_LINKER_FLAGS "asan")
endif()
+ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ # fixes "note: variable tracking size limit exceeded with
+ # -fvar-tracking-assignments, retrying without" (which is
+ # another way of saying "I'll go ahead and compile this
+ # thing _twice_") by making it unlimited
+ # Reference:
+ # https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
+ # -> max-vartrack-size
+ string(APPEND XSAN_COMPILE_FLAGS " --param=max-vartrack-size=0")
+ endif ()
elseif (${sanitize_option} MATCHES "thread")
check_compiler_version("4.8" "3.1" "99.99")
set(XSAN_COMPILE_FLAGS "-fsanitize=thread")
@@ -134,6 +148,9 @@ macro (enable_sanitizer_flags sanitize_option)
elseif (${sanitize_option} MATCHES "fuzzer")
check_compiler_version("99.99" "6.0" "99.99")
set(XSAN_COMPILE_FLAGS "-fsanitize=fuzzer")
+ elseif (${sanitize_option} MATCHES "realtime")
+ check_compiler_version("99.99" "20.0" "99.99")
+ set(XSAN_COMPILE_FLAGS "-fsanitize=realtime")
else ()
message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.")
endif ()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFeatureSummary.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFeatureSummary.cmake
index 4d1794734f..16a38aedaa 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFeatureSummary.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFeatureSummary.cmake
@@ -28,6 +28,8 @@ Example:
Since 5.247
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(FeatureSummary)
function(ecm_feature_summary)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindModuleHelpers.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindModuleHelpers.cmake
index 92c796e6bd..ae88107028 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindModuleHelpers.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindModuleHelpers.cmake
@@ -103,6 +103,8 @@ The following variables will be set:
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
macro(ecm_find_package_version_check module_name)
if(CMAKE_VERSION VERSION_LESS 3.16.0)
message(FATAL_ERROR "CMake 3.16.0 is required by Find${module_name}.cmake")
@@ -257,6 +259,11 @@ macro(ecm_find_package_handle_library_components module_name)
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
)
+ if("${${module_name}_${ecm_fpwc_comp}_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$")
+ set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${PKG_${module_name}_${ecm_fpwc_comp}_LINK_LIBRARIES}"
+ )
+ endif()
endif()
list(APPEND ${module_name}_TARGETS
"${module_name}::${ecm_fpwc_comp}")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake
index ca9a1475d4..52bf72ba11 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake
@@ -7,11 +7,15 @@
ECMFindQmlModule
----------------
-Find QML import modules through a ``find_qmlmodule()`` call.
-It looks for the qmldir and uses the qmlplugindump if needed application to find the plugins and sets them up as
-runtime dependencies.
-This is useful so that when we configure a project we are notified when some
-QML imports are not present in the system.
+Finds QML import modules to set them as dependencies.
+
+Because QML modules are not hard compile time requirements, they can be easy to miss
+by packagers and developers, causing suboptimal build results or runtime issues.
+Use this CMake module to ensure a QML module is installed at compile time
+during CMake configuration.
+
+Internally, this CMake module looks for the qmldir and, if needed, uses
+qmlplugindump to find the plugins and set them up as dependencies.
::
@@ -32,6 +36,8 @@ Usage example:
Since 5.38.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
set(MODULES_DIR ${CMAKE_CURRENT_LIST_DIR})
function(ecm_find_qmlmodule MODULE_NAME)
@@ -40,7 +46,7 @@ function(ecm_find_qmlmodule MODULE_NAME)
if (ARG_UNPARSED_ARGUMENTS)
list(GET ARG_UNPARSED_ARGUMENTS 0 VERSION) # If we have any unparsed args, that should be the version
endif()
- set(ARGN "") # The find_package call below should not recieve arguments in KF6
+ set(ARGN "") # The find_package call below should not receive arguments in KF6
else()
list(GET ARGN 0 VERSION)
list(REMOVE_AT ARGN 0)
@@ -54,11 +60,9 @@ function(ecm_find_qmlmodule MODULE_NAME)
if(COMMAND set_package_properties)
if (ARG_REQUIRED)
set(TYPE_STRING TYPE REQUIRED)
- else()
- set(TYPE_STRING TYPE RUNTIME)
endif()
set_package_properties(${GENMODULE} PROPERTIES
- DESCRIPTION "QML module '${MODULE_NAME}' is a runtime dependency."
+ DESCRIPTION "QML module '${MODULE_NAME}' is a dependency."
${TYPE_STRING})
endif()
endfunction()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake.in b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake.in
index b963acfad8..7db160c108 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake.in
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMFindQmlModule.cmake.in
@@ -5,6 +5,8 @@
# SPDX-License-Identifier: BSD-3-Clause
#=============================================================================
+cmake_policy(VERSION 3.16)
+
include(FindPackageHandleStandardArgs)
include("${ECM_MODULE_DIR}/QtVersionOption.cmake")
include("${ECM_MODULE_DIR}/ECMQueryQt.cmake")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateDBusServiceFile.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateDBusServiceFile.cmake
index f39b16a208..4de59ea5a3 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateDBusServiceFile.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateDBusServiceFile.cmake
@@ -56,6 +56,8 @@ Example usage:
Since 5.73.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ecm_generate_dbus_service_file)
set(options)
set(oneValueArgs EXECUTABLE NAME SYSTEMD_SERVICE DESTINATION RENAME)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateExportHeader.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateExportHeader.cmake
index 5ad94c8357..caa38ff901 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateExportHeader.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateExportHeader.cmake
@@ -31,6 +31,7 @@ For preparing some values useful in the context it also provides a function
[DEPRECATED_BASE_VERSION ]
[DEPRECATION_VERSIONS [ [...]]]
[EXCLUDE_DEPRECATED_BEFORE_AND_AT ]
+ [DEPRECATED_ATTRIBUTE_TYPE ] # Since 6.28
[NO_BUILD_SET_DEPRECATED_WARNINGS_SINCE]
[NO_DEFINITION_EXPORT_TO_BUILD_INTERFACE]
[USE_VERSION_HEADER []] # Since 5.106
@@ -68,6 +69,24 @@ deprecated before and at should be excluded from the build completely.
Possible values are "0" (default), "CURRENT" (which resolves to )
and a version string in the format "..".
+``DEPRECATED_ATTRIBUTE_TYPE`` specifies the type of attribute to use in the
+generated macros. Options are "STANDARD" (default when the minimum required
+version of ECM is 6.28 or newer) or "COMPILER" (default otherwise, legacy).
+"STANDARD" will result in the use of the C++ standard attribute
+``[[deprecated("text")]]``, where-as "COMPILER" will use the pre-C++14
+compiler-specific annotations like ``__attribute__ ((__deprecated__("text")))``
+or ``__declspec(deprecated("text"))``, if available.
+Since 6.28.
+
+.. warning::
+ The compiler-specific annotation attributes can be placed more freely in
+ the signatures of declarations, the C++ standard ``[[deprecated("text")]]``
+ ones are restrained to the standard locations for attributes. So when
+ switching from "COMPILER" to "STANDARD" it needs to be ensured all used
+ deprecation macros are only at locations where attributes are possible.
+ Also note that with "STANDARD" the special enumerator macros (see below)
+ will not be available, as usually the normal deprecation macro can be used.
+
``NO_BUILD_SET_DEPRECATED_WARNINGS_SINCE`` specifies that the definition
``_DEPRECATED_WARNINGS_SINCE`` will
not be set for the library inside its own build, and thus will be defined
@@ -110,7 +129,7 @@ would only append the string passed as argument value.
The function ``ecm_generate_export_header`` defines C++ preprocessor macros
in the generated export header, some for use in the sources of the library
-the header is generated for, other for use by projects linking agsinst the
+the header is generated for, other for use by projects linking against the
library.
The macros for use in the library C++ sources are these, next to those also
@@ -139,6 +158,8 @@ defined by `GenerateExportHeader
on the warnings macro flags set (see below). In builds using C++14 standard or earlier,
where enumerator attributes are not yet supported, the macro will always yield an empty string.
With MSVC it is also always an empty string for now.
+ Not available with ``DEPRECATED_ATTRIBUTE_TYPE`` set to "STANDARD", there the normal macro can
+ be usually used.
Since 5.82.
``_ENUMERATOR_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text)``
@@ -151,6 +172,8 @@ defined by `GenerateExportHeader
Useful for retroactive tagging of API for the compiler without injecting the
API into the compiler warning conditions of already released versions.
With MSVC it is also always an empty string for now.
+ Not available with ``DEPRECATED_ATTRIBUTE_TYPE`` set to "STANDARD", there the normal macro can
+ be usually used.
Since 5.82.
``_ENABLE_DEPRECATED_SINCE(major, minor)``
@@ -405,10 +428,9 @@ To get the hex number style value the helper macro
Since 5.64.0.
#]=======================================================================]
-include(GenerateExportHeader)
+cmake_policy(VERSION 3.16)
-cmake_policy(PUSH)
-cmake_policy(SET CMP0057 NEW) # if IN_LIST
+include(GenerateExportHeader)
# helper method
function(_ecm_geh_generate_hex_number _var_name _version)
@@ -475,6 +497,7 @@ function(ecm_generate_export_header target)
VERSION_BASE_NAME
VERSION_MACRO_NAME
EXCLUDE_DEPRECATED_BEFORE_AND_AT
+ DEPRECATED_ATTRIBUTE_TYPE
EXPORT_MACRO_NAME
DEPRECATED_MACRO_NAME
NO_EXPORT_MACRO_NAME
@@ -579,6 +602,19 @@ function(ecm_generate_export_header target)
else()
set(_deprecated_macro_name "${_macro_base_name}_DEPRECATED")
endif()
+ if (ARGS_DEPRECATED_ATTRIBUTE_TYPE STREQUAL "STANDARD")
+ set(_use_std_attribute TRUE)
+ elseif (ARGS_DEPRECATED_ATTRIBUTE_TYPE STREQUAL "COMPILER")
+ set(_use_std_attribute FALSE)
+ elseif (ARGS_DEPRECATED_ATTRIBUTE_TYPE)
+ message(FATAL_ERROR "DEPRECATED_ATTRIBUTE_TYPE has to be one of STANDARD and COMPILER, was \"${ARGS_DEPRECATED_ATTRIBUTE_TYPE}\".")
+ else()
+ if (ECM_GLOBAL_FIND_VERSION VERSION_LESS 6.28)
+ set(_use_std_attribute FALSE)
+ else()
+ set(_use_std_attribute TRUE)
+ endif()
+ endif()
if(NOT IS_ABSOLUTE ${ARGS_EXPORT_FILE_NAME})
set(ARGS_EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_EXPORT_FILE_NAME}")
@@ -601,8 +637,9 @@ function(ecm_generate_export_header target)
endif()
# for the set of compiler versions supported by ECM/KF we can assume those attributes supported
- # KF6: with C++17 as minimum standard planned, switch to always use [[deprecated(text)]]
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ if (_use_std_attribute)
+ set(_decl_deprecated_text_definition "[[deprecated(text)]]")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(_decl_deprecated_text_definition "__attribute__ ((__deprecated__(text)))")
elseif(MSVC)
set(_decl_deprecated_text_definition "__declspec(deprecated(text))")
@@ -618,6 +655,24 @@ function(ecm_generate_export_header target)
string(APPEND _output "#include <${_version_header}>\n")
endif()
endif()
+ if (_use_std_attribute)
+ # generate_export_header() has no option to disable generation of macros
+ # for deprecation attributes or to use the standard attribute.
+ # For now just add code to redefine the respective macros.
+ # TODO: consider stop using generate_export_header(), only deployed actually to
+ # get the export/visibility macros definitions, simple logic could be copied over
+ string(APPEND _output "
+#undef ${_macro_base_name}_DECL_DEPRECATED
+#define ${_macro_base_name}_DECL_DEPRECATED [[deprecated]]
+
+#undef ${_macro_base_name}_DECL_DEPRECATED_EXPORT
+#define ${_macro_base_name}_DECL_DEPRECATED_EXPORT ${_macro_base_name}_EXPORT ${_macro_base_name}_DECL_DEPRECATED
+
+#undef ${_macro_base_name}_DECL_DEPRECATED_NO_EXPORT
+#define ${_macro_base_name}_DECL_DEPRECATED_NO_EXPORT ${_macro_base_name}_NO_EXPORT ${_macro_base_name}_DECL_DEPRECATED
+"
+ )
+ endif()
string(APPEND _output "
#define ${_macro_base_name}_DECL_DEPRECATED_TEXT(text) ${_decl_deprecated_text_definition}
"
@@ -764,16 +819,18 @@ function(ecm_generate_export_header target)
"#define ${_macro_base_name}_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text) ${_macro_base_name}_DEPRECATED_VERSION_##major(minor, \"Since \"#textmajor\".\"#textminor\". \" text)
"
)
- # reusing the existing version-controlled deprecation macros for enumerator deprecation macros
- # to avoid having to repeat all the explicit version variants
- # TODO: MSVC seems to have issues with __declspec(deprecated) being used as enumerator attribute
- # and deals only with standard [[deprecated(text)]].
- # But for now we have to keep the deprecation macros using the compiler-specific attributes,
- # because CMake's GenerateExportHeader uses the latter for the export macros and
- # at least GCC does not support both being used mixed e.g. on the same class or method.
- # Possibly needs to be solved by forking GenerateExportHeader to get complete control.
- if(NOT MSVC)
- string(APPEND _output
+ # only add special macros for enums for compiler-specific attribute backward-support
+ if(NOT _use_std_attribute)
+ # reusing the existing version-controlled deprecation macros for enumerator deprecation macros
+ # to avoid having to repeat all the explicit version variants
+ # TODO: MSVC seems to have issues with __declspec(deprecated) being used as enumerator attribute
+ # and deals only with standard [[deprecated(text)]].
+ # But for now we have to keep the deprecation macros using the compiler-specific attributes,
+ # because CMake's GenerateExportHeader uses the latter for the export macros and
+ # at least GCC does not support both being used mixed e.g. on the same class or method.
+ # Possibly needs to be solved by forking GenerateExportHeader to get complete control.
+ if(NOT MSVC)
+ string(APPEND _output
"#if defined(__cpp_enumerator_attributes) && __cpp_enumerator_attributes >= 201411
# define ${_macro_base_name}_ENUMERATOR_DEPRECATED_VERSION(major, minor, text) ${_macro_base_name}_DEPRECATED_VERSION(major, minor, text)
# define ${_macro_base_name}_ENUMERATOR_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text) ${_macro_base_name}_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text)
@@ -782,14 +839,15 @@ function(ecm_generate_export_header target)
# define ${_macro_base_name}_ENUMERATOR_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text)
#endif
"
- )
- else()
- string(APPEND _output
+ )
+ else()
+ string(APPEND _output
"// Not yet implemented for MSVC
#define ${_macro_base_name}_ENUMERATOR_DEPRECATED_VERSION(major, minor, text)
#define ${_macro_base_name}_ENUMERATOR_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text)
"
- )
+ )
+ endif()
endif()
endif()
if (ARGS_CUSTOM_CONTENT_FROM_VARIABLE)
@@ -834,5 +892,3 @@ function(ecm_generate_export_header target)
CUSTOM_CONTENT_FROM_VARIABLE _output
)
endfunction()
-
-cmake_policy(POP)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateHeaders.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateHeaders.cmake
index 1d2a46d47b..f13832b0b7 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateHeaders.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateHeaders.cmake
@@ -18,6 +18,7 @@ Generate C/C++ CamelCase forwarding headers.
[HEADER_EXTENSION ]
[OUTPUT_DIR ]
[PREFIX ]
+ [SHARED_PREFIX ] # since 6.19
[REQUIRED_HEADERS ]
[COMMON_HEADER ]
[RELATIVE ])
@@ -47,6 +48,14 @@ forwarding headers based on the original names (e.g. ``kparts/part.h``). This
allows includes like ``"#include "`` to be used before
installation, as long as the include_directories are set appropriately.
+``SHARED_PREFIX`` works similar to ``PREFIX``. It though assumes the original
+headers will be installed in the same subdirectory as the forwarding headers.
+So the generated files will include the original ones locally without any prefix.
+And the above mentioned pre-installation convenience forwarding headers based on
+the original names will be placed in the same subdirectory
+(e.g. ``KParts/part.h``), to allow includes like ``"#include "`` to
+be used before installation and working properly. Since 6.19.0.
+
``OUTPUT_DIR`` specifies where the files will be generated; this should be within
the build directory. By default, ``${CMAKE_CURRENT_BINARY_DIR}`` will be used.
This option can be used to avoid file conflicts.
@@ -65,18 +74,21 @@ The ``RELATIVE`` argument indicates where the original headers can be found
relative to ``CMAKE_CURRENT_SOURCE_DIR``. It does not affect the generated
CamelCase forwarding files, but ``ecm_generate_headers()`` uses it when checking
that the original header exists, and to generate originally named forwarding
-headers when ``PREFIX`` is set.
+headers when ``PREFIX`` or ``SHARED_PREFIX`` is set.
To allow other parts of the source distribution (eg: tests) to use the
-generated headers before installation, it may be desirable to set the
-``INCLUDE_DIRECTORIES`` property for the library target to output_dir. For
-example, if ``OUTPUT_DIR`` is ``CMAKE_CURRENT_BINARY_DIR`` (the default), you could do
+generated headers before installation, it may be desirable to add to the
+``INCLUDE_DIRECTORIES`` property of the library target the output_dir.
+If ``OUTPUT_DIR`` is ``CMAKE_CURRENT_BINARY_DIR`` (the default) and
+``CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE`` is ``ON`` (as set by
+:kde-module:`KDECMakeSettings`), this is automatically done.
+Otherwise you could do (adapt if ``OUTPUT_DIR`` is something else)
.. code-block:: cmake
target_include_directories(MyLib PUBLIC "$")
-Example usage (without ``PREFIX``):
+Example usage (without ``PREFIX`` pr ``SHARED_PREFIX``):
.. code-block:: cmake
@@ -115,12 +127,33 @@ Example usage (with ``PREFIX``):
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/mylib
COMPONENT Devel)
+Example usage (with ``SHARED_PREFIX``):
+
+.. code-block:: cmake
+
+ ecm_generate_headers(
+ MyLib_FORWARDING_HEADERS
+ HEADERS
+ Foo
+ # several classes are contained in bar.h, so generate
+ # additional files
+ Bar,BarList
+ # etc
+ SHARED_PREFIX MyLib
+ REQUIRED_HEADERS MyLib_HEADERS
+ )
+ install(FILES ${MyLib_FORWARDING_HEADERS} ${MyLib_HEADERS}
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/MyLib
+ COMPONENT Devel)
+
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
set(options)
- set(oneValueArgs ORIGINAL HEADER_EXTENSION OUTPUT_DIR PREFIX REQUIRED_HEADERS COMMON_HEADER RELATIVE)
+ set(oneValueArgs ORIGINAL HEADER_EXTENSION OUTPUT_DIR PREFIX SHARED_PREFIX REQUIRED_HEADERS COMMON_HEADER RELATIVE)
set(multiValueArgs HEADER_NAMES)
cmake_parse_arguments(EGH "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -128,6 +161,10 @@ function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
message(FATAL_ERROR "Unexpected arguments to ECM_GENERATE_HEADERS: ${EGH_UNPARSED_ARGUMENTS}")
endif()
+ if(EGH_PREFIX AND EGH_SHARED_PREFIX)
+ message(FATAL_ERROR "Cannot pass both PREFIX and SHARED_PREFIX arguments to ECM_GENERATE_HEADERS")
+ endif()
+
if(NOT EGH_HEADER_NAMES)
message(FATAL_ERROR "Missing header_names argument to ECM_GENERATE_HEADERS")
endif()
@@ -153,16 +190,27 @@ function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
set(EGH_RELATIVE "${EGH_RELATIVE}/")
endif()
- set(originalprefix)
- if (EGH_PREFIX)
- if (NOT "${EGH_PREFIX}" MATCHES "^.*/$")
- set(EGH_PREFIX "${EGH_PREFIX}/")
- endif()
+ set(prefix)
+ if (EGH_SHARED_PREFIX)
+ set(prefix "${EGH_SHARED_PREFIX}")
+ elseif (EGH_PREFIX)
+ set(prefix "${EGH_PREFIX}")
+ endif()
+ if (prefix AND NOT "${prefix}" MATCHES "^.*/$")
+ string(APPEND prefix "/")
+ endif()
+
+ set(originalprefix) # prefix used in the include by the forwarding header
+ set(buildoriginalprefix) # prefix used in the build to place the convenience forwarding headers
+ if (EGH_SHARED_PREFIX)
+ set(buildoriginalprefix "${prefix}")
+ elseif (EGH_PREFIX)
if (EGH_ORIGINAL STREQUAL "CAMELCASE")
- set(originalprefix "${EGH_PREFIX}")
+ set(originalprefix "${prefix}")
else()
- string(TOLOWER "${EGH_PREFIX}" originalprefix)
+ string(TOLOWER "${prefix}" originalprefix)
endif()
+ set(buildoriginalprefix "${originalprefix}")
endif()
foreach(_classnameentry ${EGH_HEADER_NAMES})
@@ -182,21 +230,41 @@ function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
endif()
foreach(_CLASSNAME ${_classnames})
- set(FANCY_HEADER_FILE "${EGH_OUTPUT_DIR}/${EGH_PREFIX}${_CLASSNAME}")
+ set(FANCY_HEADER_FILE "${EGH_OUTPUT_DIR}/${prefix}${_CLASSNAME}")
if (NOT EXISTS ${FANCY_HEADER_FILE})
- file(WRITE ${FANCY_HEADER_FILE} "#include \"${originalprefix}${originalbasename}.${EGH_HEADER_EXTENSION}\" // IWYU pragma: export\n")
+ set(_content "#include \"${originalprefix}${originalbasename}.${EGH_HEADER_EXTENSION}\" // IWYU pragma: export\n")
+ if (prefix AND "${originalprefix}" STREQUAL "")
+ # Here a relative include is created, without the namespace prefix.
+ # This results in some potentially non-unique file content, when other relative forwarding
+ # headers exist for the same base name (e.g. Prison/Barcode vs. KPkPass/Barcode, which both
+ # would simply include "barcode.h").
+ # Some filesystems automatically hardlink files which are identical by the content checksum
+ # (e.g. for RPM-provided files under /usr, to save storage space).
+ # This collides with Clang seemingly doing optimization by looking at the inodes of the
+ # to-be included files, and reusing content from the inode as found with any first path.
+ # So for a compilation unit which includes multiple forwarding headers with different
+ # namespaces but same basename, so having same inode with those systems, the latter ones will
+ # not result in the actual relative original headers being included.
+ # See https://github.com/llvm/llvm-project/issues/26953
+ # As counter-measure some unique content is added below, serving some double purpose by giving
+ # instructions how to use the file, in case someone looks at it.
+ string(PREPEND _content "// Forwarding header, use by: #include <${prefix}${_CLASSNAME}>\n")
+ endif()
+ file(WRITE ${FANCY_HEADER_FILE} "${_content}")
endif()
list(APPEND ${camelcase_forwarding_headers_var} "${FANCY_HEADER_FILE}")
- if (EGH_PREFIX)
- # Local forwarding header, for namespaced headers, e.g. kparts/part.h
+ if (prefix)
+ # Build-local convenience forwarding header, for namespaced headers, e.g. kparts/part.h
+ # Ensures either the prefixed forwarding include works ("kparts/part.h"), or the unnamespaced
+ # local relative ("part.h") will pick up the correct header, not some consumer one.
if(EGH_ORIGINAL STREQUAL "CAMELCASE")
set(originalclassname "${_CLASSNAME}")
else()
string(TOLOWER "${_CLASSNAME}" originalclassname)
endif()
- set(REGULAR_HEADER_NAME ${EGH_OUTPUT_DIR}/${originalprefix}${originalclassname}.${EGH_HEADER_EXTENSION})
+ set(REGULAR_HEADER_NAME ${EGH_OUTPUT_DIR}/${buildoriginalprefix}${originalclassname}.${EGH_HEADER_EXTENSION})
if (NOT EXISTS ${REGULAR_HEADER_NAME})
- file(RELATIVE_PATH _actualheader_relative "${EGH_OUTPUT_DIR}/${originalprefix}" "${_actualheader}")
+ file(RELATIVE_PATH _actualheader_relative "${EGH_OUTPUT_DIR}/${buildoriginalprefix}" "${_actualheader}")
file(WRITE ${REGULAR_HEADER_NAME} "#include \"${_actualheader_relative}\" // IWYU pragma: export\n")
endif()
endif()
@@ -207,7 +275,7 @@ function(ECM_GENERATE_HEADERS camelcase_forwarding_headers_var)
if(EGH_COMMON_HEADER)
#combine required headers into 1 big convenience header
- set(COMMON_HEADER ${EGH_OUTPUT_DIR}/${EGH_PREFIX}${EGH_COMMON_HEADER})
+ set(COMMON_HEADER ${EGH_OUTPUT_DIR}/${prefix}${EGH_COMMON_HEADER})
file(WRITE ${COMMON_HEADER} "// convenience header\n")
foreach(_header ${_REQUIRED_HEADERS})
get_filename_component(_base ${_header} NAME)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePkgConfigFile.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePkgConfigFile.cmake
index 77ab8ae16d..1f39f07bb6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePkgConfigFile.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePkgConfigFile.cmake
@@ -74,7 +74,8 @@ cache variable is set to something different.
To properly use this macro a version needs to be set. To retrieve it,
``ECM_PKGCONFIG_INSTALL_DIR`` uses ``PROJECT_VERSION``. To set it, use the
-``project()`` command or the ``ecm_setup_version()`` macro
+``project()`` command (or if you still set CMP0048 to OLD and don't have
+CMake >= 4 the ``ecm_setup_version()`` macro)
Example usage:
@@ -90,6 +91,8 @@ Example usage:
Since 1.3.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ECM_GENERATE_PKGCONFIG_FILE)
set(options INSTALL)
set(oneValueArgs BASE_NAME LIB_NAME FILENAME_VAR INCLUDE_INSTALL_DIR LIB_INSTALL_DIR DESCRIPTION URL)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePriFile.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePriFile.cmake
index 8910cd9e5d..61ca8a1405 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePriFile.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePriFile.cmake
@@ -87,6 +87,8 @@ in their ``.pro`` file.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# Replicate the logic from KDEInstallDirs.cmake as we can't depend on it
# Ask qmake if we're using the same prefix as Qt
set(_should_query_qt OFF)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.cmake
index 1446b9a779..4fce392f25 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.cmake
@@ -19,6 +19,7 @@ Generate Python bindings using Shiboken.
VERSION
WRAPPED_HEADER
TYPESYSTEM
+ [EXPORT_TYPESYSTEM]
GENERATED_SOURCES [ [...]]
DEPENDENCIES [ [...]]
QT_VERSION
@@ -36,6 +37,9 @@ for the library.
``TYPESYSTEM`` is the XML file where the bindings are defined.
+``EXPORT_TYPESYSTEM`` specifies that the typesystem XML file and the
+generated header are exported and can be used by other typesystem XML files.
+
``GENERATED_SOURCES`` is the list of generated C++ source files by Shiboken
that will be used to build the shared library.
@@ -43,9 +47,9 @@ that will be used to build the shared library.
``DEPENDENCIES`` is the list of dependencies that the bindings uses.
-``HOMEPAGE_URL`` is a URL to the proyect homepage.
+``HOMEPAGE_URL`` is a URL to the project homepage.
-``ISSUES_URL` is a URL where users can report bugs and feature requests.
+``ISSUES_URL`` is a URL where users can report bugs and feature requests.
``AUTHOR`` is a string with the author of the library.
@@ -54,18 +58,36 @@ description on the Python Package Index.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
set(MODULES_DIR ${CMAKE_CURRENT_LIST_DIR})
function(ecm_generate_python_bindings)
- set(options )
+ set(options EXPORT_TYPESYSTEM)
set(oneValueArgs PACKAGE_NAME WRAPPED_HEADER TYPESYSTEM VERSION QT_VERSION HOMEPAGE_URL ISSUES_URL AUTHOR README)
set(multiValueArgs GENERATED_SOURCES DEPENDENCIES)
cmake_parse_arguments(PB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ if (NOT Python3_EXECUTABLE)
+ message(FATAL_ERROR "Python3_EXECUTABLE not set. Make sure find_package(Python3) is called before including ECMGeneratePythonBindings")
+ endif()
+
+ execute_process(COMMAND ${Python3_EXECUTABLE} -Esc "import build" RESULT_VARIABLE PYTHON_BUILD_CHECK_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+
+ if (PYTHON_BUILD_CHECK_EXIT_CODE)
+ message(FATAL_ERROR "The 'build' Python module is needed for ECMGeneratePythonBindings")
+ endif()
+
# Ugly hacks because PySide6::pyside6 only includes /usr/includes/PySide6 and none of the sub directory
# Qt bugreport: PYSIDE-2882
get_property(PYSIDE_INCLUDE_DIRS TARGET "PySide6::pyside6" PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+ if(NOT PYSIDE_INCLUDE_DIR)
+ set(PYSIDE_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/PySide${QT_MAJOR_VERSION}")
+ endif()
+ if(NOT PYSIDE_INCLUDE_DIR IN_LIST PYSIDE_INCLUDE_DIRS)
+ list(APPEND PYSIDE_INCLUDE_DIRS "${PYSIDE_INCLUDE_DIR}")
+ endif()
foreach(PYSIDE_INCLUDE_DIR ${PYSIDE_INCLUDE_DIRS})
file(GLOB PYSIDE_SUBDIRS LIST_DIRECTORIES true "${PYSIDE_INCLUDE_DIR}/*")
foreach (PYSIDE_SUBDIR ${PYSIDE_SUBDIRS})
@@ -108,6 +130,7 @@ function(ecm_generate_python_bindings)
${INCLUDES}
--include-paths=${CMAKE_SOURCE_DIR}
--typesystem-paths=${CMAKE_SOURCE_DIR}
+ --typesystem-paths="${CMAKE_INSTALL_PREFIX}/share/PySide${QT_MAJOR_VERSION}/typesystems"
--typesystem-paths=${PYSIDE_TYPESYSTEMS}
--output-directory=${CMAKE_CURRENT_BINARY_DIR})
@@ -132,6 +155,12 @@ function(ecm_generate_python_bindings)
get_property(_defs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS)
list(FILTER _defs EXCLUDE REGEX [[^QT_DISABLE_DEPRECATED_BEFORE=]])
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS ${_defs})
+ get_property(_defs DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS)
+ list(FILTER _defs EXCLUDE REGEX [[^QT_DISABLE_DEPRECATED_UP_TO=]])
+ set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS ${_defs})
+ get_property(_defs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS)
+ list(FILTER _defs EXCLUDE REGEX [[^QT_DISABLE_DEPRECATED_UP_TO=]])
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS ${_defs})
# Define and build the bindings library.
add_library(${PB_PACKAGE_NAME} SHARED ${${PB_PACKAGE_NAME}_sources})
@@ -151,7 +180,16 @@ function(ecm_generate_python_bindings)
)
# Hide noisy warnings
- target_compile_options(${PB_PACKAGE_NAME} PRIVATE -Wno-cast-function-type -Wno-missing-include-dirs)
+ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+ target_compile_options(${PB_PACKAGE_NAME} PRIVATE
+ -Wno-cast-function-type
+ -Wno-keyword-macro
+ -Wno-missing-include-dirs
+ -Wno-overloaded-virtual
+ -Wno-shadow
+ -Wno-zero-as-null-pointer-constant
+ )
+ endif()
# Adjust the name of generated module.
set_property(TARGET ${PB_PACKAGE_NAME} PROPERTY PREFIX "")
@@ -171,4 +209,12 @@ function(ecm_generate_python_bindings)
COMMENT "Building Python Wheel"
)
+ # Export the header and the typesystem XML file
+ if (PB_EXPORT_TYPESYSTEM)
+ string(TOLOWER ${PB_PACKAGE_NAME} lower_package_name)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PB_PACKAGE_NAME}/${lower_package_name}_python.h
+ DESTINATION "${PYSIDE_INCLUDE_DIR}/${PB_PACKAGE_NAME}/")
+ install(FILES "${PB_TYPESYSTEM}" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/PySide${QT_MAJOR_VERSION}/typesystems/")
+ endif()
+
endfunction()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.toml.in b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.toml.in
index 435d96c9dd..7a0d68793d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.toml.in
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGeneratePythonBindings.toml.in
@@ -6,7 +6,7 @@ authors = [
]
description = "Python bindings for ${PB_PACKAGE_NAME}"
readme = "README.md"
-requires-python = ">=3.10"
+requires-python = ">=3.9"
dependencies = [
"PySide6>=${PB_QT_VERSION},<7",
]
@@ -16,6 +16,7 @@ classifiers = [
"Environment :: X11 Applications :: Qt",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQDoc.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQDoc.cmake
index 4ffbe8365b..0e7ff231bd 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQDoc.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQDoc.cmake
@@ -29,7 +29,7 @@ Example usage:
ecm_add_qch(KF6::CoreAddons kcoreaddons.qdocconf)
-Documentation is not built as part of the normal build, it needs to be explicity
+Documentation is not built as part of the normal build, it needs to be explicitly
invoked using the following build targets:
* ``prepare_docs`` runs the prepare step from qdoc, which processes sources and creates index files
@@ -48,6 +48,8 @@ When combining documentation from multiple projects the recommended procedure is
Since 6.11.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
add_custom_target(prepare_docs)
add_custom_target(generate_docs)
add_custom_target(install_html_docs)
@@ -55,8 +57,13 @@ add_custom_target(generate_qch)
add_custom_target(install_qch_docs)
function(ecm_generate_qdoc target qdocconf_file)
- find_package(Qt6Tools CONFIG REQUIRED)
- find_package(Qt6 COMPONENTS ToolsTools CONFIG REQUIRED)
+ find_package(Qt6Tools CONFIG QUIET)
+ find_package(Qt6 OPTIONAL_COMPONENTS ToolsTools CONFIG QUIET)
+
+ if (NOT Qt6Tools_FOUND OR NOT Qt6ToolsTools_FOUND)
+ message(STATUS "Qt6Tools or Qt6ToolsTools not found, not generating API documentation")
+ return()
+ endif()
if (NOT TARGET ${target})
message(FATAL_ERROR "${target} is not a target")
@@ -71,22 +78,26 @@ function(ecm_generate_qdoc target qdocconf_file)
set(qdoc_extra_args "")
if (NOT QDOC_BIN)
+ if (NOT TARGET Qt6::qdoc)
+ message("qdoc executable not found, not generating API documentation")
+ return()
+ endif()
get_target_property(QDOC_BIN Qt6::qdoc LOCATION)
endif()
get_target_property(target_type ${target} TYPE)
get_target_property(target_bin_dir ${target} BINARY_DIR)
get_target_property(target_source_dir ${target} SOURCE_DIR)
- set(doc_output_dir "${target_bin_dir}/.doc")
+ set(doc_output_dir "${CMAKE_BINARY_DIR}/.doc")
# Generate include dir list
- set(target_include_dirs_file "${doc_output_dir}/$/includes.txt")
+ set(target_include_dirs_file "${doc_output_dir}/${target}_$_includes.txt")
set(include_paths_property "$")
file(GENERATE
OUTPUT ${target_include_dirs_file}
- CONTENT "$<$:-I$>\n-I$"
+ CONTENT "$<$:-I$>\n-I$\n-I$"
)
set(include_path_args "@${target_include_dirs_file}")
@@ -156,47 +167,51 @@ function(ecm_generate_qdoc target qdocconf_file)
${generate_qdoc_args}
)
- # generate .qch
- set(qch_file_name ${doc_target}.qch)
- set(qch_file_path ${dest_dir}/${doc_target}/${qch_file_name})
-
- get_target_property(QHelpGenerator_EXECUTABLE Qt6::qhelpgenerator LOCATION)
-
- add_custom_target(generate_qch_${target}
- COMMAND ${QHelpGenerator_EXECUTABLE}
- "${dest_dir}/html/${doc_target}.qhp"
- -o "${qch_file_path}"
- )
-
add_dependencies(prepare_docs prepare_docs_${target})
add_dependencies(generate_docs generate_docs_${target})
- add_dependencies(generate_qch generate_qch_${target})
- add_dependencies(install_html_docs install_html_docs_${target})
- add_dependencies(install_qch_docs install_qch_docs_${target})
- install(DIRECTORY "${dest_dir}/html/"
- DESTINATION "${KDE_INSTALL_QTQCHDIR}/${doc_target}"
- COMPONENT _install_html_docs_${target}
- EXCLUDE_FROM_ALL
- )
+ # generate .qch
+ if (TARGET Qt6::qhelpgenerator)
+ set(qch_file_name ${doc_target}.qch)
+ set(qch_file_path ${dest_dir}/${qch_file_name})
+ get_target_property(QHelpGenerator_EXECUTABLE Qt6::qhelpgenerator LOCATION)
- add_custom_target(install_html_docs_${target}
- COMMAND ${CMAKE_COMMAND}
- --install "${CMAKE_BINARY_DIR}"
- --component _install_html_docs_${target}
- COMMENT "Installing html docs for target ${target}"
- )
+ add_custom_target(generate_qch_${target}
+ COMMAND ${QHelpGenerator_EXECUTABLE}
+ "${dest_dir}/${doc_target}/${doc_target}.qhp"
+ -o "${qch_file_path}"
+ )
- install(FILES "${qch_file_path}"
- DESTINATION "${KDE_INSTALL_QTQCHDIR}"
- COMPONENT _install_qch_docs_${target}
- EXCLUDE_FROM_ALL
- )
+ add_dependencies(generate_qch generate_qch_${target})
+ add_dependencies(install_html_docs install_html_docs_${target})
+ add_dependencies(install_qch_docs install_qch_docs_${target})
- add_custom_target(install_qch_docs_${target}
- COMMAND ${CMAKE_COMMAND}
- --install "${CMAKE_BINARY_DIR}"
- --component _install_qch_docs_${target}
- COMMENT "Installing qch docs for target ${target}"
- )
+ install(DIRECTORY "${dest_dir}/${doc_target}/"
+ DESTINATION "${KDE_INSTALL_QTQCHDIR}/${doc_target}"
+ COMPONENT _install_html_docs_${target}
+ EXCLUDE_FROM_ALL
+ )
+
+ add_custom_target(install_html_docs_${target}
+ COMMAND ${CMAKE_COMMAND}
+ --install "${CMAKE_BINARY_DIR}"
+ --component _install_html_docs_${target}
+ COMMENT "Installing html docs for target ${target}"
+ )
+
+ install(FILES "${qch_file_path}"
+ DESTINATION "${KDE_INSTALL_QTQCHDIR}"
+ COMPONENT _install_qch_docs_${target}
+ EXCLUDE_FROM_ALL
+ )
+
+ add_custom_target(install_qch_docs_${target}
+ COMMAND ${CMAKE_COMMAND}
+ --install "${CMAKE_BINARY_DIR}"
+ --component _install_qch_docs_${target}
+ COMMENT "Installing qch docs for target ${target}"
+ )
+ else()
+ message("qhelpgenerator executable not found, not generating API documentation in QCH format")
+ endif()
endfunction()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQmlTypes.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQmlTypes.cmake
index 47b4326edb..f95ea2948b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQmlTypes.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMGenerateQmlTypes.cmake
@@ -23,10 +23,14 @@ The plugin.qmltypes file will sit in the source directory. This function will
include the code that installs the file in the right place and a small unit
test named qmltypes-pluginname-version that makes sure that it doesn't need updating.
+With Qt6 prefer using qt_add_qml_module()/ecm_add_qml_module() and declarative
+type registration, which do this automatically.
Since 5.33.0
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ecm_generate_qmltypes)
if (NOT TARGET qmltypes)
add_custom_target(qmltypes)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMInstallIcons.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMInstallIcons.cmake
index 279a418212..1179c64853 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMInstallIcons.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMInstallIcons.cmake
@@ -71,6 +71,8 @@ into ``/hicolor/22x22/actions/menu_new.png``
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
# A "map" of short type names to the directories.
# Unknown names produce a warning.
set(_ECM_ICON_GROUP_mimetypes "mimetypes")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkAsTest.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkAsTest.cmake
index 6a5373d573..d7a601d299 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkAsTest.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkAsTest.cmake
@@ -22,6 +22,8 @@ This will cause the specified targets to not be built unless either
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
if (NOT BUILD_TESTING)
if(NOT TARGET buildtests)
add_custom_target(buildtests)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkNonGuiExecutable.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkNonGuiExecutable.cmake
index 48b4feaa8f..825a84e1f3 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkNonGuiExecutable.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMMarkNonGuiExecutable.cmake
@@ -19,6 +19,8 @@ than MacOS X or Windows, this will have no effect.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ecm_mark_nongui_executable)
foreach(_target ${ARGN})
set_target_properties(${_target}
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMOptionalAddSubdirectory.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMOptionalAddSubdirectory.cmake
index 681420860e..138e857f0f 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMOptionalAddSubdirectory.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMOptionalAddSubdirectory.cmake
@@ -33,6 +33,8 @@ one named "foo":
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ECM_OPTIONAL_ADD_SUBDIRECTORY _dir)
get_filename_component(_fullPath ${_dir} ABSOLUTE)
if(EXISTS ${_fullPath}/CMakeLists.txt)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPackageConfigHelpers.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPackageConfigHelpers.cmake
index c635122e81..2367e1af19 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPackageConfigHelpers.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPackageConfigHelpers.cmake
@@ -55,6 +55,8 @@ an informative diagnostic message if the dependency could not be found.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_ROOT}/Modules/CMakePackageConfigHelpers.cmake)
set(_ecm_package_config_helpers_included TRUE)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPoQmTools.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPoQmTools.cmake
index b05a57b95f..f348be754c 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPoQmTools.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMPoQmTools.cmake
@@ -82,6 +82,8 @@ it uses ``share/locale``.
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake)
option(KF_SKIP_PO_PROCESSING "Skip processing of po files" OFF)
@@ -158,7 +160,7 @@ function(ecm_process_po_files_as_qm lang)
else()
# Qt < 5.3.1 does not define Qt5::lconvert
get_target_property(lrelease_location Qt5::lrelease LOCATION)
- get_filename_component(lrelease_path ${lrelease_location} PATH)
+ get_filename_component(lrelease_path ${lrelease_location} DIRECTORY)
find_program(lconvert_executable
NAMES lconvert-qt5 lconvert
PATHS ${lrelease_path}
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQMLModules.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQMLModules.cmake
index 9065e5f064..a9c15d5415 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQMLModules.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQMLModules.cmake
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+cmake_policy(VERSION 3.16)
+
if (${ECM_GLOBAL_FIND_VERSION} VERSION_GREATER_EQUAL 5.88)
message(DEPRECATION "ECMQMLModules.cmake is deprecated since 5.88.0, please use ECMFindQmlModule.cmake instead")
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmLoader.cpp.in b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmLoader.cpp.in
index 02961374bd..87e8009f99 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmLoader.cpp.in
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmLoader.cpp.in
@@ -77,7 +77,11 @@ namespace {
return false;
}
#else
+# ifdef Q_OS_MACOS
+ const QString fullPath = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, subPath);
+# else
const QString fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath);
+# endif
if (fullPath.isEmpty()) {
return false;
}
@@ -100,16 +104,42 @@ namespace {
loadTranslation(QStringLiteral("en"));
auto langs = getSystemLocale().uiLanguages();
- for (auto it = langs.begin(); it != langs.end(); ++it) {
- (*it).replace(QLatin1Char('-'), QLatin1Char('_'));
- const auto idx = (*it).indexOf(QLatin1Char('_'));
+
+ for (int i = 0; i < langs.size(); i++) {
+ langs[i].replace(QLatin1Char('-'), QLatin1Char('_'));
+ const auto idx = langs[i].indexOf(QLatin1Char('_'));
if (idx > 0) {
- const QString genericLang = (*it).left(idx);
- it = langs.insert(++it, genericLang);
+ // insert the country stripped language to the ideal position,
+ // that is, after the same language dialects.
+ // if langs is [pt_Latn_BR, pt_BR], the pt should be inserted
+ // after pt_BR
+ const QString genericLang = langs[i].left(idx);
+ int j = i + 1;
+ int insertIdx = j;
+ bool found = false;
+ while (j < langs.size()) {
+ if (langs[j] == genericLang) {
+ found = true;
+ break;
+ }
+ if (langs[j].startsWith(genericLang)) {
+ insertIdx = j + 1;
+ }
+ j++;
+ }
+ if (!found) {
+ langs.insert(insertIdx, genericLang);
+ }
}
}
langs.removeDuplicates();
- for (const auto &lang : langs) {
+ for (const auto &lang :
+#if QT_VERSION_MAJOR == 5
+ qAsConst(langs)
+#else
+ std::as_const(langs)
+#endif
+ ) {
if (lang == QLatin1String("en") || loadTranslation(lang)) {
break;
}
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule.cmake
index 8461bea2d9..cbdc78ed54 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule.cmake
@@ -7,32 +7,75 @@
ECMQmlModule
------------
-This file contains helper functions to make it easier to create QML modules. It
-takes care of a number of things that often need to be repeated. It also takes
-care of special handling of QML modules between shared and static builds. When
-building a static version of a QML module, the relevant QML source files are
-bundled into the static library. When using a shared build, the QML plugin and
-relevant QML files are copied to the target's ``RUNTIME_OUTPUT_DIRECTORY`` to make
-it easier to run things directly from the build directory.
+Helper functions to make it easier to create QML modules.
+
+This CMake module lets you create QML-enabled targets, add C++ and QML files
+to them, and finalize the module if needed. When using Qt 6, it allows for
+`declarative registration of QML types `_.
+
+This CMake module reduces boilerplate and takes care of special
+handling of QML modules between shared and static builds:
+
+- When building a static version of a QML module, the relevant QML source
+ files are bundled into the static library.
+
+- When using a shared build, the QML plugin and relevant QML files are copied
+ to the target's ``RUNTIME_OUTPUT_DIRECTORY`` to make it easier to run things
+ directly from the build directory.
Since 6.0.0, when using Qt 6, most functionality of this module has been
implemented by upstream Qt. Most of the functions here will now forward to the
similar Qt functions.
-Example usage:
+Example usage with an executable as backing target:
.. code-block:: cmake
- ecm_add_qml_module(ExampleModule URI "org.example.Example")
+ add_executable(app)
+ ecm_add_qml_module(app
+ URI "org.example.Example"
+ )
- target_sources(ExampleModule PRIVATE ExamplePlugin.cpp)
- target_link_libraries(ExampleModule PRIVATE Qt::Quick)
+ target_sources(app PRIVATE main.cpp)
+ target_link_libraries(app PRIVATE Qt::Quick)
- ecm_target_qml_sources(ExampleModule SOURCES ExampleItem.qml) # This will have 1.0 as the default version
- ecm_target_qml_sources(ExampleModule SOURCES AnotherExampleItem.qml VERSION 1.5)
+ ecm_target_qml_sources(app SOURCES ExampleItem.qml) # This will have 1.0 as the default version
+ ecm_target_qml_sources(app SOURCES AnotherExampleItem.qml VERSION 1.5)
- ecm_finalize_qml_module(ExampleModule DESTINATION ${KDE_INSTALL_QMLDIR})
+ install(TARGETS app ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+The above example creates an executable target, modifies the target to allow it
+to accept QML files and properties, adds source files to it, and installs it.
+
+The executable is the backing target for the QML module, which in practical
+terms means the QML module is "embedded" into the executable, always being
+loaded as part of the application, and no plugin library is created.
+
+Example usage with a separate QML module:
+
+.. code-block:: cmake
+
+ add_library(ExampleModule)
+ ecm_add_qml_module(ExampleModule
+ URI org.example.Example
+ GENERATE_PLUGIN_SOURCE
+ )
+
+ target_sources(ExampleModule PRIVATE ExamplePlugin.cpp)
+ target_link_libraries(ExampleModule PRIVATE Qt::Quick)
+
+ ecm_target_qml_sources(ExampleModule SOURCES ExampleItem.qml)
+
+ ecm_finalize_qml_module(ExampleModule DESTINATION ${KDE_INSTALL_QMLDIR})
+
+ install(TARGETS ExampleModule ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
+
+The above example creates a library target, modifies the target to allow it to accept QML files and
+properties, adds source files to it, and finalizes the target.
+
+The library acts as a plugin that is expected to be linked to an
+executable later on, in which case ``GENERATE_PLUGIN_SOURCE`` and
+``ecm_finalize_qml_module()`` are both required.
::
@@ -43,6 +86,8 @@ Example usage:
[CLASSNAME ] # Deprecated since 6.0.0 when using Qt 6, use CLASS_NAME instead
[QT_NO_PLUGIN] # Since 6.0.0, when using Qt 6
[GENERATE_PLUGIN_SOURCE] # Since 6.0.0, when using Qt 6
+ [DEPENDENCIES ...] # Since 6.0.0, when using Qt 6, inherited from qt_add_qml_module()
+ [IMPORTS ...] # Since 6.0.0, when using Qt 6, inherited from qt_add_qml_module()
)
This will declare a new CMake target called ````. The ``URI``
@@ -54,8 +99,9 @@ version that is used by ``ecm_target_qml_sources`` when adding QML files. If it
is not specified, a default of 1.0 is used. Additionally, if a version greater
than or equal to 2.0 is specified, the major version is appended to the
Qt5 installation path of the module.
-In case you don't specify and version, but specify a version for the individual sources, the latest
-will be set as the resulting version for this plugin. This will be used in the ECMFindQmlModule module.
+In case you don't specify a version for the module, but specify a version for
+the individual sources, the latter will be set as the resulting version for
+this module. This will also be used in the ECMFindQmlModule module.
If the option ``NO_PLUGIN`` is set, a target is declared that is not expected to
contain any C++ QML plugin.
@@ -73,14 +119,28 @@ Since 6.0.0, when used with Qt 6, this will forward to ``qt_add_qml_module``. An
be forwarded as well. The ``NO_PLUGIN`` argument is deprecated and implies ``GENERATE_PLUGIN_SOURCE``,
since modules in Qt 6 always require a plugin or backing target. If you want to use Qt's behaviour for
``NO_PLUGIN``, use ``QT_NO_PLUGIN`` instead. Additionally, to maintain backward compatibility, by
-default we pass ``NO_GENERATE_PLUGIN_SOURCE`` to ``qt_add_qml_module``. To have Qt generate the plugin
-sources, pass ``GENERATE_PLUGIN_SOURCE``.
+default we pass ``NO_GENERATE_PLUGIN_SOURCE`` to ``qt_add_qml_module``.
+
+If you are using the executable as backing target for your QML module, the
+default behavior should suffice. If you are using a separate QML module,
+you will need to have Qt generate the plugin sources, in which case you
+should pass ``GENERATE_PLUGIN_SOURCE``.
+
+The ``DEPENDENCIES`` and ``IMPORTS`` options come from ``qt_add_qml_module()``
+since Qt 6, and behave as in upstream Qt.
+
+Use ``DEPENDENCIES`` for things like "QtCore", "QtQuick", "your.custom.qmlmodule",
+as well as C++ only dependencies. This is required for QML-exposed C++ code, like when subclassing a type or using it as a parameter type in properties and invokables.
+
+Use ``IMPORTS`` to make a type available a part of a module's public interface. In other words, if a QML file imports this module, it also imports all the modules listed under IMPORTS.
+
+See `Declaring module dependencies `_ and `10 Tips to Make Your QML Code Faster and More Maintainable `_ for details.
::
ecm_add_qml_module_dependencies( DEPENDS [ ...])
-Add the list of dependencies specified by the ``DEPENDS`` argument to be listed
+Adds the list of dependencies specified by the ``DEPENDS`` argument to be listed
as dependencies in the generated QMLDIR file of ````.
Since 5.91.0
@@ -92,7 +152,7 @@ Since 6.0.0, this is deprecated and ignored when using Qt 6, instead use the
ecm_target_qml_sources( SOURCES [ ...] [VERSION ] [PATH ] [PRIVATE])
-Add the list of QML files specified by the ``SOURCES`` argument as source files
+Adds the list of QML files specified by the ``SOURCES`` argument as source files
to the QML module target ````.
If the optional ``VERSION`` argument is specified, all QML files will be added
@@ -128,20 +188,24 @@ to ``qt_target_qml_sources()``.
[EXPORT ] # Added for 6.8 when using Qt 6
)
-Finalize the specified QML module target. This must be called after all other
-setup (like adding sources) on the target has been done. It will perform a
-number of tasks:
+Finalizes the specified QML module target.
+
+This is required in case you do not use the executable as backing target.
+
+This must be called after all other setup (like adding sources) on the target
+has been done. It will perform a number of tasks:
- It will generate a qmldir file from the QML files added to the target. If the
module has a C++ plugin, this will also be included in the qmldir file.
- If ``BUILD_SHARED_LIBS`` is off, a QRC file is generated from the QML files
added to the target. This QRC file will be included when compiling the C++ QML
- module. The built static library will be installed in a subdirection of
- ``DESTINATION`` based on the QML module's uri. If this value is not set, KDE_INSTALL_QMLDIR will be used.
- Note that if ``NO_PLUGIN`` is set, a C++ QML plugin will be generated to include the QRC files.
-- If ``BUILD_SHARED_LIBS`` in on, all generated files, QML sources and the C++
- plugin will be installed in a subdirectory of ``DESTINATION`` based upon the
- QML module's uri. In addition, these files will also be copied to the target's
+ module. The built static library will be installed in a subdirectory of
+ ``DESTINATION`` based on the QML module's URI. If this value is not set,
+ KDE_INSTALL_QMLDIR will be used. Note that if ``NO_PLUGIN`` is set, a C++
+ QML plugin will be generated to include the QRC files.
+- If ``BUILD_SHARED_LIBS`` is on, all generated files, QML sources and the C++
+ plugin will be installed in a subdirectory of ``DESTINATION`` based on the
+ QML module's URI. In addition, these files will also be copied to the target's
``RUNTIME_OUTPUT_DIRECTORY`` in a similar subdirectory.
- If ``BUILD_SHARED_LIBS`` is off, ``EXPORT`` allows to specify a CMake export set
all installed targets should be added to.
@@ -157,10 +221,20 @@ default to ``PROJECT_VERSION`` and which will write a file that is used by
Since 6.1.0
-Enabling the option ``VERBOSE_QML_COMPILER`` will activate verbose output for qmlcachegen.
+Enabling the global option ``VERBOSE_QML_COMPILER`` during CMake configuration
+will activate verbose output for qmlcachegen.
+
+Since 6.18.0
+
+Generate code from qmlcachegen is put into the same ``UNITY_GROUP``. Unity builds
+using this can either be activated manually per target or with the ``ECM_QMLCACHE_UNITY_BUILD``
+option globally. This can speed up clean builds at the expense of needing more memory
+and making incremental builds slower.
#]========================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake)
# This is also used by ECMFindQmlModule, so needs to be available for both
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule5.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule5.cmake
index 2c96710e95..87aa583972 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule5.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule5.cmake
@@ -5,6 +5,8 @@
# Qt 5 implementation of ECMQmlModule
+cmake_policy(VERSION 3.16)
+
set(_ECM_QMLMODULE_STATIC_QMLONLY_H "${CMAKE_CURRENT_LIST_DIR}/ECMQmlModule.h.in")
set(_ECM_QMLMODULE_STATIC_QMLONLY_CPP "${CMAKE_CURRENT_LIST_DIR}/ECMQmlModule.cpp.in")
@@ -333,7 +335,7 @@ function(ecm_finalize_qml_module ARG_TARGET)
WORKING_DIRECTORY ${_runtime_output_dir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_path}
COMMAND ${CMAKE_COMMAND} -E copy ${_file} ${_file_path}
- BYPRODUCTS ${_file_path}/${_filename}
+ BYPRODUCTS ${_runtime_output_dir}/${_file_path}/${_filename}
)
endforeach()
endfunction()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule6.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule6.cmake
index 3aa08deb4b..66fa0a5d57 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule6.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQmlModule6.cmake
@@ -5,9 +5,9 @@
# Qt 6 implementation of ECMQmlModule
-set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS ON)
+cmake_policy(VERSION 3.16)
+
find_package(Qt6 COMPONENTS Core Qml CONFIG)
-unset(QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
if (NOT TARGET Qt6::Qml)
message(WARNING "Target Qt6::Qml was not found. ECMQmlModule requires the QML module when building with Qt 6")
@@ -23,6 +23,19 @@ endif()
# Stop warning about a changed import prefix.
qt6_policy(SET QTP0001 NEW)
+option(ECM_QMLCACHE_UNITY_BUILD "Perform unity builds for source files produced by qmlcachegen." OFF)
+
+# Internal, puts all qmlcachegen cpp source files into the same unity build group
+function(_ecm_qml_module_setup_unity_group ARG_TARGET)
+ get_target_property(_sources ${ARG_TARGET} SOURCES)
+ foreach(_src ${_sources})
+ string(REGEX MATCH "\\.rcc/qmlcache/" _is_qmlcache ${_src})
+ if (_is_qmlcache)
+ set_source_files_properties(${_src} PROPERTIES UNITY_GROUP "qmlcache")
+ endif()
+ endforeach()
+endfunction()
+
function(ecm_add_qml_module ARG_TARGET)
cmake_parse_arguments(PARSE_ARGV 1 ARG "NO_PLUGIN;QT_NO_PLUGIN;GENERATE_PLUGIN_SOURCE" "URI;VERSION;CLASSNAME;OUTPUT_TARGETS" "")
@@ -60,7 +73,7 @@ function(ecm_add_qml_module ARG_TARGET)
endif()
if (NOT ARG_GENERATE_PLUGIN_SOURCE)
- list(APPEND _arguments NO_GENERATE_PLUGIN_SOURCE)
+ list(APPEND _arguments NO_GENERATE_PLUGIN_SOURCE NO_PLUGIN_OPTIONAL)
endif()
if (NOT TARGET ${ARG_TARGET})
@@ -107,6 +120,9 @@ function(ecm_add_qml_module ARG_TARGET)
)
endif()
+ _ecm_qml_module_setup_unity_group(${ARG_TARGET})
+ set_target_properties(${ARG_TARGET} PROPERTIES UNITY_BUILD_MODE GROUP)
+ set_target_properties(${ARG_TARGET} PROPERTIES UNITY_BUILD ${ECM_QMLCACHE_UNITY_BUILD})
endfunction()
function(ecm_add_qml_module_dependencies ARG_TARGET)
@@ -159,6 +175,7 @@ function(ecm_target_qml_sources ARG_TARGET)
list(APPEND _ecm_output_targets ${_out_targets})
set_target_properties(${ARG_TARGET} PROPERTIES _ecm_output_targets "${_ecm_output_targets}")
+ _ecm_qml_module_setup_unity_group(${ARG_TARGET})
endfunction()
function(ecm_finalize_qml_module ARG_TARGET)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQtDeclareLoggingCategory.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQtDeclareLoggingCategory.cmake
index 9af9011b96..569ed9174d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQtDeclareLoggingCategory.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQtDeclareLoggingCategory.cmake
@@ -150,6 +150,8 @@ Example usage:
Since 5.68.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
set(_ECM_QT_DECLARE_LOGGING_CATEGORY_TEMPLATE_CPP "${CMAKE_CURRENT_LIST_DIR}/ECMQtDeclareLoggingCategory.cpp.in")
set(_ECM_QT_DECLARE_LOGGING_CATEGORY_TEMPLATE_H "${CMAKE_CURRENT_LIST_DIR}/ECMQtDeclareLoggingCategory.h.in")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQmake.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQmake.cmake
index 4277eeeac2..afcab16e13 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQmake.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQmake.cmake
@@ -1,3 +1,5 @@
+cmake_policy(VERSION 3.16)
+
if (${ECM_GLOBAL_FIND_VERSION} VERSION_GREATER_EQUAL 5.93)
message(DEPRECATION "ECMQueryQmake.cmake is deprecated since 5.93, please use ECMQueryQt.cmake instead.")
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQt.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQt.cmake
index 639b2b5717..0d4014d709 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQt.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMQueryQt.cmake
@@ -35,6 +35,8 @@ If the call succeeds ``${bin_dir}`` will be set to ``/path/to/bin/dir``
Since: 5.93
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake)
include(CheckLanguage)
check_language(CXX)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupQtPluginMacroNames.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupQtPluginMacroNames.cmake
index 64fa949f51..c979275cfb 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupQtPluginMacroNames.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupQtPluginMacroNames.cmake
@@ -11,6 +11,7 @@ Instruct CMake's automoc about C++ preprocessor macros used to define Qt-style p
::
ecm_setup_qtplugin_macro_names(
+ [MACRO_NAMES [ [...]]] # since 6.18
[JSON_NONE [ [...]]]
[JSON_ARG1 [ [...]]]
[JSON_ARG2 [ [...]]]
@@ -21,21 +22,28 @@ CMake's automoc needs some support when parsing C++ source files to detect wheth
should be run on those files and if there are also dependencies on other files, like those
with Qt plugin metadata in JSON format. Because automoc just greps overs the raw plain text
of the sources without any C++ preprocessor-like processing.
-CMake in newer versions provides the variables ``CMAKE_AUTOMOC_DEPEND_FILTERS`` (CMake >= 3.9.0)
-and ``CMAKE_AUTOMOC_MACRO_NAMES`` (CMake >= 3.10) to allow the developer to assist automoc.
+CMake in newer versions provides the variable ``CMAKE_AUTOMOC_MACRO_NAMES`` (CMake >= 3.10)
+to allow the developer to assist automoc. For Qt up to version 5.15 additionally
+the variable ``CMAKE_AUTOMOC_DEPEND_FILTERS`` (CMake >= 3.9.0) can be used.
This macro cares for the explicit setup needed for those variables for common cases of
C++ preprocessor macros used for Qt-style plugins.
+``MACRO_NAMES`` lists the names of C++ preprocessor macros for Qt-style plugins.
+Requires at least Qt 5.15. Since 6.18.
+
``JSON_NONE`` lists the names of C++ preprocessor macros for Qt-style plugins which do not refer to
-external files with the plugin metadata.
+external files with the plugin metadata. Use ``MACRO_NAMES`` instead for Qt >= 5.15.
``JSON_ARG1`` lists the names of C++ preprocessor macros for Qt-style plugins where the first argument
to the macro is the name of the external file with the plugin metadata.
+Use ``MACRO_NAMES`` instead for Qt >= 5.15.
``JSON_ARG2`` is the same as ``JSON_ARG1`` but with the file name being the second argument.
+Use ``MACRO_NAMES`` instead for Qt >= 5.15.
``JSON_ARG3`` is the same as ``JSON_ARG1`` but with the file name being the third argument.
+Use ``MACRO_NAMES`` instead for Qt >= 5.15.
``CONFIG_CODE_VARIABLE`` specifies the name of the variable which will get set as
value some generated CMake code for instructing automoc for the given macro names,
@@ -63,7 +71,7 @@ In the CMake buildsystem of the library one calls
.. code-block:: cmake
ecm_setup_qtplugin_macro_names(
- JSON_ARG2
+ MACRO_NAMES
EXPORT_MYPLUGIN_WITH_JSON
)
@@ -79,7 +87,7 @@ automoc about the usage of that macro.
.. code-block:: cmake
ecm_setup_qtplugin_macro_names(
- JSON_ARG2
+ MACRO_NAMES
EXPORT_MYPLUGIN_WITH_JSON
CONFIG_CODE_VARIABLE
PACKAGE_SETUP_AUTOMOC_VARIABLES
@@ -97,12 +105,14 @@ automoc is instructed as well as needed:
Since 5.45.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
include(CMakePackageConfigHelpers)
macro(ecm_setup_qtplugin_macro_names)
set(options )
set(oneValueArgs CONFIG_CODE_VARIABLE)
- set(multiValueArgs JSON_NONE JSON_ARG1 JSON_ARG2 JSON_ARG3)
+ set(multiValueArgs MACRO_NAMES JSON_NONE JSON_ARG1 JSON_ARG2 JSON_ARG3)
cmake_parse_arguments(ESQMN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -110,17 +120,33 @@ macro(ecm_setup_qtplugin_macro_names)
message(FATAL_ERROR "Unknown keywords given to ECM_SETUP_QTPLUGIN_MACRO_NAMES(): \"${ESQMN_UNPARSED_ARGUMENTS}\"")
endif()
+ if(ESQMN_MACRO_NAMES)
+ if(ESQMN_JSON_NONE OR ESQMN_JSON_ARG1 OR ESQMN_JSON_ARG2 OR ESQMN_JSON_ARG3)
+ message(FATAL_ERROR "Use either MACRO_NAMES or any of the JSON_* arguments with ECM_SETUP_QTPLUGIN_MACRO_NAMES()")
+ endif()
+ set(_macro_names ${ESQMN_MACRO_NAMES})
+ else()
+ # nag user to switch to newer args when possible (Qt 5.15 projects ignored nere)
+ if (ECM_GLOBAL_FIND_VERSION VERSION_GREATER_EQUAL 6.18 AND QT_MAJOR_VERSION EQUAL 6)
+ message(WARNING "For ECM >= 6.18, use the MACRO_NAMES argument instead of the JSON_* ones with ECM_SETUP_QTPLUGIN_MACRO_NAMES()")
+ endif()
+
+ set(_macro_names
+ ${ESQMN_JSON_NONE}
+ ${ESQMN_JSON_ARG1}
+ ${ESQMN_JSON_ARG2}
+ ${ESQMN_JSON_ARG3}
+ )
+ endif()
+
+
# CMAKE_AUTOMOC_MACRO_NAMES
- list(APPEND CMAKE_AUTOMOC_MACRO_NAMES
- ${ESQMN_JSON_NONE}
- ${ESQMN_JSON_ARG1}
- ${ESQMN_JSON_ARG2}
- ${ESQMN_JSON_ARG3}
- )
+ list(APPEND CMAKE_AUTOMOC_MACRO_NAMES ${_macro_names})
# CMAKE_AUTOMOC_DEPEND_FILTERS
# CMake's automoc needs help to find names of plugin metadata files in case Q_PLUGIN_METADATA
# is indirectly used via other C++ preprocessor macros
+ # Note: unused for Qt >= 5.15.
foreach(macro_name ${ESQMN_JSON_ARG1})
list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
"${macro_name}"
@@ -152,16 +178,10 @@ macro(ecm_setup_qtplugin_macro_names)
"####################################################################################
# CMAKE_AUTOMOC
")
- set(_all_macro_names
- ${ESQMN_JSON_NONE}
- ${ESQMN_JSON_ARG1}
- ${ESQMN_JSON_ARG2}
- ${ESQMN_JSON_ARG3}
- )
string(APPEND _content "
# CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros.
# 3.10+ lets us provide more macro names that require automoc.
-foreach(macro_name ${_all_macro_names})
+foreach(macro_name ${_macro_names})
# we can be run multiple times, so add only once
list (FIND CMAKE_AUTOMOC_MACRO_NAMES \"\${macro_name}\" _index)
if(_index LESS 0)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupVersion.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupVersion.cmake
index 7164c9a0bd..a40c448474 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupVersion.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSetupVersion.cmake
@@ -36,8 +36,8 @@ version of ECM is < 5.83)::
_VERSION_STRING - (use _VERSION instead)
-If CMake policy CMP0048 is not ``NEW``, the following CMake variables will also
-be set::
+With CMake versions older than 4.0.0 and if CMake policy CMP0048 is not ``NEW``,
+the following CMake variables will also be set::
PROJECT_VERSION_MAJOR -
PROJECT_VERSION_MINOR -
@@ -72,8 +72,8 @@ relative path, it is interpreted as relative to ``CMAKE_CURRENT_BINARY_DIR``. Th
optional ``COMPATIBILITY`` option is forwarded to
``write_basic_package_version_file()``, and defaults to ``AnyNewerVersion``.
-If CMake policy CMP0048 is ``NEW``, an alternative form of the command is
-available::
+With CMake versions >= 4.0.0 or if CMake policy CMP0048 is ``NEW``, an alternative
+form of the command is available::
ecm_setup_version(PROJECT
[VARIABLE_PREFIX ]
@@ -91,6 +91,13 @@ Since pre-1.0.0.
``COMPATIBILITY`` option available since 1.6.0.
#]=======================================================================]
+# cache set policy at time of module inclusion
+if(CMAKE_MAJOR_VERSION VERSION_LESS 4)
+ cmake_policy(GET CMP0048 _ecm_setup_version_project_version_policy)
+endif()
+
+cmake_policy(VERSION 3.16)
+
include(CMakePackageConfigHelpers)
# save the location of the header template while CMAKE_CURRENT_LIST_DIR
@@ -110,14 +117,20 @@ function(ecm_setup_version _version)
set(project_manages_version FALSE)
set(use_project_version FALSE)
- cmake_policy(GET CMP0048 project_version_policy)
- if(project_version_policy STREQUAL "NEW")
+ if(CMAKE_MAJOR_VERSION VERSION_GREATER_EQUAL 4)
set(project_manages_version TRUE)
if(_version STREQUAL "PROJECT")
set(use_project_version TRUE)
endif()
- elseif(_version STREQUAL "PROJECT")
- message(FATAL_ERROR "ecm_setup_version given PROJECT argument, but CMP0048 is not NEW")
+ else()
+ if(_ecm_setup_version_project_version_policy STREQUAL "NEW")
+ set(project_manages_version TRUE)
+ if(_version STREQUAL "PROJECT")
+ set(use_project_version TRUE)
+ endif()
+ elseif(_version STREQUAL "PROJECT")
+ message(FATAL_ERROR "ecm_setup_version given PROJECT argument, but CMP0048 is not NEW")
+ endif()
endif()
set(should_set_prefixed_vars TRUE)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSourceVersionControl.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSourceVersionControl.cmake
index 36bc78c7ba..1b347132ac 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSourceVersionControl.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMSourceVersionControl.cmake
@@ -15,6 +15,8 @@ svn checkout, etc).
Since 5.63
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
if(EXISTS "${CMAKE_SOURCE_DIR}/.git" OR
EXISTS "${CMAKE_SOURCE_DIR}/.svn" OR
EXISTS "${CMAKE_SOURCE_DIR}/.hg" OR
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUninstallTarget.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUninstallTarget.cmake
index 7298012da7..bc1c68f5b2 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUninstallTarget.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUninstallTarget.cmake
@@ -35,6 +35,8 @@ not possible to run CMake on the project and then immediately run the
Since 1.7.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
if (NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/ecm_uninstall.cmake.in"
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUseFindModules.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUseFindModules.cmake
index d1e7345591..3f6d980a73 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUseFindModules.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMUseFindModules.cmake
@@ -52,6 +52,8 @@ library).
Since pre-1.0.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ecm_use_find_modules)
set(_options NO_OVERRIDE )
set(_oneValueArgs DIR )
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMWinResolveSymlinks.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMWinResolveSymlinks.cmake
index 392ed93e2a..3e5e67d405 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMWinResolveSymlinks.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ECMWinResolveSymlinks.cmake
@@ -25,6 +25,8 @@ icons implemented as symlinks.
Since 5.28
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
function(ECM_WIN_RESOLVE_SYMLINKS _dir)
get_filename_component(dir ${_dir} ABSOLUTE)
find_program(GIT_EXECUTABLE git)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/QtVersionOption.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/QtVersionOption.cmake
index 0ea036585c..63f3ffa4c3 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/QtVersionOption.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/QtVersionOption.cmake
@@ -20,6 +20,8 @@ Otherwise Qt5 is picked.
Since 5.82.0.
#]=======================================================================]
+cmake_policy(VERSION 3.16)
+
if (DEFINED QT_MAJOR_VERSION)
return()
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/check-outbound-license.py b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/check-outbound-license.py
index a0dd225c4a..a34b725e5d 100755
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/check-outbound-license.py
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/check-outbound-license.py
@@ -24,7 +24,8 @@ compatibilityMatrix = {
"MIT",
"BSD-2-Clause",
"BSD-3-Clause",
- "bzip2-1.0.6"],
+ "bzip2-1.0.6",
+ "BSL-1.0"],
"LGPL-2.1-only": [
"CC0-1.0",
"LGPL-2.0-or-later",
@@ -33,7 +34,8 @@ compatibilityMatrix = {
"MIT",
"BSD-2-Clause",
"BSD-3-Clause",
- "bzip2-1.0.6"],
+ "bzip2-1.0.6",
+ "BSL-1.0"],
"LGPL-3.0-only": [
"CC0-1.0",
"LGPL-2.0-or-later",
@@ -44,7 +46,8 @@ compatibilityMatrix = {
"MIT",
"BSD-2-Clause",
"BSD-3-Clause",
- "bzip2-1.0.6"],
+ "bzip2-1.0.6",
+ "BSL-1.0"],
"GPL-2.0-only": [
"CC0-1.0",
"LGPL-2.0-only",
@@ -56,7 +59,8 @@ compatibilityMatrix = {
"MIT",
"BSD-2-Clause",
"BSD-3-Clause",
- "bzip2-1.0.6"],
+ "bzip2-1.0.6",
+ "BSL-1.0"],
"GPL-3.0-only": [
"CC0-1.0",
"LGPL-2.0-or-later",
@@ -71,7 +75,8 @@ compatibilityMatrix = {
"MIT",
"BSD-2-Clause",
"BSD-3-Clause",
- "bzip2-1.0.6"]
+ "bzip2-1.0.6",
+ "BSL-1.0"]
}
def check_outbound_license(license, files, spdxDictionary):
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ecm_uninstall.cmake.in b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ecm_uninstall.cmake.in
index bb908b358e..37ed824999 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ecm_uninstall.cmake.in
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/modules/ecm_uninstall.cmake.in
@@ -1,3 +1,5 @@
+cmake_policy(VERSION 3.16)
+
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
endif()
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/CMakeLists.txt
index 668ea3db12..3163e3f3e8 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/CMakeLists.txt
@@ -115,6 +115,7 @@ set(KDEInstallDirsTest.relative_or_absolute_usr_EXTRA_OPTIONS
-DAUTOSTARTDIR_should_be_absolute=TRUE
-DCONFDIR_should_be_absolute=TRUE
-DSYSCONFDIR_should_be_absolute=TRUE
+ -DLOCALSTATEDIR_should_be_absolute=TRUE
)
add_test_variant(KDEInstallDirsTest.relative_or_absolute_usr
KDEInstallDirsTest.relative_or_absolute dummy)
@@ -173,6 +174,27 @@ add_test_macro(KDEPackageAppTemplatesTest
${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/KDEPackageAppTemplatesTest/check.cmake"
)
+set(KDEPackageAppTemplatesCrossTest_EXTRA_OPTIONS
+ --build-target install
+ --build-options
+ "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/KDEPackageAppTemplatesCrossTest/InstallDirectory"
+)
+add_test_macro(KDEPackageAppTemplatesCrossTest
+ ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/KDEPackageAppTemplatesCrossTest/check.cmake"
+)
+
+set(KDEPackageAppTemplatesForcedTest_EXTRA_OPTIONS
+ --build-target install
+ --build-options
+ -DKDE_INSTALL_APP_TEMPLATES=ON
+ "-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/KDEPackageAppTemplatesForcedTest/InstallDirectory"
+)
+add_test_macro(KDEPackageAppTemplatesForcedTest
+ ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/KDEPackageAppTemplatesForcedTest/check.cmake"
+)
+
+
+
if (TARGET Qt${QT_MAJOR_VERSION}::Core AND TARGET Qt${QT_MAJOR_VERSION}::lconvert)
set(ECMPoQmToolsTest_EXTRA_OPTIONS
--build-target install
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/CMakeLists.txt
index 83317f7df2..ca82c7e940 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/CMakeLists.txt
@@ -33,6 +33,26 @@ macro(add_check NAME)
)
endmacro()
+macro(add_nameprefix_test NAME)
+ string(REPLACE "." "/" dir "${NAME}")
+ string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}")
+ add_test(
+ NAME ecm_add_tests-${NAME}
+ COMMAND
+ ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/${dir}"
+ "${CMAKE_CURRENT_BINARY_DIR}/${dir}"
+ --build-two-config
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-project ${proj}
+ --build-options -DBUILD_TESTING:BOOL=ON
+ ${${NAME}_EXTRA_OPTIONS}
+ --test-command "${CMAKE_CTEST_COMMAND}"
+ )
+endmacro()
+
add_check(single_tests
test1.txt
test2.txt
@@ -56,3 +76,5 @@ add_check(multi_tests
test1011_dir/test11.txt
)
+add_nameprefix_test(nameprefix_by_var_tests)
+add_nameprefix_test(nameprefix_by_path_tests)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/CMakeLists.txt
index ff15c99297..c3441a98b6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/multi_tests/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
project(ECMAddTests)
set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules)
@@ -194,3 +194,24 @@ get_property(_is_bundle TARGET test11 PROPERTY MACOSX_BUNDLE)
if (_is_bundle)
message(FATAL_ERROR "test11 is an OS/X bundle when it should not be")
endif()
+
+set(exp_env "TEST_ENV=1")
+ecm_add_tests(
+ test12.cpp
+ test13.cpp
+ LINK_LIBRARIES testhelper
+ ENVIRONMENT ${exp_env}
+ )
+get_property(_env TEST test12 PROPERTY ENVIRONMENT)
+assert_vars_setequal(_env exp_env)
+get_property(_env TEST test13 PROPERTY ENVIRONMENT)
+assert_vars_setequal(_env exp_env)
+
+set(exp_compile_def "-DTEST_DEF=1")
+ecm_add_tests(
+ test14.cpp
+ test15.cpp
+ LINK_LIBRARIES testhelper
+ COMPILE_DEFINITIONS ${exp_compile_def}
+ )
+# The checks are carried out by executing the executable file created
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/CMakeLists.txt
index 3a619f78e3..8b5a28655d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMAddTests/single_tests/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.10)
project(ECMAddTests)
set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules)
@@ -30,9 +30,15 @@ file(REMOVE_RECURSE
"${CMAKE_CURRENT_BINARY_DIR}/test7_dir"
)
+set(exp_target_name "test1")
+set(exp_test_name "test1")
ecm_add_test(test1.cpp
LINK_LIBRARIES testhelper
+ TARGET_NAME_VAR target_name
+ TEST_NAME_VAR test_name
)
+assert_vars_setequal(target_name exp_target_name)
+assert_vars_setequal(test_name exp_test_name)
# check target exists
get_property(_dummy TARGET test1 PROPERTY TYPE)
# check test exists
@@ -63,10 +69,16 @@ if (_is_bundle)
endif()
+set(exp_target_name "test3")
+set(exp_test_name "prefix_test3")
ecm_add_test(test3.cpp
LINK_LIBRARIES testhelper
NAME_PREFIX prefix_
+ TARGET_NAME_VAR target_name
+ TEST_NAME_VAR test_name
)
+assert_vars_setequal(target_name exp_target_name)
+assert_vars_setequal(test_name exp_test_name)
get_property(_dummy TARGET test3 PROPERTY TYPE)
get_property(_dummy TEST prefix_test3 PROPERTY TIMEOUT)
get_property(_is_win32 TARGET test3 PROPERTY WIN32_EXECUTABLE)
@@ -147,3 +159,20 @@ get_property(_is_bundle TARGET test7 PROPERTY MACOSX_BUNDLE)
if (_is_bundle)
message(FATAL_ERROR "test7 is an OS/X bundle when it should not be")
endif()
+
+set(exp_env "TEST_ENV=1")
+ecm_add_test(test8.cpp
+ TEST_NAME test8
+ LINK_LIBRARIES testhelper
+ ENVIRONMENT ${exp_env}
+ )
+get_property(_env TEST test8 PROPERTY ENVIRONMENT)
+assert_vars_setequal(_env exp_env)
+
+set(exp_compile_def "-DTEST_DEF=1")
+ecm_add_test(test9.cpp
+ TEST_NAME test9
+ LINK_LIBRARIES testhelper
+ COMPILE_DEFINITIONS ${exp_compile_def}
+ )
+# The checks are carried out by executing the executable file created
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/CMakeLists.txt
index 1752dcafe8..de6b806958 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/CMakeLists.txt
@@ -1,12 +1,15 @@
set(installation_path "${CMAKE_CURRENT_BINARY_DIR}/installation/")
-macro(add_generate_export_header_library_test _exclude_deprecated_before_and_at)
- if("${ARGV1}" STREQUAL "WITH_GROUP")
+macro(add_generate_export_header_library_test _exclude_deprecated_before_and_at _deprecated_attribute_type)
+ if("${ARGV2}" STREQUAL "WITH_GROUP")
set(_set_group_option "-DSET_GROUP=TRUE")
set(_library_buildname "library-${_exclude_deprecated_before_and_at}-group")
else()
set(_library_buildname "library-${_exclude_deprecated_before_and_at}")
endif()
+ if (${_deprecated_attribute_type} STREQUAL "COMPILER")
+ string(APPEND _library_buildname "-compiler")
+ endif()
add_test(NAME ecm_generate_export_header-build-${_library_buildname}
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -19,19 +22,23 @@ macro(add_generate_export_header_library_test _exclude_deprecated_before_and_at)
--build-target install
--build-options
"-DEXCLUDE_DEPRECATED_BEFORE_AND_AT=${_exclude_deprecated_before_and_at}"
+ "-DDEPRECATED_ATTRIBUTE_TYPE:STRING=${_deprecated_attribute_type}"
"-DCMAKE_INSTALL_PREFIX:PATH=${installation_path}/${_library_buildname}"
${_set_group_option}
--test-command dummy
)
endmacro()
-macro(add_generate_export_header_consumer_test _test_variant _exclude_deprecated_before_and_at _group_test_mode _consumer_build)
+macro(add_generate_export_header_consumer_test _test_variant _exclude_deprecated_before_and_at _deprecated_attribute_type _group_test_mode _consumer_build)
set(_extra_build_options ${ARGN})
- if(_group_test_mode STREQUAL "GROUPLESS")
+ if(${_group_test_mode} STREQUAL "GROUPLESS")
set(_library "library-${_exclude_deprecated_before_and_at}")
else()
set(_library "library-${_exclude_deprecated_before_and_at}-group")
endif()
+ if (${_deprecated_attribute_type} STREQUAL "COMPILER")
+ string(APPEND _library "-compiler")
+ endif()
add_test(NAME ecm_generate_export_header-${_consumer_build}
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -44,6 +51,7 @@ macro(add_generate_export_header_consumer_test _test_variant _exclude_deprecated
--build-options
"-DTEST_VARIANT:STRING=${_test_variant}"
"-DDEPRECATED_EXCLUDED_BEFORE_AND_AT:STRING=${_exclude_deprecated_before_and_at}"
+ "-DDEPRECATED_ATTRIBUTE_TYPE:STRING=${_deprecated_attribute_type}"
"-DLIBRARY:STRING=${_library}"
"-DGROUP_MODE:STRING=${_group_test_mode}"
${_extra_build_options}
@@ -64,6 +72,7 @@ macro(add_generate_export_header_consumer_disable_deprecated_before_and_at_test
)
add_generate_export_header_consumer_test(DISABLE_DEPRECATED_BEFORE_AND_AT
${_exclude_deprecated_before_and_at}
+ "STANDARD"
${_group_test_mode}
${_consumer_build}
${_extra_build_options}
@@ -74,6 +83,7 @@ macro(add_generate_export_header_consumer_no_deprecated_test _exclude_deprecated
set(_consumer_build "consumer-NO-DEPRECATED-${_exclude_deprecated_before_and_at}-${_group_test_mode}")
add_generate_export_header_consumer_test(NO_DEPRECATED
${_exclude_deprecated_before_and_at}
+ "STANDARD"
${_group_test_mode}
${_consumer_build}
)
@@ -90,10 +100,13 @@ math(EXPR _last_index ${library_versions_count}-1)
foreach(_group_arg "" "WITH_GROUP")
foreach(_index RANGE ${_last_index})
list(GET library_versions ${_index} _exclude_deprecated_before_and_at)
- add_generate_export_header_library_test(${_exclude_deprecated_before_and_at} ${_group_arg})
+ add_generate_export_header_library_test(${_exclude_deprecated_before_and_at} "STANDARD" ${_group_arg})
endforeach()
endforeach()
+# test generating the library using compiler-specific deprecation attribute macros
+# no need to repeat covering visibility macros here
+add_generate_export_header_library_test(0 "COMPILER" "")
set(group_test_modes "GROUPLESS" "GROUP_USE_DIRECT" "GROUP_USE_GROUP")
@@ -120,3 +133,13 @@ foreach(_group_test_mode ${group_test_modes})
add_generate_export_header_consumer_no_deprecated_test(${_exclude_deprecated_before_and_at} ${_group_test_mode})
endforeach()
endforeach()
+
+# test with compiler-specific deprecation attribute macros
+# no need to repeat covering visibility macros here
+add_generate_export_header_consumer_test(DISABLE_DEPRECATED_BEFORE_AND_AT
+ "0"
+ "COMPILER"
+ "GROUPLESS"
+ "consumer-compiler"
+ "-DLIBRARY_DISABLE_DEPRECATED_BEFORE_AND_AT:STRING=0"
+)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/consumer/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/consumer/CMakeLists.txt
index a417db43e5..632c6d0779 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/consumer/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/consumer/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(consumer)
@@ -17,28 +17,38 @@ endif()
if(DEPRECATED_EXCLUDED_BEFORE_AND_AT STREQUAL "CURRENT")
set(DEPRECATED_EXCLUDED_BEFORE_AND_AT ${library_version})
endif()
+# skip the tests for enumerators against C++11 for standard-type attributes
+if(${DEPRECATED_ATTRIBUTE_TYPE} STREQUAL "COMPILER")
+ set(_test_enumerator_with_cxx11 TRUE)
+else()
+ set(_test_enumerator_with_cxx11 FALSE)
+endif()
# load the test variant specific testAPI method
include(testAPI_${TEST_VARIANT}.cmake)
# for each API element test their visibility to the compiler and if a warning is emitted
-set(_code "Enum enumerator = Enumerator_deprecatedAt2_0;")
-testAPI(_code DEPRECATED_AT 2.0 CXX_STANDARD 11 BUILD_TIME_ONLY_DISABLABLE NO_WARNING)
+if(_test_enumerator_with_cxx11)
+ set(_code "Enum enumerator = Enumerator_deprecatedAt2_0;")
+ testAPI(_code DEPRECATED_AT 2.0 CXX_STANDARD 11 BUILD_TIME_ONLY_DISABLABLE NO_WARNING)
+endif()
set(_code "Enum enumerator = Enumerator_deprecatedAt2_0;")
-# we do not yet support enumerator warnings with MSVC
-if(MSVC)
+# no support for enumerator warnings with MSVC and compiler-specific attributes
+if(MSVC AND ${DEPRECATED_ATTRIBUTE_TYPE} STREQUAL "COMPILER")
testAPI(_code DEPRECATED_AT 2.0 CXX_STANDARD 17 BUILD_TIME_ONLY_DISABLABLE NO_WARNING)
else()
testAPI(_code DEPRECATED_AT 2.0 CXX_STANDARD 17 BUILD_TIME_ONLY_DISABLABLE)
endif()
-set(_code "Enum enumerator = Enumerator_deprecatedAt2_12;")
-testAPI(_code DEPRECATED_AT 2.12 CXX_STANDARD 11 NO_WARNING)
+if(_test_enumerator_with_cxx11)
+ set(_code "Enum enumerator = Enumerator_deprecatedAt2_12;")
+ testAPI(_code DEPRECATED_AT 2.12 CXX_STANDARD 11 NO_WARNING)
+endif()
set(_code "Enum enumerator = Enumerator_deprecatedAt2_12;")
-# we do not yet support enumerator warnings with MSVC
-if(MSVC)
+# no support for enumerator warnings with MSVC and compiler-specific attributes
+if(MSVC AND ${DEPRECATED_ATTRIBUTE_TYPE} STREQUAL "COMPILER")
testAPI(_code DEPRECATED_AT 2.12 CXX_STANDARD 17 NO_WARNING)
else()
testAPI(_code DEPRECATED_AT 2.12 CXX_STANDARD 17)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/format_version/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/format_version/CMakeLists.txt
index 428a372a0c..b0bbdad139 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/format_version/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/format_version/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(format_version)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/CMakeLists.txt
index eb925c9b37..563369a4d9 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
# keep version in sync with the one used in consumer/CMakeLists.txt for the library
# ideally would be send over by an exported target property,
@@ -21,8 +21,17 @@ if(SET_GROUP)
set(_group_args GROUP_BASE_NAME LIBGROUP)
endif()
+# adapt macro used for enum deprecation
+if(${DEPRECATED_ATTRIBUTE_TYPE} STREQUAL "STANDARD")
+ set(ENUM_DEPRECATION_MACRO_NAME "LIBRARY_DEPRECATED_VERSION")
+else()
+ set(ENUM_DEPRECATION_MACRO_NAME "LIBRARY_ENUMERATOR_DEPRECATED_VERSION")
+endif()
+configure_file(library.hpp.in "${CMAKE_CURRENT_BINARY_DIR}/library.hpp" @ONLY)
+
ecm_generate_export_header(library
${_group_args}
+ DEPRECATED_ATTRIBUTE_TYPE ${DEPRECATED_ATTRIBUTE_TYPE}
VERSION ${library_VERSION}
DEPRECATION_VERSIONS 2.0 2.12
EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
@@ -32,7 +41,7 @@ install(TARGETS library DESTINATION lib EXPORT library_targets)
install(EXPORT library_targets FILE LibraryTargets.cmake DESTINATION lib/library)
install(FILES
- library.hpp
+ "${CMAKE_CURRENT_BINARY_DIR}/library.hpp"
"${CMAKE_CURRENT_BINARY_DIR}/library_export.h"
DESTINATION ${_public_includedir}
)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/library.hpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/library.hpp.in
similarity index 82%
rename from local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/library.hpp
rename to local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/library.hpp.in
index 4b9fc66ae0..1930a7843b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/library.hpp
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateExportHeaderTest/library/library.hpp.in
@@ -2,11 +2,11 @@
enum Enum {
#if LIBRARY_BUILD_DEPRECATED_SINCE(2, 0)
- Enumerator_deprecatedAt2_0 LIBRARY_ENUMERATOR_DEPRECATED_VERSION(2, 0, "Deprecated at 2.0"),
+ Enumerator_deprecatedAt2_0 @ENUM_DEPRECATION_MACRO_NAME@(2, 0, "Deprecated at 2.0"),
#endif
Enumerator_not_deprecated,
#if LIBRARY_ENABLE_DEPRECATED_SINCE(2, 12)
- Enumerator_deprecatedAt2_12 LIBRARY_ENUMERATOR_DEPRECATED_VERSION(2, 12, "Deprecated at 2.12"),
+ Enumerator_deprecatedAt2_12 @ENUM_DEPRECATION_MACRO_NAME@(2, 12, "Deprecated at 2.12"),
#endif
};
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateHeadersTest/run_test.cmake.config b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateHeadersTest/run_test.cmake.config
index e28e12088e..89d86cf58b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateHeadersTest/run_test.cmake.config
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGenerateHeadersTest/run_test.cmake.config
@@ -9,7 +9,7 @@ include(ECMGenerateHeaders)
function (check_files)
set(options)
- set(oneValueArgs GENERATED ORIGINALS)
+ set(oneValueArgs GENERATED ORIGINALS INCLUDE_PATHS)
set(multiValueArgs)
cmake_parse_arguments(CF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
list(LENGTH CF_GENERATED count)
@@ -17,12 +17,16 @@ function (check_files)
foreach(i RANGE ${last})
list(GET CF_GENERATED ${i} generated_file)
list(GET CF_ORIGINALS ${i} original_file)
+ list(GET CF_INCLUDE_PATHS ${i} include_path)
if (NOT EXISTS "${generated_file}")
message(FATAL_ERROR "${generated_file} was not generated")
endif()
file(READ "${generated_file}" file_contents)
string(STRIP "${file_contents}" file_contents)
set (exp_contents "#include \"${original_file}\" // IWYU pragma: export")
+ if(include_path)
+ string(PREPEND exp_contents "// Forwarding header, use by: #include <${include_path}>\n")
+ endif()
if (NOT "${file_contents}" STREQUAL "${exp_contents}")
message(FATAL_ERROR "${generated_file} contains '${file_contents}' instead of '${exp_contents}'")
endif()
@@ -400,4 +404,35 @@ endif()
check_files(GENERATED ${expfiles}
ORIGINALS ${origfiles})
+###########################################################
+
+message(STATUS "Test 16: SHARED_PREFIX")
+set(camelcase_headers)
+
+file(RELATIVE_PATH rel_path "${CMAKE_CURRENT_BINARY_DIR}/Module" ${CMAKE_CURRENT_SOURCE_DIR})
+
+set(expfiles "${CMAKE_CURRENT_BINARY_DIR}/Module/HeadTest1"
+ "${CMAKE_CURRENT_BINARY_DIR}/Module/HeadTest2")
+set(intermediatefiles "${CMAKE_CURRENT_BINARY_DIR}/Module/headtest1.h"
+ "${CMAKE_CURRENT_BINARY_DIR}/Module/headtest2.h")
+set(rel_origfiles "${rel_path}/headtest1.h"
+ "${rel_path}/headtest2.h")
+set(includedfiles headtest1.h headtest2.h)
+set(include_paths "Module/HeadTest1"
+ "Module/HeadTest2")
+file(REMOVE ${expfiles} ${intermediatefiles})
+ecm_generate_headers(
+ camelcase_headers
+ HEADER_NAMES HeadTest1 HeadTest2
+ SHARED_PREFIX Module
+)
+if (NOT "${expfiles}" STREQUAL "${camelcase_headers}")
+ message(FATAL_ERROR "camelcase_headers was set to \"${camelcase_headers}\" instead of \"${expfiles}\"")
+endif()
+check_files(GENERATED ${expfiles}
+ ORIGINALS ${includedfiles}
+ INCLUDE_PATHS ${include_paths})
+check_files(GENERATED ${intermediatefiles}
+ ORIGINALS ${rel_origfiles})
+
# vim:ft=cmake
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/CMakeLists.txt
index 755476b0b4..34f67b58f6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/CMakeLists.txt
@@ -1,9 +1,20 @@
-set(MODULES_DIR "${ECM_SOURCE_DIR}/modules")
-configure_file(run_test.cmake.config "${CMAKE_CURRENT_BINARY_DIR}/run_test.cmake" @ONLY)
-add_test(
- NAME ECMGeneratePkgConfigFile
- COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/run_test.cmake")
+macro(add_pkgconfig_test NAME)
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${NAME}")
+
+ add_test(NAME ecm_generate_pkgconfig-${NAME}
+ COMMAND ${CMAKE_COMMAND} "${CMAKE_CURRENT_SOURCE_DIR}/${NAME}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${NAME}"
+ )
+endmacro()
+
+add_pkgconfig_test(no_optional_arguments)
+add_pkgconfig_test(no_description_parameter_metainfo_with_description-param)
+add_pkgconfig_test(no_description_parameter_metainfo_with_empty_description)
+add_pkgconfig_test(no_description_parameter_metainfo_without_description)
+add_pkgconfig_test(with_public_and_private_dependencies)
+add_pkgconfig_test(with_an_URL_parameter)
+add_pkgconfig_test(custom_defines)
add_subdirectory(test_imported_targets)
add_subdirectory(test_no_interface_include_dirs)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_description.yaml b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_description.yaml
index 0c0d33ff60..8ac4c84340 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_description.yaml
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_description.yaml
@@ -12,8 +12,8 @@ portingAid: false
deprecated: false
release: true
libraries:
- - qmake: KCoreAddons
- cmake: "KF5::CoreAddons"
+ - qmake: KCoreAddons
+ cmake: "KF5::CoreAddons"
cmakename: KF5CoreAddons
public_lib: true
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_empty_description.yaml b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_empty_description.yaml
index c46465d10f..ae8e3d2c89 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_empty_description.yaml
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_with_empty_description.yaml
@@ -12,8 +12,8 @@ portingAid: false
deprecated: false
release: true
libraries:
- - qmake: KCoreAddons
- cmake: "KF5::CoreAddons"
+ - qmake: KCoreAddons
+ cmake: "KF5::CoreAddons"
cmakename: KF5CoreAddons
public_lib: true
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_without_description.yaml b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_without_description.yaml
index b7f094c2b8..b93fde77a2 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_without_description.yaml
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/metainfo_without_description.yaml
@@ -11,8 +11,8 @@ portingAid: false
deprecated: false
release: true
libraries:
- - qmake: KCoreAddons
- cmake: "KF5::CoreAddons"
+ - qmake: KCoreAddons
+ cmake: "KF5::CoreAddons"
cmakename: KF5CoreAddons
public_lib: true
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/run_test.cmake.config b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/run_test.cmake.config
deleted file mode 100644
index 10f5c2f3d3..0000000000
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMGeneratePkgConfigFile/run_test.cmake.config
+++ /dev/null
@@ -1,161 +0,0 @@
-set(CMAKE_MODULE_PATH "@MODULES_DIR@")
-set(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
-set(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
-
-set(CMAKE_INSTALL_PREFIX "/usr")
-
-include(ECMGeneratePkgConfigFile)
-include(ECMSetupVersion)
-
-
-function (compare_files)
- set(options)
- set(oneValueArgs GENERATED ORIGINALS)
- set(multiValueArgs)
- cmake_parse_arguments(CF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
- list(LENGTH CF_GENERATED count)
- math(EXPR last "${count}-1")
- foreach(i RANGE ${last})
- list(GET CF_GENERATED ${i} generated_file)
- if (NOT EXISTS "${generated_file}")
- message(FATAL_ERROR "${generated_file} was not generated")
- endif()
- file(READ "${generated_file}" file_contents)
- string(STRIP "${file_contents}" file_contents)
-
- list(GET CF_ORIGINALS ${i} original_file)
- if (NOT EXISTS "${original_file}")
- message(FATAL_ERROR "Original ${original_file} was not found")
- endif()
- file(READ "${original_file}" original_contents)
- string(STRIP "${original_contents}" original_contents)
-
- if(NOT original_contents STREQUAL file_contents)
- message(FATAL_ERROR "Different files: ${original_file} ${generated_file}")
- endif()
- endforeach()
-endfunction()
-
-###########################################################
-
-
-ecm_setup_version(5.43 VARIABLE_PREFIX KCOREADDONS
- VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kcoreaddons_version.h"
- PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CoreAddonsConfigVersion.cmake"
- SOVERSION 5)
-
-message(STATUS "Test 1: no optional arguments")
-set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/KF5CoreAddons.pc")
-
-ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons
- DESCRIPTION "KF5CoreAddons test"
- DEPS Qt5Core
- FILENAME_VAR OutputFile)
-
-compare_files(GENERATED ${OutputFile}
- ORIGINALS ${origfiles})
-file(REMOVE ${OutputFile})
-
-message(STATUS "Test2: no description parameter, metainfo.yaml with description found")
-set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/KF5CoreAddons2.pc")
-
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_with_description.yaml
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/metainfo_with_description.yaml ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons2
- DEPS Qt5Core
- INCLUDE_INSTALL_DIR /usr/KCoreAddons
- FILENAME_VAR OutputFile)
-
-compare_files(GENERATED ${OutputFile}
- ORIGINALS ${origfiles})
-file(REMOVE ${OutputFile})
-file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-message(STATUS "Test3: no description parameter, metainfo.yaml with empty description found")
-set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/KF5CoreAddons3.pc")
-
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_with_empty_description.yaml
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/metainfo_with_empty_description.yaml ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons3
- DEPS Qt5Core
- INCLUDE_INSTALL_DIR /usr/KCoreAddons
- FILENAME_VAR OutputFile)
-
-compare_files(GENERATED ${OutputFile}
- ORIGINALS ${origfiles})
-file(REMOVE ${OutputFile})
-file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-message(STATUS "Test4: no description parameter, metainfo.yaml without description")
-set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/KF5CoreAddons3.pc")
-
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_without_description.yaml
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/metainfo_without_description.yaml ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons3
- DEPS Qt5Core
- INCLUDE_INSTALL_DIR /usr/KCoreAddons
- FILENAME_VAR OutputFile)
-
-compare_files(GENERATED ${OutputFile}
- ORIGINALS ${origfiles})
-file(REMOVE ${OutputFile})
-file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-message(STATUS "Test5: with public and private dependencies")
-set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/KF5CoreAddons4.pc")
-
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/metainfo_without_description.yaml
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/metainfo_without_description.yaml ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons4
- DEPS Public1 PRIVATE Private1 Private2 PUBLIC Public2
- INCLUDE_INSTALL_DIR /usr/KCoreAddons
- FILENAME_VAR OutputFile)
-
-compare_files(GENERATED ${OutputFile}
- ORIGINALS ${origfiles})
-file(REMOVE ${OutputFile})
-file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/metainfo.yaml)
-
-message(STATUS "Test 6: with an URL parameter")
-set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/KF5CoreAddons5.pc")
-
-ecm_generate_pkgconfig_file(BASE_NAME KF5CoreAddons5
- DESCRIPTION "KF5CoreAddons test"
- URL "https://www.example.org/"
- DEPS Qt5Core
- INCLUDE_INSTALL_DIR /usr/KCoreAddons
- FILENAME_VAR OutputFile)
-
-compare_files(GENERATED ${OutputFile}
- ORIGINALS ${origfiles})
-file(REMOVE ${OutputFile})
-
-message(STATUS "Test7: Custom defines")
-set(origfiles "${CMAKE_CURRENT_SOURCE_DIR}/KF6Attica.pc")
-set(prefix "/usr")
-
-ecm_setup_version(6.7.0 VARIABLE_PREFIX ATTICA
- VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/attica_version.h"
- PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6AtticaConfigVersion.cmake"
- SOVERSION 6)
-
-ecm_generate_pkgconfig_file(BASE_NAME KF6Attica
- DESCRIPTION "Qt library to access Open Collaboration Services"
- LIB_NAME KF6Attica
- INCLUDE_INSTALL_DIR /usr/include/Attica
- DEFINES -I\${prefix}/include/foo -I\${prefix}/include/bar
- DEPS Qt6Core Qt6Network
- FILENAME_VAR OutputFile
- )
-
-compare_files(GENERATED ${OutputFile}
- ORIGINALS ${origfiles})
-file(REMOVE ${OutputFile})
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/CMakeLists.txt
index 1aee4f8d35..5c9e0b1857 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/CMakeLists.txt
@@ -132,7 +132,7 @@ target_link_libraries(tr_thread_test PRIVATE Qt${QT_MAJOR_VERSION}::Core)
# make sure the moc file is only visible to this test/target
set(MOC_DIR "${CMAKE_CURRENT_BINARY_DIR}/tr_thread_test_2_moc")
qt_generate_moc(tr_thread_test.cpp "${MOC_DIR}/tr_thread_test.moc")
-# Unset SKIP_AUTOMOC again, to not interfer with AUTOMOC as set for tr_thread_test
+# Unset SKIP_AUTOMOC again, to not interfere with AUTOMOC as set for tr_thread_test
set_source_files_properties(tr_thread_test PROPERTIES SKIP_AUTOMOC OFF)
set(tr_thread_test_2_SRCS
@@ -159,7 +159,7 @@ assert_var_defined(QMLOADER_FILES)
add_subdirectory(subdir)
-# when building against a static Qt the tests doing dynamic loading of a module using Qt wont work
+# when building against a static Qt the tests doing dynamic loading of a module using Qt won't work
if (NOT DEFINED QT6_IS_SHARED_LIBS_BUILD OR QT6_IS_SHARED_LIBS_BUILD)
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/check_conf.cmake"
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/check.cmake.in b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/check.cmake.in
index ad87832b01..00ef6e2f76 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/check.cmake.in
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMPoQmToolsTest/check.cmake.in
@@ -26,6 +26,8 @@ set(exp_files
"share/locale/en/LC_MESSAGES/catalog2.qm"
"share/locale/de/LC_MESSAGES/catalog.qm"
"share/locale/de/LC_MESSAGES/catalog2.qm"
+ "share/locale/pt_BR/LC_MESSAGES/catalog.qm"
+ "share/locale/pt/LC_MESSAGES/catalog.qm"
"custom-dir1/es/LC_MESSAGES/custom-dir1-install-test.qm"
"custom-dir1/fr/LC_MESSAGES/custom-dir1-install-test.qm"
"custom-dir2/es/LC_MESSAGES/custom-dir2-install-test.qm"
@@ -69,6 +71,7 @@ if("@CMAKE_SYSTEM_NAME@" STREQUAL "Linux")
set(exp_output_catalog2_de_AT "${exp_output_catalog2_de}")
# no french translation provided -> english fallback
set(exp_output_catalog2_fr "${exp_output_catalog2_en}")
+ set(exp_output_catalog_pt_BR "pt_BR text:pt_BR plural form 5")
function(check_translations name exec catalog_name)
foreach(lang en de de_AT fr)
@@ -117,6 +120,7 @@ if("@CMAKE_SYSTEM_NAME@" STREQUAL "Linux")
check_translations_multilang(TR_TEST "${TR_TEST_EXEC}" catalog "de_AT:fr_FR" "de")
check_translations_multilang(TR_TEST "${TR_TEST_EXEC}" catalog "en_GB:de_DE" "en")
+ check_translations_multilang(TR_TEST "${TR_TEST_EXEC}" catalog "pt_Latn_BR:pt_BR:pt_Latn:pt" "pt_BR")
endif()
if (fail)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_depends_qt6 b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_depends_qt6
index 23d35ab158..842e3231f1 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_depends_qt6
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_depends_qt6
@@ -1,6 +1,6 @@
module Test
linktarget TestModule
-optional plugin TestModule
+plugin TestModule
classname TestPlugin
typeinfo TestModule.qmltypes
depends OtherTest
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_full_qt6 b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_full_qt6
index e52c5dec19..ac1e25b7e6 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_full_qt6
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmldir_expected_full_qt6
@@ -1,6 +1,6 @@
module Test
linktarget TestModule
-optional plugin TestModule
+plugin TestModule
classname TestPlugin
typeinfo TestModule.qmltypes
prefer :/qt/qml/Test/
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmlmodule.cpp b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmlmodule.cpp
index a1552a8654..80665a992c 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmlmodule.cpp
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMQmlModuleTest/qmlmodule.cpp
@@ -12,3 +12,5 @@ void QmlModule::registerTypes(const char* uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Test"));
}
+
+#include "moc_qmlmodule.cpp"
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/CMakeLists.txt
index d757b75f70..20a4078bc5 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/CMakeLists.txt
@@ -13,35 +13,37 @@ macro(add_version_test NAME COMMAND)
--test-command ${COMMAND} ${ARGN})
endmacro()
-add_version_test(old_simple dummy)
-add_version_test(old_simple_no_version_string_vars dummy)
-add_version_test(old_soversion dummy)
-add_version_test(old_version_file dummy)
-add_version_test(old_version_file_abspath dummy)
-add_version_test(old_version_file_anynewer dummy)
-add_version_test(old_version_file_exact dummy)
-add_version_test(old_version_file_samemajor dummy)
-add_version_test(old_header check_header)
-add_version_test(old_header_abspath check_header)
-
-if(CMAKE_MAJOR_VERSION GREATER 2)
- add_version_test(new_explicit_header check_header)
- add_version_test(new_explicit_header_abspath check_header)
- add_version_test(new_explicit_simple dummy)
- add_version_test(new_explicit_simple_no_version_string_vars dummy)
- add_version_test(new_explicit_soversion dummy)
- add_version_test(new_explicit_version_file dummy)
- add_version_test(new_explicit_version_file_abspath dummy)
- add_version_test(new_project_header check_header)
- add_version_test(new_project_header_abspath check_header)
- add_version_test(new_project_header_prefix check_header)
- add_version_test(new_project_header_zero_prefixed_version check_header)
- add_version_test(new_project_header_expected_zero_version check_header)
- add_version_test(new_project_simple dummy)
- add_version_test(new_project_simple_no_version_string_vars dummy)
- add_version_test(new_project_simple_prefix dummy)
- add_version_test(new_project_soversion dummy)
- add_version_test(new_project_soversion_prefix dummy)
- add_version_test(new_project_version_file dummy)
- add_version_test(new_project_version_file_abspath dummy)
+# Skip these tests with cmake >= 4 because CMP0048 doesn't exist anymore and
+# trying to set it results in a hard error.
+if(CMAKE_MAJOR_VERSION VERSION_LESS 4)
+ add_version_test(old_simple dummy)
+ add_version_test(old_simple_no_version_string_vars dummy)
+ add_version_test(old_soversion dummy)
+ add_version_test(old_version_file dummy)
+ add_version_test(old_version_file_abspath dummy)
+ add_version_test(old_version_file_anynewer dummy)
+ add_version_test(old_version_file_exact dummy)
+ add_version_test(old_version_file_samemajor dummy)
+ add_version_test(old_header check_header)
+ add_version_test(old_header_abspath check_header)
endif()
+
+add_version_test(new_explicit_header check_header)
+add_version_test(new_explicit_header_abspath check_header)
+add_version_test(new_explicit_simple dummy)
+add_version_test(new_explicit_simple_no_version_string_vars dummy)
+add_version_test(new_explicit_soversion dummy)
+add_version_test(new_explicit_version_file dummy)
+add_version_test(new_explicit_version_file_abspath dummy)
+add_version_test(new_project_header check_header)
+add_version_test(new_project_header_abspath check_header)
+add_version_test(new_project_header_prefix check_header)
+add_version_test(new_project_header_zero_prefixed_version check_header)
+add_version_test(new_project_header_expected_zero_version check_header)
+add_version_test(new_project_simple dummy)
+add_version_test(new_project_simple_no_version_string_vars dummy)
+add_version_test(new_project_simple_prefix dummy)
+add_version_test(new_project_soversion dummy)
+add_version_test(new_project_soversion_prefix dummy)
+add_version_test(new_project_version_file dummy)
+add_version_test(new_project_version_file_abspath dummy)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header/CMakeLists.txt
index 164a8c17e2..99cf4cb6bc 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_explicit_header VERSION 1.5.6.7)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header_abspath/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header_abspath/CMakeLists.txt
index abdea17131..1f0c25c114 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header_abspath/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_header_abspath/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_explicit_header_abspath VERSION 1.5.6.7)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt
index 18b8db1a37..17e2bd63ca 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_explicit_simple VERSION 1.5.6.7)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple_no_version_string_vars/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple_no_version_string_vars/CMakeLists.txt
index 8d37090684..3d66b3a4af 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple_no_version_string_vars/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_simple_no_version_string_vars/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_explicit_simple VERSION 1.5.6.7)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_soversion/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_soversion/CMakeLists.txt
index 45b80d89fe..c8ea9574d7 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_soversion/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_soversion/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_explicit_soversion VERSION 1.5.6.7)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file/CMakeLists.txt
index 4d50fa82d2..44e3795d3c 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_explicit_version_file VERSION 1.5.6.7)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt
index 8fa2b78838..b8e1180db2 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_explicit_version_file_abspath/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_explicit_version_abspath VERSION 1.5.6.7)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt
index a7ccc18b4c..55fc551503 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_header VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_abspath/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_abspath/CMakeLists.txt
index e94e3c69e9..6fcb91c02e 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_abspath/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_abspath/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_header_abspath VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_prefix/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_prefix/CMakeLists.txt
index a29609a383..d711b84d9d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_prefix/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_header_prefix/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_header_prefix VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple/CMakeLists.txt
index bec6a25cf2..32dba4e704 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_simple VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_no_version_string_vars/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_no_version_string_vars/CMakeLists.txt
index 2bb390a9fc..ee752d456b 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_no_version_string_vars/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_no_version_string_vars/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_simple VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_prefix/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_prefix/CMakeLists.txt
index 3bb17bf50c..68f72ab521 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_prefix/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_simple_prefix/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_simple_prefix VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt
index c498307b8a..f1da09ec6f 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_soversion VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion_prefix/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion_prefix/CMakeLists.txt
index b6bd6a7253..363230b30e 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion_prefix/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_soversion_prefix/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_soversion_prefix VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt
index a92c2a0f68..2afff50837 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_version_file VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt
index 5052618ec4..5157698e5d 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/ECMSetupVersionTest/new_project_version_file_abspath/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.16)
project(new_project_version_file_abspath VERSION 2.3.4)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEInstallDirsTest/not_cache_variable/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEInstallDirsTest/not_cache_variable/CMakeLists.txt
index 8ddbb27a15..4c733d0895 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEInstallDirsTest/not_cache_variable/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEInstallDirsTest/not_cache_variable/CMakeLists.txt
@@ -1,6 +1,6 @@
# Test KDEInstallDirs does not crash if a variable like CMAKE_INSTALL_LIBDIR is
# defined but is not a cache variable.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.16)
set(ECM_KDE_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../kde-modules)
set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../modules)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesTest/CMakeLists.txt b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesTest/CMakeLists.txt
index 1e5e369a65..de80c53ae4 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesTest/CMakeLists.txt
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/tests/KDEPackageAppTemplatesTest/CMakeLists.txt
@@ -1,8 +1,9 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.16)
set(ECM_KDE_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../kde-modules)
set(ECM_MODULE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../modules)
set(CMAKE_MODULE_PATH "${ECM_KDE_MODULE_DIR}")
+set(CMAKE_CROSSCOMPILING OFF)
include(KDEPackageAppTemplates)
message(STATUS "Test: generate compressed template")
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/Android.cmake b/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/Android.cmake
index cdb60d85ca..f6f0fe16eb 100644
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/Android.cmake
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/Android.cmake
@@ -144,7 +144,15 @@ endmacro()
set_deprecated_variable(CMAKE_ANDROID_NDK ANDROID_NDK "$ENV{ANDROID_NDK}")
set_deprecated_variable(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION ANDROID_GCC_VERSION "clang")
-set_deprecated_variable(CMAKE_ANDROID_API ANDROID_API_LEVEL "21")
+
+# try to determine default API level from environment
+# we unfortunately can't make this dependent on the Qt version as we don't know that here yet
+set(_default_api_level "21")
+if($ENV{ANDROID_NDK_PLATFORM} MATCHES "^android-([0-9]+)$")
+ set(_default_api_level ${CMAKE_MATCH_1})
+endif()
+
+set_deprecated_variable(CMAKE_ANDROID_API ANDROID_API_LEVEL ${_default_api_level})
if(NOT DEFINED ENV{ANDROID_ARCH})
set(ENV{ANDROID_ARCH} "arm")
endif()
@@ -280,7 +288,7 @@ set(CMAKE_CXX_LINK_EXECUTABLE
)
# As our executables are shared libraries, we also need them build with position independent code (PIC).
-# Qt 5 forces that anyway, but in Qt 6 that is no longer the case for exectuables (which we pretend to build here),
+# Qt 5 forces that anyway, but in Qt 6 that is no longer the case for executables (which we pretend to build here),
# and so we end up with just PIE (coming from CMake).
# And as subsequent steps overwrite that setting again, we have to watch for that and redo our change.
set(CMAKE_CXX_COMPILE_OPTIONS_PIE "-fPIC")
@@ -299,7 +307,7 @@ set(ECM_DIR "${CMAKE_CURRENT_LIST_DIR}/../cmake" CACHE STRING "")
# from CMakeDetermineSystem.cmake and from CMakeSystem.cmake generated within the
# build directory.
if(DEFINED QTANDROID_EXPORTED_TARGET AND NOT TARGET "create-apk" AND NOT __qt_chainload_toolchain_file)
- get_filename_component(_CMAKE_ANDROID_DIR "${CMAKE_TOOLCHAIN_FILE}" PATH)
+ get_filename_component(_CMAKE_ANDROID_DIR "${CMAKE_TOOLCHAIN_FILE}" DIRECTORY)
list(LENGTH QTANDROID_EXPORTED_TARGET targetsCount)
include(${_CMAKE_ANDROID_DIR}/ECMAndroidDeployQt5.cmake)
diff --git a/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/generate-fastlane-metadata.py b/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/generate-fastlane-metadata.py
index ae01619ea5..b076baa1db 100755
--- a/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/generate-fastlane-metadata.py
+++ b/local/recipes/kde/kf6-extra-cmake-modules/source/toolchain/generate-fastlane-metadata.py
@@ -19,6 +19,7 @@ import shutil
import subprocess
import sys
import tempfile
+from urllib.parse import urlsplit, urlunsplit
import xdg.DesktopEntry
import xml.etree.ElementTree as ET
import yaml
@@ -281,7 +282,7 @@ def createYml(appname, data):
if 'url-donation' in data:
info['Donate'] = data['url-donation'][None]
else:
- info['Donate'] = 'https://kde.org/community/donations/'
+ info['Donate'] = 'https://kde.org/donate'
# static data
info['Translation'] = 'https://l10n.kde.org/'
@@ -302,7 +303,7 @@ def processLocalImages(applicationName, data):
imageFiles = glob.glob('metadata/**/*.png', recursive=True)
imageFiles.extend(glob.glob('metadata/**/*.jpg', recursive=True))
for image in imageFiles:
- # noramlize single- vs multi-app layouts
+ # normalize single- vs multi-app layouts
imageDestName = image.replace('metadata/android', 'metadata/' + applicationName)
# copy image
@@ -367,6 +368,14 @@ def createMetadataArchive(applicationName):
archive.write(file, file)
os.chdir(oldcwd)
+
+# strip user name and password from an URL
+def cleanUrl(url):
+ parts = urlsplit(url)
+ netloc = parts.netloc if '@' not in parts.netloc else parts.netloc.split('@')[1]
+ return urlunsplit((parts.scheme, netloc, parts.path, parts.query, parts.fragment))
+
+
# Generate metadata for the given appstream and desktop files
def processAppstreamFile(appstreamFileName, desktopFileName, iconBaseName):
# appstreamFileName has the form .appdata.xml or .metainfo.xml, so we
@@ -437,7 +446,7 @@ def processAppstreamFile(appstreamFileName, desktopFileName, iconBaseName):
upstream_ref = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '@{u}'], cwd=arguments.source).decode('utf-8')
remote = upstream_ref.split('/')[2]
output = subprocess.check_output(['git', 'remote', 'get-url', remote], cwd=arguments.source).decode('utf-8')
- data['source-repo'] = output.strip()
+ data['source-repo'] = cleanUrl(output.strip())
# write meta data
createFastlaneFile( applicationName, "title.txt", data['name'] )
diff --git a/local/scripts/sync-recipe-source.sh b/local/scripts/sync-recipe-source.sh
index 1d6f0f5036..eaa47debe7 100755
--- a/local/scripts/sync-recipe-source.sh
+++ b/local/scripts/sync-recipe-source.sh
@@ -61,6 +61,10 @@ src_version(){ local s="$1"
# KDE Frameworks (KF_VERSION), Plasma (PROJECT_VERSION), or a literal
# project(Name VERSION X.Y.Z).
local v; v=$(grep -m1 -E 'set\((KF_VERSION|PROJECT_VERSION)|project\([A-Za-z0-9_]+ VERSION [0-9]' "$s/CMakeLists.txt" 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
+ # Extra CMake Modules and some KF modules use a bare set(VERSION "X.Y.Z").
+ if [ -z "$v" ]; then
+ v=$(grep -m1 -E '^set\(VERSION "[0-9]+\.[0-9]+\.[0-9]+"' "$s/CMakeLists.txt" 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
+ fi
# KDE Gear (konsole etc.): version split across RELEASE_SERVICE_VERSION_*.
if [ -z "$v" ] && grep -q RELEASE_SERVICE_VERSION_MAJOR "$s/CMakeLists.txt" 2>/dev/null; then
local a b c
diff --git a/local/scripts/verify-external-source-versions.sh b/local/scripts/verify-external-source-versions.sh
index c12d711a0c..b1559d3afe 100755
--- a/local/scripts/verify-external-source-versions.sh
+++ b/local/scripts/verify-external-source-versions.sh
@@ -84,6 +84,10 @@ while IFS= read -r recipe; do
if [ -z "$sver" ] && [ -f "$dir/source/CMakeLists.txt" ]; then
# KF (KF_VERSION), Plasma (PROJECT_VERSION), literal project(... VERSION x)
sver="$(grep -m1 -E 'set\((KF_VERSION|PROJECT_VERSION)|project\([A-Za-z0-9_]+ VERSION [0-9]' "$dir/source/CMakeLists.txt" 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)"
+ # Extra CMake Modules / some KF modules: bare set(VERSION "X.Y.Z")
+ if [ -z "$sver" ]; then
+ sver="$(grep -m1 -E '^set\(VERSION "[0-9]+\.[0-9]+\.[0-9]+"' "$dir/source/CMakeLists.txt" 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)"
+ fi
# KDE Gear split RELEASE_SERVICE_VERSION_* (konsole etc.)
if [ -z "$sver" ] && grep -q RELEASE_SERVICE_VERSION_MAJOR "$dir/source/CMakeLists.txt" 2>/dev/null; then
a="$(grep -m1 RELEASE_SERVICE_VERSION_MAJOR "$dir/source/CMakeLists.txt" | grep -oE '[0-9]+' | head -1)"