cmake-utils.eclass: replace comment_add_subdirectory with a namespaced version
authorMichael Palimaka <kensington@gentoo.org>
Mon, 25 Jan 2016 14:04:12 +0000 (01:04 +1100)
committerMichael Palimaka <kensington@gentoo.org>
Mon, 25 Jan 2016 14:07:05 +0000 (01:07 +1100)
eclass/cmake-utils.eclass

index 32ce3881a3c433b0ee0063386d7413cc6bb4bcc1..d71f57b055cbc68f1c32c750a302904de5681a55 100644 (file)
@@ -250,11 +250,11 @@ _generator_to_use() {
        echo ${generator_name}
 }
 
-# @FUNCTION: comment_add_subdirectory
+# @FUNCTION: cmake_comment_add_subdirectory
 # @USAGE: <subdirectory>
 # @DESCRIPTION:
 # Comment out an add_subdirectory call in CMakeLists.txt in the current directory
-comment_add_subdirectory() {
+cmake_comment_add_subdirectory() {
         if [[ -z ${1} ]]; then
                 die "comment_add_subdirectory must be passed the directory name to comment"
         fi
@@ -265,6 +265,17 @@ comment_add_subdirectory() {
         fi
 }
 
+# @FUNCTION: comment_add_subdirectory
+# @USAGE: <subdirectory>
+# @DESCRIPTION:
+# Comment out an add_subdirectory call in CMakeLists.txt in the current directory
+# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead.
+comment_add_subdirectory() {
+       has "${EAPI:-0}" 2 3 4 5 || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead"
+
+       cmake_comment_add_subdirectory "$@"
+}
+
 # @FUNCTION: cmake-utils_use_with
 # @USAGE: <USE flag> [flag name]
 # @DESCRIPTION: