mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 13:50:10 -05:00
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
This commit is contained in:
committed by
Brad King
parent
0d3ddb1704
commit
0665d9092e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user