summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2021-06-13 21:50:47 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-14 17:45:49 (GMT)
commit0665d9092e5099c581e47f3be5360d711d176c2d (patch)
tree0febf359df361d81a8323c027c260653b1129103 /Modules
parent0d3ddb17049afc660ac2a11c13013c940d9fc04c (diff)
downloadCMake-0665d9092e5099c581e47f3be5360d711d176c2d.zip
CMake-0665d9092e5099c581e47f3be5360d711d176c2d.tar.gz
CMake-0665d9092e5099c581e47f3be5360d711d176c2d.tar.bz2
CMakeDependentOption: Allow parentheses in the depends string
`if()` takes the condition as a list of arguments. Parentheses need to be separated as well. Fixes: #22303
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDependentOption.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index 96855d2..0a291f2 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -42,7 +42,10 @@ macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
if(${option}_ISSET MATCHES "^${option}_ISSET$")
set(${option}_AVAILABLE 1)
foreach(d ${depends})
- string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
+ 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)
if(${CMAKE_DEPENDENT_OPTION_DEP})
else()
set(${option}_AVAILABLE 0)