12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 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}")
- if(${CMAKE_DEPENDENT_OPTION_DEP})
- else()
- set(${option}_AVAILABLE 0)
- endif()
- endforeach()
- if(${option}_AVAILABLE)
- option(${option} "${doc}" "${default}")
- set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
- else()
- if(${option} MATCHES "^${option}$")
- else()
- set(${option} "${${option}}" CACHE INTERNAL "${doc}")
- endif()
- set(${option} ${force})
- endif()
- else()
- set(${option} "${${option}_ISSET}")
- endif()
- endmacro()
|