summaryrefslogtreecommitdiff
path: root/eclass/kde4-functions.eclass
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2014-01-15 18:26:59 +1100
committerMichael Palimaka <kensington@gentoo.org>2014-01-15 18:26:59 +1100
commitd5089f2307204bece774118f45145eba4fc4b45b (patch)
treea838edbf3be52c8337c8c4b5f5eb73640a65bb99 /eclass/kde4-functions.eclass
parentc0ad9fc33c61f7a82534940c178f64b30fbb4831 (diff)
downloadkde-d5089f2307204bece774118f45145eba4fc4b45b.tar.gz
kde-d5089f2307204bece774118f45145eba4fc4b45b.tar.bz2
kde-d5089f2307204bece774118f45145eba4fc4b45b.zip
[eclass] Add new function comment_add_subdirectory to avoid code duplication.
Diffstat (limited to 'eclass/kde4-functions.eclass')
-rw-r--r--eclass/kde4-functions.eclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
index 7e1a96029f4..64f26df6262 100644
--- a/eclass/kde4-functions.eclass
+++ b/eclass/kde4-functions.eclass
@@ -124,6 +124,20 @@ buildsycoca() {
done
}
+# @FUNCTION: comment_add_subdirectory
+# @USAGE: subdirectory
+# @DESCRIPTION:
+# Comment out an add_subdirectory call in CMakeLists.txt in the current directory
+comment_add_subdirectory() {
+ if [[ -z ${1} ]]; then
+ die "comment_add_subdirectory must be passed the directory name to comment"
+ fi
+
+ sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${1}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
+ -i CMakeLists.txt || die "failed to comment add_subdirectory(${1})"
+
+}
+
# @FUNCTION: comment_all_add_subdirectory
# @USAGE: [list of directory names]
# @DESCRIPTION: