summaryrefslogtreecommitdiff
path: root/eclass/cmake.eclass
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2025-11-11 21:25:28 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2025-11-11 21:29:45 +0100
commit01243361d06bf087535b26afa3c04ce5df24d630 (patch)
treeba4cb064dd1a9a867a5d7fe3b5651a7b601f68b4 /eclass/cmake.eclass
parent39a29e24c123065dcdcc8abadc346e8fd9de09cd (diff)
downloadkde-01243361d06bf087535b26afa3c04ce5df24d630.tar.gz
kde-01243361d06bf087535b26afa3c04ce5df24d630.tar.bz2
kde-01243361d06bf087535b26afa3c04ce5df24d630.zip
cmake.eclass: Improve cmake_comment_add_subdirectory, fix min arg check
Thanks-to: Zurab Kvachadze <zurabid2016@gmail.com> Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass/cmake.eclass')
-rw-r--r--eclass/cmake.eclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 069a332bd9a..d483d4b324c 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -223,11 +223,11 @@ cmake_run_in() {
cmake_comment_add_subdirectory() {
local d filename="CMakeLists.txt"
if [[ $# -lt 1 ]]; then
- die "${FUNCNAME} must be passed at least one subdirectory name to comment"
+ die "${FUNCNAME[0]} must be passed at least one subdirectory name to comment"
fi
case ${1} in
-f)
- if [[ $# -ge 2 ]]; then
+ if [[ $# -ge 3 ]]; then
filename="${2}"
if [[ -d ${filename} ]]; then
filename+="/CMakeLists.txt"
@@ -239,7 +239,7 @@ cmake_comment_add_subdirectory() {
die "${FUNCNAME}: called on non-existing ${filename}"
fi
else
- die "${FUNCNAME}: bad number of arguments: -f <filename or directory> <subdirectory> expected"
+ die "${FUNCNAME[0]}: bad number of arguments: -f <filename or directory> <subdirectory> expected"
fi
shift 2
;;
@@ -248,7 +248,7 @@ cmake_comment_add_subdirectory() {
;;
esac
- for d in $@; do
+ for d in "$@"; do
d=${d//\//\\/}
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d}[[:space:]]*)/I s/^/#DONOTBUILD /" \
-i ${filename} || die "failed to comment add_subdirectory(${d})"