commit:     1bbfb06f49714ef2eac2f25d2354dd40e00be703
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 12 21:17:28 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Oct 14 21:58:19 2025 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=1bbfb06f

cmake.eclass: cmake4_callout() -> _cmake_minreqver-info()

- Dump _CMAKE_MINREQVER_CMAKE305 array as eqawarn message
- CMake 4 workaround warning resharpening

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/cmake.eclass | 46 +++++++++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 19 deletions(-)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index cf9c72e9af..01954d972f 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -284,6 +284,31 @@ _cmake_minreqver-check() {
        return ${chk}
 }
 
+# @FUNCTION: _cmake_minreqver-info
+# @INTERNAL
+# @DESCRIPTION:
+# QA notice printout for build systems unsupported w/ CMake-4.
+_cmake_minreqver-info() {
+       local info
+       if [[ -n ${_CMAKE_MINREQVER_CMAKE305[@]} ]]; then
+               eqawarn "QA Notice: Compatibility with CMake < 3.5 has been 
removed from CMake 4,"
+               eqawarn "${CATEGORY}/${PN} will fail to build w/o a fix."
+               eqawarn "See also tracker bug #951350; check existing bug or 
file a new one for"
+               eqawarn "this package, and take it upstream."
+               eqawarn
+               eqawarn "The following CMakeLists.txt files are causing errors:"
+               for info in ${_CMAKE_MINREQVER_CMAKE305[*]}; do
+                       eqawarn "  ${info}"
+               done
+               eqawarn
+               if has_version -b ">=dev-build/cmake-4"; then
+                       eqawarn "CMake 4 detected; building with 
-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
+                       eqawarn "This is merely a workaround to avoid CMake 
Error and *not* a permanent fix;"
+                       eqawarn "there may be new build or runtime bugs as a 
result."
+               fi
+       fi
+}
+
 # @FUNCTION: _cmake_modify-cmakelists
 # @INTERNAL
 # @DESCRIPTION:
@@ -332,23 +357,6 @@ _cmake_modify-cmakelists() {
        _EOF_
 }
 
-# @FUNCTION: _cmake4_callout
-# @INTERNAL
-# @DESCRIPTION:
-# QA notice printout for build systems unsupported w/ CMake-4.
-_cmake4_callout() {
-       if [[ -n ${_CMAKE_MINREQVER_CMAKE305[@]} ]]; then
-               eqawarn "QA Notice: Compatibility with CMake < 3.5 has been 
removed from CMake 4,"
-               eqawarn "${CATEGORY}/${PN} will fail to build w/o a fix."
-               eqawarn "See also tracker bug #951350; check existing bug or 
file a new one for"
-               eqawarn "this package, and take it upstream."
-               if has_version -b ">=dev-build/cmake-4"; then
-                       eqawarn "CMake 4 detected; building with 
-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
-                       eqawarn "This is merely a workaround and *not* a 
permanent fix."
-               fi
-       fi
-}
-
 # @FUNCTION: cmake_prepare
 # @DESCRIPTION:
 # Check existence of and sanitise CMake files, then make ${CMAKE_USE_DIR}
@@ -380,7 +388,7 @@ cmake_prepare() {
 
        # Remove dangerous things.
        _cmake_modify-cmakelists
-       _cmake4_callout
+       _cmake_minreqver-info
 
        # Make ${CMAKE_USE_DIR} read-only in order to detect broken build 
systems
        if [[ ${CMAKE_QA_SRC_DIR_READONLY} && ! ${CMAKE_IN_SOURCE_BUILD} ]]; 
then
@@ -421,7 +429,7 @@ cmake_src_prepare() {
                                find "${S}" -name "${name}.cmake" -exec rm -v 
{} + || die
                        done
                        _cmake_modify-cmakelists # Remove dangerous things.
-                       _cmake4_callout
+                       _cmake_minreqver-info
                popd > /dev/null || die
                # Make ${S} read-only in order to detect broken build systems
                if [[ ${CMAKE_QA_SRC_DIR_READONLY} && ! 
${CMAKE_IN_SOURCE_BUILD} ]]; then

Reply via email to