diff options
author | Brad King <brad.king@kitware.com> | 2021-07-20 16:11:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-07-20 16:18:53 (GMT) |
commit | d777ca12f60f5da31b59f34605c5eb9f1608756e (patch) | |
tree | 36626ec8760f19d61fe025aab2cdb76eb49a1105 /Modules | |
parent | 31ecd3718047874b5eeb939e9608fa1bd386c1a7 (diff) | |
download | CMake-d777ca12f60f5da31b59f34605c5eb9f1608756e.zip CMake-d777ca12f60f5da31b59f34605c5eb9f1608756e.tar.gz CMake-d777ca12f60f5da31b59f34605c5eb9f1608756e.tar.bz2 |
CMakeDependentOption: Revert "Allow parentheses in the depends string"
Revert commit 0665d9092e (CMakeDependentOption: Allow parentheses in the
depends string, 2021-06-13, v3.21.0-rc1~32^2). It broke existing use
cases with parentheses in regular expressions. Also add a test for this.
Fixes: #22447
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDependentOption.cmake | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake index 0a291f2..96855d2 100644 --- a/Modules/CMakeDependentOption.cmake +++ b/Modules/CMakeDependentOption.cmake @@ -42,10 +42,7 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force) if(${option}_ISSET MATCHES "^${option}_ISSET$") set(${option}_AVAILABLE 1) foreach(d ${depends}) - string(REPLACE "(" " ( " _CMAKE_CDO_DEP "${d}") - string(REPLACE ")" " ) " _CMAKE_CDO_DEP "${_CMAKE_CDO_DEP}") - string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${_CMAKE_CDO_DEP}") - unset(_CMAKE_CDO_DEP) + string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}") if(${CMAKE_DEPENDENT_OPTION_DEP}) else() set(${option}_AVAILABLE 0) |