diff options
author | Josh Blum | 2011-10-19 10:59:51 -0700 |
---|---|---|
committer | Josh Blum | 2011-10-19 10:59:51 -0700 |
commit | 1cfa3791dab83b7bae1e4138f92e37364bd1c5ed (patch) | |
tree | b2ff574418690423ed6afca8418148c487a93b77 /cmake | |
parent | 4dba84e382b961700959c3c044a7b42a04be040e (diff) | |
download | gnuradio-1cfa3791dab83b7bae1e4138f92e37364bd1c5ed.tar.gz gnuradio-1cfa3791dab83b7bae1e4138f92e37364bd1c5ed.tar.bz2 gnuradio-1cfa3791dab83b7bae1e4138f92e37364bd1c5ed.zip |
cmake: added ability to support -DENABLE_XXX=FORCE
Diffstat (limited to '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.") |