From 1cfa3791dab83b7bae1e4138f92e37364bd1c5ed Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 19 Oct 2011 10:59:51 -0700 Subject: cmake: added ability to support -DENABLE_XXX=FORCE --- cmake/Modules/GrComponent.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cmake/Modules') 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.") -- cgit