diff options
Diffstat (limited to 'cmake/Modules/GrComponent.cmake')
-rw-r--r-- | cmake/Modules/GrComponent.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/Modules/GrComponent.cmake b/cmake/Modules/GrComponent.cmake index 876ec0baa..3891f6981 100644 --- a/cmake/Modules/GrComponent.cmake +++ b/cmake/Modules/GrComponent.cmake @@ -46,10 +46,23 @@ function(GR_REGISTER_COMPONENT name var) message(STATUS " Dependency ${dep} = ${${dep}}") endforeach(dep) + #if the user set the var to force, we note this + if("${${var}}" STREQUAL "FORCE") + set(${var} ON) + set(var_force TRUE) + else() + set(var_force FALSE) + endif() + #setup the dependent option for this component CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${ENABLE_DEFAULT} "${ARGN}" OFF) set(${var}_ "${${var}}" CACHE INTERNAL "" FORCE) + #force was specified, but the dependencies were not met + if(NOT ${var} AND var_force) + message(FATAL_ERROR "user force-enabled ${name} but configuration checked failed") + endif() + #append the component into one of the lists if(${var}) message(STATUS " Enabling ${name} support.") |