diff options
author | Josh Blum <josh@joshknows.com> | 2010-12-20 01:23:31 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-12-20 01:23:31 -0800 |
commit | 47c92a2ac68fbae59c02f3e2a322cabda499c13b (patch) | |
tree | 7cc4a4918b1feb09531607bfe22e976228034a70 /host/lib | |
parent | 91e090295c8c623b73e20a4d217601c4453650a8 (diff) | |
download | uhd-47c92a2ac68fbae59c02f3e2a322cabda499c13b.tar.gz uhd-47c92a2ac68fbae59c02f3e2a322cabda499c13b.tar.bz2 uhd-47c92a2ac68fbae59c02f3e2a322cabda499c13b.zip |
uhd: implemented top-level component registry
now docs, examples, utils, usb, are configurable components with dependencies
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/CMakeLists.txt | 40 | ||||
-rw-r--r-- | host/lib/transport/CMakeLists.txt | 13 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/CMakeLists.txt | 7 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp_e100/CMakeLists.txt | 2 |
5 files changed, 8 insertions, 56 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index a198b476a..e4de7bcc7 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -61,25 +61,6 @@ 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}) - OPTION(${var} "enable ${name} support" ${${var}}) - 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 ######################################################################## @@ -128,24 +109,3 @@ 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 "") diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt index b5f1fc940..4d0a0f1f7 100644 --- a/host/lib/transport/CMakeLists.txt +++ b/host/lib/transport/CMakeLists.txt @@ -20,12 +20,12 @@ ######################################################################## # Setup libusb ######################################################################## -MESSAGE(STATUS "") -MESSAGE(STATUS "Configuring USB support...") LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/lib/transport) FIND_PACKAGE(USB1 REQUIRED) -IF(LIBUSB_FOUND) +LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF) + +IF(ENABLE_USB) MESSAGE(STATUS "USB support enabled via libusb.") INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIR}) LIBUHD_APPEND_LIBS(${LIBUSB_LIBRARIES}) @@ -38,14 +38,11 @@ IF(LIBUSB_FOUND) IF(MSVC) #include our custom stdint for libusb INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/transport/msvc) ENDIF(MSVC) - SET(HAVE_USB_SUPPORT TRUE) -ELSE(LIBUSB_FOUND) - MESSAGE(STATUS "USB support disabled.") +ELSE(ENABLE_USB) LIBUHD_APPEND_SOURCES( ${CMAKE_SOURCE_DIR}/lib/transport/usb_dummy_impl.cpp ) - SET(HAVE_USB_SUPPORT FALSE) -ENDIF(LIBUSB_FOUND) +ENDIF(ENABLE_USB) ######################################################################## # Check for SIMD headers diff --git a/host/lib/usrp/usrp1/CMakeLists.txt b/host/lib/usrp/usrp1/CMakeLists.txt index 8b6ba78d2..13db50790 100644 --- a/host/lib/usrp/usrp1/CMakeLists.txt +++ b/host/lib/usrp/usrp1/CMakeLists.txt @@ -20,12 +20,7 @@ ######################################################################## # Conditionally configure the USRP1 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("USRP1" ENABLE_USRP1 ${HAVE_USB_SUPPORT}) - -#sanity check when USRP1 support enabled -IF(ENABLE_USRP1 AND NOT HAVE_USB_SUPPORT) - MESSAGE(FATAL_ERROR "USRP1 support enabled without USB support") -ENDIF(ENABLE_USRP1 AND NOT HAVE_USB_SUPPORT) +LIBUHD_REGISTER_COMPONENT("USRP1" ENABLE_USRP1 ON "ENABLE_LIBUHD;ENABLE_USB" OFF) IF(ENABLE_USRP1) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/../firmware/fx2/common) diff --git a/host/lib/usrp/usrp2/CMakeLists.txt b/host/lib/usrp/usrp2/CMakeLists.txt index afd69cae9..43f384015 100644 --- a/host/lib/usrp/usrp2/CMakeLists.txt +++ b/host/lib/usrp/usrp2/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Conditionally configure the USRP2 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("USRP2" ENABLE_USRP2 TRUE) +LIBUHD_REGISTER_COMPONENT("USRP2" ENABLE_USRP2 ON "ENABLE_LIBUHD" OFF) IF(ENABLE_USRP2) LIBUHD_APPEND_SOURCES( diff --git a/host/lib/usrp/usrp_e100/CMakeLists.txt b/host/lib/usrp/usrp_e100/CMakeLists.txt index 3c5c58ee0..42db82321 100644 --- a/host/lib/usrp/usrp_e100/CMakeLists.txt +++ b/host/lib/usrp/usrp_e100/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Conditionally configure the USRP-E100 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("USRP-E100" ENABLE_USRP_E100 FALSE) +LIBUHD_REGISTER_COMPONENT("USRP-E100" ENABLE_USRP_E100 OFF "ENABLE_LIBUHD" ON) IF(ENABLE_USRP_E100) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/usrp/usrp_e100/include) |