aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake/Modules
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-08-12 16:33:26 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-08-12 16:33:26 -0700
commitd745b5cf6d9a918be141339ceca5fbf9d6259eab (patch)
treee08c449fe7041b734cd537cdca06f68dac219387 /host/cmake/Modules
parent094bf7607362b08663c1b94ca05432da519036c5 (diff)
parentbc9dd05988454428de1b6efd235d980b8eaa9afe (diff)
downloaduhd-d745b5cf6d9a918be141339ceca5fbf9d6259eab.tar.gz
uhd-d745b5cf6d9a918be141339ceca5fbf9d6259eab.tar.bz2
uhd-d745b5cf6d9a918be141339ceca5fbf9d6259eab.zip
Merge branch 'master' into ashish/register_api
Diffstat (limited to 'host/cmake/Modules')
-rw-r--r--host/cmake/Modules/UHDComponent.cmake17
1 files changed, 15 insertions, 2 deletions
diff --git a/host/cmake/Modules/UHDComponent.cmake b/host/cmake/Modules/UHDComponent.cmake
index bf4a50e33..5a7dd8c86 100644
--- a/host/cmake/Modules/UHDComponent.cmake
+++ b/host/cmake/Modules/UHDComponent.cmake
@@ -1,5 +1,5 @@
#
-# Copyright 2010-2011,2013 Ettus Research LLC
+# Copyright 2010-2011,2013,2015 Ettus Research LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,18 +26,31 @@ SET(_uhd_disabled_components "" CACHE INTERNAL "" FORCE)
# - enb the default enable setting
# - deps a list of dependencies
# - dis the default disable setting
+# - req fail if dependencies not met (unless specifically disabled)
########################################################################
-MACRO(LIBUHD_REGISTER_COMPONENT name var enb deps dis)
+MACRO(LIBUHD_REGISTER_COMPONENT name var enb deps dis req)
MESSAGE(STATUS "")
MESSAGE(STATUS "Configuring ${name} support...")
FOREACH(dep ${deps})
MESSAGE(STATUS " Dependency ${dep} = ${${dep}}")
ENDFOREACH(dep)
+ #if user specified option, store here
+ IF("${${var}}" STREQUAL "OFF")
+ SET(user_disabled TRUE)
+ ELSE()
+ SET(user_disabled FALSE)
+ ENDIF("${${var}}" STREQUAL "OFF")
+
#setup the dependent option for this component
INCLUDE(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${enb} "${deps}" ${dis})
+ #if a required option's dependencies aren't met, fail unless user specifies otherwise
+ IF(NOT ${var} AND ${req} AND NOT user_disabled)
+ MESSAGE(FATAL_ERROR "Dependencies for required component ${name} not met.")
+ ENDIF(NOT ${var} AND ${req} AND NOT user_disabled)
+
#append the component into one of the lists
IF(${var})
MESSAGE(STATUS " Enabling ${name} support.")