commit:     433b994a810feba5a5ad39c8f657f141ad6b3d8f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 29 21:54:01 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Jan  5 16:59:46 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=433b994a

cmake.eclass: cmake_comment_add_subdirectory: Work w/ macro args

As of 3.25, CMake allows 3 optional arguments to pass in addition to
source_dir: [binary_dir] [EXCLUDE_FROM_ALL] [SYSTEM]

The eclass function so far did not cope with that.

See also:
https://cmake.org/cmake/help/latest/command/add_subdirectory.html

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/cmake.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index e780e3c35ea6..adf50ff5f511 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: cmake.eclass
@@ -250,7 +250,7 @@ cmake_comment_add_subdirectory() {
 
        for d in "$@"; do
                d=${d//\//\\/}
-               sed -e 
"/add_subdirectory[[:space:]]*([[:space:]]*${d}[[:space:]]*)/I s/^/#DONOTBUILD 
/" \
+               sed -e 
"/add_subdirectory[[:space:]]*([[:space:]]*${d}\([[:space:]][a-Z_ 
]*\|[[:space:]]*\))/I s/^/#DONOTBUILD /" \
                        -i ${filename} || die "failed to comment 
add_subdirectory(${d})"
        done
 }

Reply via email to