cmake-utils.eclass: _cmake_modify-cmakelists: Fix CMAKE_BUILD_TYPE sed
authorAndreas Sturmlechner <asturm@gentoo.org>
Sun, 19 May 2019 16:15:29 +0000 (18:15 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Thu, 4 Jul 2019 19:36:08 +0000 (21:36 +0200)
Commit 6b7998b narrowed matching CMAKE_BUILD_TYPE too successfully and led
to a string like `set(CMAKE_BUILD_TYPE)` being left over.

Bug: https://bugs.gentoo.org/674768
Closes: https://bugs.gentoo.org/686266
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
eclass/cmake-utils.eclass

index 28dac7e0a0b44d813997848f8d4ad7ce9d1eac18..ea1858e9735f7031bc6a728d8dd52d6f82a24890 100644 (file)
@@ -420,7 +420,7 @@ _cmake_modify-cmakelists() {
 
        # Comment out all set (<some_should_be_user_defined_variable> value)
        find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec sed \
-               -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
+               -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE\([[:space:]].*)\|)\)/I{s/^/#_cmake_modify_IGNORE /g}' \
                -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_COLOR_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
                -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \
                -e '/^[[:space:]]*set[[:space:]]*([[:space:]]*CMAKE_VERBOSE_MAKEFILE[[:space:]].*)/I{s/^/#_cmake_modify_IGNORE /g}' \