summaryrefslogtreecommitdiffstats
path: root/host/CMakeLists.txt
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-20 01:23:31 -0800
committerJosh Blum <josh@joshknows.com>2010-12-20 01:23:31 -0800
commit47c92a2ac68fbae59c02f3e2a322cabda499c13b (patch)
tree7cc4a4918b1feb09531607bfe22e976228034a70 /host/CMakeLists.txt
parent91e090295c8c623b73e20a4d217601c4453650a8 (diff)
downloaduhd-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/CMakeLists.txt')
-rw-r--r--host/CMakeLists.txt37
1 files changed, 32 insertions, 5 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 75331ddfc..efc439af0 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -22,6 +22,7 @@ ENABLE_TESTING()
########################################################################
# Config Files (include order is important)
########################################################################
+INCLUDE(${CMAKE_SOURCE_DIR}/config/Component.cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/config/Python.cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/config/Version.cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/config/CPack.cmake)
@@ -34,7 +35,6 @@ SET(LIBRARY_DIR lib${LIB_SUFFIX})
SET(INCLUDE_DIR include)
SET(PKG_DATA_DIR share/uhd)
SET(PKG_DOC_DIR share/doc/uhd)
-MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
########################################################################
# Local Include Dir
@@ -134,11 +134,38 @@ INSTALL(FILES
)
########################################################################
+# Register top level components
+########################################################################
+SET(ENABLE_LIBUHD ON) #always enabled
+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)
+
+########################################################################
# Add the subdirectories
########################################################################
ADD_SUBDIRECTORY(docs)
-ADD_SUBDIRECTORY(examples)
+
+IF(ENABLE_EXAMPLES)
+ ADD_SUBDIRECTORY(examples)
+ENDIF(ENABLE_EXAMPLES)
+
ADD_SUBDIRECTORY(include)
-ADD_SUBDIRECTORY(lib)
-ADD_SUBDIRECTORY(test)
-ADD_SUBDIRECTORY(utils)
+
+IF(ENABLE_LIBUHD)
+ ADD_SUBDIRECTORY(lib)
+ENDIF(ENABLE_LIBUHD)
+
+IF(ENABLE_TESTS)
+ ADD_SUBDIRECTORY(test)
+ENDIF(ENABLE_TESTS)
+
+IF(ENABLE_UTILS)
+ ADD_SUBDIRECTORY(utils)
+ENDIF(ENABLE_UTILS)
+
+########################################################################
+# Print Summary
+########################################################################
+UHD_PRINT_COMPONENT_SUMMARY()
+MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")