commit: e0b61b46f7124b3804aad58c57974fae615f4693
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 15 19:25:44 2025 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Oct 15 19:56:52 2025 +0000
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=e0b61b46
cmake.eclass: Tweak _cmake_minreqver-info() some more
Move "CMake 4 detected" message around, with bigger file listings,
and logically, it is better placed at the end, before the upstream
policy changes research link.
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
eclass/cmake.eclass | 45 ++++++++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 17 deletions(-)
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 72212d0fd9..5ce56bc461 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -363,37 +363,48 @@ _cmake_minreqver-info() {
weak_qaw="" # weak notice: no "QA Notice" starting with second
call
}
+ local info
minreqver_listing() {
- local info
- eqawarn "${2}"
case ${1} in
- 305) for info in ${_CMAKE_MINREQVER_CMAKE305[*]}; do
eqawarn " ${info}"; done ;;
- 310) for info in ${_CMAKE_MINREQVER_CMAKE310[*]}; do
eqawarn " ${info}"; done ;;
- 316) for info in ${_CMAKE_MINREQVER_CMAKE316[*]}; do
eqawarn " ${info}"; done ;;
+ 305)
+ eqawarn "The following CMakeLists.txt files are
causing errors:"
+ for info in ${_CMAKE_MINREQVER_CMAKE305[*]}; do
eqawarn " ${info}"; done
+ eqawarn
+ ;;
+ 310)
+ if [[ -n ${_CMAKE_MINREQVER_CMAKE310[@]} ]];
then
+ eqawarn "The following CMakeLists.txt
files are causing warnings:"
+ for info in
${_CMAKE_MINREQVER_CMAKE310[*]}; do eqawarn " ${info}"; done
+ eqawarn
+ fi
+ ;;
+ 316)
+ if [[ ${warnlvl} -ge 316 ]] && [[ -n
${_CMAKE_MINREQVER_CMAKE316[@]} ]]; then
+ eqawarn "The following CMakeLists.txt
files are causing warnings:"
+ for info in
${_CMAKE_MINREQVER_CMAKE316[*]}; do eqawarn " ${info}"; done
+ eqawarn
+ fi
+ ;;
esac
- eqawarn
}
# CMake 4-caused error is highest priority and must always be shown
if [[ -n ${_CMAKE_MINREQVER_CMAKE305[@]} ]]; then
minreqver_qanotice 305
- minreqver_listing 305 "The following CMakeLists.txt files are
causing errors:"
- if ! [[ ${CMAKE_QA_COMPAT_SKIP} ]] && 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
- eqawarn
+ minreqver_listing 305
fi
# for warnings, we only want the latest relevant one, but list all
flagged files
if [[ ${warnlvl} -ge 310 ]]; then
minreqver_qanotice ${warnlvl}
- [[ -n ${_CMAKE_MINREQVER_CMAKE310[@]} ]] &&
- minreqver_listing 310 "The following CMakeLists.txt
files are causing warnings:"
- [[ ${warnlvl} -ge 316 ]] && [[ -n
${_CMAKE_MINREQVER_CMAKE316[@]} ]] &&
- minreqver_listing 316 "The following CMakeLists.txt
files are causing warnings:"
+ for info in 310 316; do minreqver_listing ${info}; done
fi
if [[ ${warnlvl} ]]; then
+ if [[ -n ${_CMAKE_MINREQVER_CMAKE305[@]} ]] && 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."
+ eqawarn
+ fi
eqawarn "An upstreamable patch should take any resulting CMake
policy changes"
eqawarn "into account. See also:"
eqawarn "
https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html"