diff options
author | Nicholas Corgan <nick.corgan@ettus.com> | 2015-08-11 10:51:23 -0700 |
---|---|---|
committer | Nicholas Corgan <nick.corgan@ettus.com> | 2015-08-11 10:51:23 -0700 |
commit | 0dbaf46b5cac9179312c0e9c00e9cc1462322d66 (patch) | |
tree | 4ce140ad87238bc87c84169fd70d1a56953a4f09 /host | |
parent | 28327c8e8a810b19da126116d0dc4c26b643baed (diff) | |
download | uhd-0dbaf46b5cac9179312c0e9c00e9cc1462322d66.tar.gz uhd-0dbaf46b5cac9179312c0e9c00e9cc1462322d66.tar.bz2 uhd-0dbaf46b5cac9179312c0e9c00e9cc1462322d66.zip |
cmake: added variable to LIBUHD_REGISTER_COMPONENT macro to make required, set LibUHD to required
* If required component's dependencies aren't met, CMake will throw an error unless user specifically disables it
Diffstat (limited to 'host')
-rw-r--r-- | host/CMakeLists.txt | 10 | ||||
-rw-r--r-- | host/cmake/Modules/UHDComponent.cmake | 17 | ||||
-rw-r--r-- | host/docs/CMakeLists.txt | 6 | ||||
-rw-r--r-- | host/lib/transport/CMakeLists.txt | 4 | ||||
-rw-r--r-- | host/lib/usrp/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/usrp/b100/CMakeLists.txt | 4 | ||||
-rw-r--r-- | host/lib/usrp/b200/CMakeLists.txt | 4 | ||||
-rw-r--r-- | host/lib/usrp/e100/CMakeLists.txt | 4 | ||||
-rw-r--r-- | host/lib/usrp/e300/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/CMakeLists.txt | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/usrp/x300/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/usrp_clock/octoclock/CMakeLists.txt | 2 |
13 files changed, 38 insertions, 25 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 89447c12c..7f7c9fe4c 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -276,11 +276,11 @@ SET(UHD_IMAGES_DOWNLOAD_SRC "uhd-images_003.009.git-269-gb6ad4c05.zip") ######################################################################## # Register top level components ######################################################################## -LIBUHD_REGISTER_COMPONENT("LibUHD" ENABLE_LIBUHD ON "Boost_FOUND;HAVE_PYTHON_PLAT_MIN_VERSION;HAVE_PYTHON_MODULE_MAKO" OFF) -LIBUHD_REGISTER_COMPONENT("LibUHD - C API" ENABLE_C_API ON "ENABLE_LIBUHD" OFF) -LIBUHD_REGISTER_COMPONENT("Examples" ENABLE_EXAMPLES ON "ENABLE_LIBUHD" OFF) -LIBUHD_REGISTER_COMPONENT("Utils" ENABLE_UTILS ON "ENABLE_LIBUHD" OFF) -LIBUHD_REGISTER_COMPONENT("Tests" ENABLE_TESTS ON "ENABLE_LIBUHD" OFF) +LIBUHD_REGISTER_COMPONENT("LibUHD" ENABLE_LIBUHD ON "Boost_FOUND;HAVE_PYTHON_PLAT_MIN_VERSION;HAVE_PYTHON_MODULE_MAKO" OFF ON) +LIBUHD_REGISTER_COMPONENT("LibUHD - C API" ENABLE_C_API ON "ENABLE_LIBUHD" OFF OFF) +LIBUHD_REGISTER_COMPONENT("Examples" ENABLE_EXAMPLES ON "ENABLE_LIBUHD" OFF OFF) +LIBUHD_REGISTER_COMPONENT("Utils" ENABLE_UTILS ON "ENABLE_LIBUHD" OFF OFF) +LIBUHD_REGISTER_COMPONENT("Tests" ENABLE_TESTS ON "ENABLE_LIBUHD" OFF OFF) ######################################################################## # Check for fpga-src submodule 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.") diff --git a/host/docs/CMakeLists.txt b/host/docs/CMakeLists.txt index 063bfd901..3090d3f80 100644 --- a/host/docs/CMakeLists.txt +++ b/host/docs/CMakeLists.txt @@ -28,7 +28,7 @@ SET(ENABLE_MANUAL_OR_DOXYGEN false) ######################################################################## # Setup Manual (using Doxygen) ######################################################################## -LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "DOXYGEN_FOUND" OFF) +LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "DOXYGEN_FOUND" OFF OFF) # Check if fpga submodule is there. If yes: # - Add fpga-src/docs and fpga-src/README.md to inputs @@ -64,7 +64,7 @@ ENDIF(ENABLE_MANUAL) # Setup API documentation (using Doxygen) ######################################################################## MESSAGE(STATUS "") -LIBUHD_REGISTER_COMPONENT("API/Doxygen" ENABLE_DOXYGEN ON "DOXYGEN_FOUND" OFF) +LIBUHD_REGISTER_COMPONENT("API/Doxygen" ENABLE_DOXYGEN ON "DOXYGEN_FOUND" OFF OFF) OPTION(ENABLE_DOXYGEN_FULL "Use Doxygen to document the entire source tree (not just API)" OFF) IF(LIBUHDDEV_PKG) @@ -141,7 +141,7 @@ IF(NOT WIN32) SET(NOT_WIN32 TRUE) ENDIF(NOT WIN32) -LIBUHD_REGISTER_COMPONENT("Man Pages" ENABLE_MAN_PAGES ON "GZIP_FOUND;NOT_WIN32" OFF) +LIBUHD_REGISTER_COMPONENT("Man Pages" ENABLE_MAN_PAGES ON "GZIP_FOUND;NOT_WIN32" OFF OFF) IF(ENABLE_MAN_PAGES) #Generate man pages diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt index 9ec8a5c0b..6abc399b4 100644 --- a/host/lib/transport/CMakeLists.txt +++ b/host/lib/transport/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2010-2013 Ettus Research LLC +# Copyright 2010-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 @@ -30,7 +30,7 @@ INCLUDE_SUBDIRECTORY(nirio) MESSAGE(STATUS "") FIND_PACKAGE(USB1) -LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF) +LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF OFF) IF(ENABLE_USB) MESSAGE(STATUS "USB support enabled via libusb.") diff --git a/host/lib/usrp/CMakeLists.txt b/host/lib/usrp/CMakeLists.txt index e01e5e09d..5c9592970 100644 --- a/host/lib/usrp/CMakeLists.txt +++ b/host/lib/usrp/CMakeLists.txt @@ -43,7 +43,7 @@ IF(ENABLE_C_API) ) ENDIF(ENABLE_C_API) -LIBUHD_REGISTER_COMPONENT("GPSD" ENABLE_GPSD OFF "ENABLE_LIBUHD;ENABLE_GPSD;LIBGPS_FOUND" OFF) +LIBUHD_REGISTER_COMPONENT("GPSD" ENABLE_GPSD OFF "ENABLE_LIBUHD;ENABLE_GPSD;LIBGPS_FOUND" OFF OFF) IF(ENABLE_GPSD) LIBUHD_APPEND_SOURCES( diff --git a/host/lib/usrp/b100/CMakeLists.txt b/host/lib/usrp/b100/CMakeLists.txt index bcc5ac74d..1558cd974 100644 --- a/host/lib/usrp/b100/CMakeLists.txt +++ b/host/lib/usrp/b100/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2011-2013 Ettus Research LLC +# Copyright 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 @@ -22,7 +22,7 @@ ######################################################################## # Conditionally configure the B100 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("B100" ENABLE_B100 ON "ENABLE_LIBUHD;ENABLE_USB" OFF) +LIBUHD_REGISTER_COMPONENT("B100" ENABLE_B100 ON "ENABLE_LIBUHD;ENABLE_USB" OFF OFF) IF(ENABLE_B100) LIBUHD_APPEND_SOURCES( diff --git a/host/lib/usrp/b200/CMakeLists.txt b/host/lib/usrp/b200/CMakeLists.txt index cd8ebcba7..76710dc65 100644 --- a/host/lib/usrp/b200/CMakeLists.txt +++ b/host/lib/usrp/b200/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2012-2013 Ettus Research LLC +# Copyright 2012-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 @@ -22,7 +22,7 @@ ######################################################################## # Conditionally configure the B200 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("B200" ENABLE_B200 ON "ENABLE_LIBUHD;ENABLE_USB" OFF) +LIBUHD_REGISTER_COMPONENT("B200" ENABLE_B200 ON "ENABLE_LIBUHD;ENABLE_USB" OFF OFF) IF(ENABLE_B200) LIBUHD_APPEND_SOURCES( diff --git a/host/lib/usrp/e100/CMakeLists.txt b/host/lib/usrp/e100/CMakeLists.txt index ac9d8c655..2a1e14eab 100644 --- a/host/lib/usrp/e100/CMakeLists.txt +++ b/host/lib/usrp/e100/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2010-2011 Ettus Research LLC +# Copyright 2010-2011,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 @@ -22,7 +22,7 @@ ######################################################################## # Conditionally configure the USRP-E100 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("E100" ENABLE_E100 OFF "ENABLE_LIBUHD;LINUX" OFF) +LIBUHD_REGISTER_COMPONENT("E100" ENABLE_E100 OFF "ENABLE_LIBUHD;LINUX" OFF OFF) IF(ENABLE_E100) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/host/lib/usrp/e300/CMakeLists.txt b/host/lib/usrp/e300/CMakeLists.txt index ae817c620..9c8aa29b9 100644 --- a/host/lib/usrp/e300/CMakeLists.txt +++ b/host/lib/usrp/e300/CMakeLists.txt @@ -24,7 +24,7 @@ ######################################################################## find_package(UDev) -LIBUHD_REGISTER_COMPONENT("E300" ENABLE_E300 OFF "ENABLE_LIBUHD" OFF) +LIBUHD_REGISTER_COMPONENT("E300" ENABLE_E300 OFF "ENABLE_LIBUHD" OFF OFF) IF(ENABLE_E300) LIST(APPEND E300_SOURCES diff --git a/host/lib/usrp/usrp1/CMakeLists.txt b/host/lib/usrp/usrp1/CMakeLists.txt index 70bebe502..47344e841 100644 --- a/host/lib/usrp/usrp1/CMakeLists.txt +++ b/host/lib/usrp/usrp1/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2010-2011 Ettus Research LLC +# Copyright 2010-2011,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 @@ -22,7 +22,7 @@ ######################################################################## # Conditionally configure the USRP1 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("USRP1" ENABLE_USRP1 ON "ENABLE_LIBUHD;ENABLE_USB" OFF) +LIBUHD_REGISTER_COMPONENT("USRP1" ENABLE_USRP1 ON "ENABLE_LIBUHD;ENABLE_USB" OFF OFF) IF(ENABLE_USRP1) LIBUHD_APPEND_SOURCES( diff --git a/host/lib/usrp/usrp2/CMakeLists.txt b/host/lib/usrp/usrp2/CMakeLists.txt index bd302895b..d9894adaf 100644 --- a/host/lib/usrp/usrp2/CMakeLists.txt +++ b/host/lib/usrp/usrp2/CMakeLists.txt @@ -22,7 +22,7 @@ ######################################################################## # Conditionally configure the USRP2 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("USRP2" ENABLE_USRP2 ON "ENABLE_LIBUHD" OFF) +LIBUHD_REGISTER_COMPONENT("USRP2" ENABLE_USRP2 ON "ENABLE_LIBUHD" OFF OFF) IF(ENABLE_USRP2) LIBUHD_APPEND_SOURCES( diff --git a/host/lib/usrp/x300/CMakeLists.txt b/host/lib/usrp/x300/CMakeLists.txt index 9a8601452..3d6348eec 100644 --- a/host/lib/usrp/x300/CMakeLists.txt +++ b/host/lib/usrp/x300/CMakeLists.txt @@ -22,7 +22,7 @@ ######################################################################## # Conditionally configure the X300 support ######################################################################## -LIBUHD_REGISTER_COMPONENT("X300" ENABLE_X300 ON "ENABLE_LIBUHD" OFF) +LIBUHD_REGISTER_COMPONENT("X300" ENABLE_X300 ON "ENABLE_LIBUHD" OFF OFF) IF(ENABLE_X300) LIBUHD_APPEND_SOURCES( diff --git a/host/lib/usrp_clock/octoclock/CMakeLists.txt b/host/lib/usrp_clock/octoclock/CMakeLists.txt index c489657e2..96b670115 100644 --- a/host/lib/usrp_clock/octoclock/CMakeLists.txt +++ b/host/lib/usrp_clock/octoclock/CMakeLists.txt @@ -18,7 +18,7 @@ ######################################################################## # Conditionally configure the OctoClock support ######################################################################## -LIBUHD_REGISTER_COMPONENT("OctoClock" ENABLE_OCTOCLOCK ON "ENABLE_LIBUHD" OFF) +LIBUHD_REGISTER_COMPONENT("OctoClock" ENABLE_OCTOCLOCK ON "ENABLE_LIBUHD" OFF OFF) IF(ENABLE_OCTOCLOCK) LIBUHD_APPEND_SOURCES( |