From 47c92a2ac68fbae59c02f3e2a322cabda499c13b Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 20 Dec 2010 01:23:31 -0800 Subject: uhd: implemented top-level component registry now docs, examples, utils, usb, are configurable components with dependencies --- host/CMakeLists.txt | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'host/CMakeLists.txt') 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 @@ -133,12 +133,39 @@ INSTALL(FILES DESTINATION ${PKG_DOC_DIR} ) +######################################################################## +# 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}") -- cgit v1.2.3