commit:     c1132185191d82a0542293acfef0642c3bc1671f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  8 20:37:14 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Nov 16 15:38:48 2025 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=c1132185

cmake.eclass: Introduce cmake_prepare-per-cmakelists

Override this to be provided with a hook into the cmake_src_prepare loop
over all CMakeLists.txt below CMAKE_USE_DIR. Will be called from inside
that loop with <path-to-current-CMakeLists.txt> as single argument.
Used for recursive CMakeLists.txt detections and modifications.

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

 eclass/cmake.eclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 20a02768c8..6fa083b2ff 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -409,6 +409,17 @@ _cmake_minreqver-info() {
        fi
 }
 
+# @FUNCTION: cmake_prepare-per-cmakelists
+# @USAGE: <path-to-current-CMakeLists.txt>
+# @DESCRIPTION:
+# Override this to be provided with a hook into the cmake_src_prepare loop
+# over all CMakeLists.txt below CMAKE_USE_DIR. Will be called from inside
+# that loop with <path-to-current-CMakeLists.txt> as single argument.
+# Used for recursive CMakeLists.txt detections and modifications.
+cmake_prepare-per-cmakelists() {
+       return
+}
+
 # @FUNCTION: _cmake_modify-cmakelists
 # @INTERNAL
 # @DESCRIPTION:
@@ -450,6 +461,7 @@ _cmake_modify-cmakelists() {
                                _CMAKE_MINREQVER_CMAKE316+=( 
"${file#"${CMAKE_USE_DIR}/"}":"${ver}" )
                        fi
                fi
+               cmake_prepare-per-cmakelists ${file}
        done < <(find "${CMAKE_USE_DIR}" -type f -iname "CMakeLists.txt" 
-print0 || die)
 
        # NOTE Append some useful summary here

Reply via email to