···112112 # Check the actual deps, determine if the option is available
113113 set(_avail ON)
114114 foreach(d ${_option_deps_DEPENDS})
115115- if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
116116- cmake_language(
117117- EVAL
118118- CODE
119119- "
120120- if(${d})
121121- else()
122122- set(_avail OFF)
123123- set(_cond ${d})
124124- endif()")
125125- else()
126126- # cmake_language(EVAL CODE was added in 3.18 so evaluate it the "old" way before then.
127127- # turn spaces into semicolons so we have a list of arguments, signalling to CMAKE
128128- # to interpret the "if()" differently
129129- string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
130130- if(${CMAKE_DEPENDENT_OPTION_DEP})
131131-132132- else()
133133- set(_avail OFF)
134134- set(_cond ${d})
135135- endif()
136136- endif()
115115+ cmake_language(
116116+ EVAL
117117+ CODE
118118+ "
119119+ if(${d})
120120+ else()
121121+ set(_avail OFF)
122122+ set(_cond ${d})
123123+ endif()")
137124 endforeach()
138125139126 # Error if option was requested but not available