aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-11-29 19:09:43 -0500
committerJosh Blum <josh@joshknows.com>2010-11-29 19:09:43 -0500
commit5e4875eb188d80ef6a0321d7fe03c595370062a2 (patch)
tree6638704433bba89b3f6af332cf8b86b1865a0694 /host/lib/CMakeLists.txt
parentd96252d6dcf24a8dec9a2f171bd8f305702d8432 (diff)
downloaduhd-5e4875eb188d80ef6a0321d7fe03c595370062a2.tar.gz
uhd-5e4875eb188d80ef6a0321d7fe03c595370062a2.tar.bz2
uhd-5e4875eb188d80ef6a0321d7fe03c595370062a2.zip
uhd: added macro to enable/disable components
libuhd prints summary of components added newline prints before config checks
Diffstat (limited to 'host/lib/CMakeLists.txt')
-rw-r--r--host/lib/CMakeLists.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index e4de7bcc7..3a6860b93 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -61,6 +61,25 @@ MACRO(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile)
LIBUHD_APPEND_SOURCES(${outfile})
ENDMACRO(LIBUHD_PYTHON_GEN_SOURCE)
+MACRO(LIBUHD_REGISTER_COMPONENT name var auto)
+ 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
+ SET(${var} ${auto})
+ MESSAGE(STATUS "${name} support configured automatically")
+ ENDIF(DEFINED ${var})
+ SET(${var} ${${var}} CACHE BOOL "enable ${name} support")
+ IF(${var})
+ MESSAGE(STATUS " Enabling ${name} support.")
+ LIST(APPEND _libuhd_enabled_components ${name})
+ ELSE(${var})
+ MESSAGE(STATUS " Disabling ${name} support.")
+ LIST(APPEND _libuhd_disabled_components ${name})
+ ENDIF(${var})
+ENDMACRO(LIBUHD_REGISTER_COMPONENT)
+
########################################################################
# Include CMakeLists.txt from subdirectories
########################################################################
@@ -109,3 +128,24 @@ INSTALL(TARGETS uhd
ARCHIVE DESTINATION ${LIBRARY_DIR} # .lib file
RUNTIME DESTINATION ${LIBRARY_DIR} # .dll file
)
+
+########################################################################
+# Print configuration summary
+########################################################################
+MESSAGE(STATUS "")
+MESSAGE(STATUS "######################################################")
+MESSAGE(STATUS "# LibUHD enabled components ")
+MESSAGE(STATUS "######################################################")
+FOREACH(comp ${_libuhd_enabled_components})
+ MESSAGE(STATUS " * ${comp}")
+ENDFOREACH(comp)
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "######################################################")
+MESSAGE(STATUS "# LibUHD disabled components ")
+MESSAGE(STATUS "######################################################")
+FOREACH(comp ${_libuhd_disabled_components})
+ MESSAGE(STATUS " * ${comp}")
+ENDFOREACH(comp)
+
+MESSAGE(STATUS "")