diff options
| author | Andreas Sturmlechner <andreas.sturmlechner@gmail.com> | 2016-08-21 20:17:22 +0200 |
|---|---|---|
| committer | Andreas Sturmlechner <andreas.sturmlechner@gmail.com> | 2016-08-21 20:17:22 +0200 |
| commit | db06717d93dda81bc3abf3219e8d274a36d62d03 (patch) | |
| tree | f6e970d1d4e6d538752ac58fa8fa45822b326a67 /eclass | |
| parent | 36e8a8179e1036075d1d73f175a0284e14c8d396 (diff) | |
| download | kde-db06717d93dda81bc3abf3219e8d274a36d62d03.tar.gz kde-db06717d93dda81bc3abf3219e8d274a36d62d03.tar.bz2 kde-db06717d93dda81bc3abf3219e8d274a36d62d03.zip | |
cmake-utils.eclass: Let cmake_comment_add_subdirectory take n arguments
Diffstat (limited to 'eclass')
| -rw-r--r-- | eclass/cmake-utils.eclass | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 6363d31232a..1b1924ffc4a 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -262,15 +262,18 @@ _cmake_generator_to_use() { # @FUNCTION: cmake_comment_add_subdirectory # @USAGE: <subdirectory> # @DESCRIPTION: -# Comment out an add_subdirectory call in CMakeLists.txt in the current directory +# Comment out one ore more add_subdirectory calls in CMakeLists.txt in the current directory cmake_comment_add_subdirectory() { if [[ -z ${1} ]]; then - die "comment_add_subdirectory must be passed the directory name to comment" + die "comment_add_subdirectory must be passed at least one directory name to comment" fi if [[ -e "CMakeLists.txt" ]]; then - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${1//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \ - -i CMakeLists.txt || die "failed to comment add_subdirectory(${1})" + local d + for d in $@; do + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${d//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \ + -i CMakeLists.txt || die "failed to comment add_subdirectory(${d})" + done fi } |
