summaryrefslogtreecommitdiffstats
path: root/host/Modules/UHDComponent.cmake
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-13 21:55:53 -0800
committerJosh Blum <josh@joshknows.com>2011-01-13 21:55:53 -0800
commit350c606585a45af79b8c6bf6b0e6753afa1d95d8 (patch)
tree86799018f81f8e2e3b14a1bbca887a97cafc162e /host/Modules/UHDComponent.cmake
parentdc3a6a0ad090df4f6aa8bc21a3d2b48f3715a6f6 (diff)
downloaduhd-350c606585a45af79b8c6bf6b0e6753afa1d95d8.tar.gz
uhd-350c606585a45af79b8c6bf6b0e6753afa1d95d8.tar.bz2
uhd-350c606585a45af79b8c6bf6b0e6753afa1d95d8.zip
uhd: tweak component macro for build system
make it a macro, not a function, fixed scoping also tweak the verbose, tell the user the flag there was a bug where enabled components disabled by dependencies were still enabled
Diffstat (limited to 'host/Modules/UHDComponent.cmake')
-rw-r--r--host/Modules/UHDComponent.cmake20
1 files changed, 4 insertions, 16 deletions
diff --git a/host/Modules/UHDComponent.cmake b/host/Modules/UHDComponent.cmake
index 0263b071f..63b32eadf 100644
--- a/host/Modules/UHDComponent.cmake
+++ b/host/Modules/UHDComponent.cmake
@@ -27,27 +27,15 @@ SET(_uhd_disabled_components "" CACHE INTERNAL "" FORCE)
# - deps a list of dependencies
# - dis the default disable setting
########################################################################
-FUNCTION(LIBUHD_REGISTER_COMPONENT name var enb deps dis)
- INCLUDE(CMakeDependentOption)
+MACRO(LIBUHD_REGISTER_COMPONENT name var enb deps dis)
MESSAGE(STATUS "")
MESSAGE(STATUS "Configuring ${name} support...")
- IF(DEFINED ${var})
- MESSAGE(STATUS "${name} support configured ${var}=${${var}}")
- ELSE(DEFINED ${var}) #not defined: automatic enabling of component
- MESSAGE(STATUS "${name} support configured automatically")
- ENDIF(DEFINED ${var})
+ MESSAGE(STATUS "Manually override with -D${var}=ON/OFF")
#setup the dependent option for this component
+ INCLUDE(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${enb} "${deps}" ${dis})
- #remove previous occurrence of component in either list
- IF(DEFINED _uhd_enabled_components)
- LIST(REMOVE_ITEM _uhd_enabled_components ${name})
- ENDIF(DEFINED _uhd_enabled_components)
- IF(DEFINED _uhd_disabled_components)
- LIST(REMOVE_ITEM _uhd_disabled_components ${name})
- ENDIF(DEFINED _uhd_disabled_components)
-
#append the component into one of the lists
IF(${var})
MESSAGE(STATUS " Enabling ${name} support.")
@@ -60,7 +48,7 @@ FUNCTION(LIBUHD_REGISTER_COMPONENT name var enb deps dis)
#make components lists into global variables
SET(_uhd_enabled_components ${_uhd_enabled_components} CACHE INTERNAL "" FORCE)
SET(_uhd_disabled_components ${_uhd_disabled_components} CACHE INTERNAL "" FORCE)
-ENDFUNCTION(LIBUHD_REGISTER_COMPONENT)
+ENDMACRO(LIBUHD_REGISTER_COMPONENT)
########################################################################
# Print the registered component summary