diff options
Diffstat (limited to 'host/lib/CMakeLists.txt')
-rw-r--r-- | host/lib/CMakeLists.txt | 70 |
1 files changed, 26 insertions, 44 deletions
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index 3a6860b93..28e4bcca2 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -61,32 +61,35 @@ 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) +MACRO(INCLUDE_SUBDIRECTORY subdir) + #insert the current directories on the front of the list + LIST(INSERT _cmake_source_dirs 0 ${CMAKE_CURRENT_SOURCE_DIR}) + LIST(INSERT _cmake_binary_dirs 0 ${CMAKE_CURRENT_BINARY_DIR}) + + #set the current directories to the names of the subdirs + SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}) + SET(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${subdir}) + + #include the subdirectory CMakeLists to run it + FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) + + #reset the value of the current directories + LIST(GET _cmake_source_dirs 0 CMAKE_CURRENT_SOURCE_DIR) + LIST(GET _cmake_binary_dirs 0 CMAKE_CURRENT_BINARY_DIR) + + #pop the subdir names of the front of the list + LIST(REMOVE_AT _cmake_source_dirs 0) + LIST(REMOVE_AT _cmake_binary_dirs 0) +ENDMACRO(INCLUDE_SUBDIRECTORY) ######################################################################## -# Include CMakeLists.txt from subdirectories +# Include subdirectories (different than add) ######################################################################## -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ic_reg_maps/CMakeLists.txt) -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/transport/CMakeLists.txt) -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/usrp/CMakeLists.txt) -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/utils/CMakeLists.txt) +INCLUDE_SUBDIRECTORY(ic_reg_maps) +INCLUDE_SUBDIRECTORY(transport) +INCLUDE_SUBDIRECTORY(usrp) +INCLUDE_SUBDIRECTORY(utils) ######################################################################## # Append to the list of sources for lib uhd @@ -128,24 +131,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 "") |