aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-22 17:33:43 -0800
committerJosh Blum <josh@joshknows.com>2010-12-22 17:33:43 -0800
commit67e89717659605e4d8e0ddd26e4ccef4dec24eb2 (patch)
treea011be8ad75e13fd98d61c8b31ed218e0bce687c /host/lib/CMakeLists.txt
parent94682e4b04d9304a2f39c192bf423c4ee9f38e69 (diff)
parent8f93121987af42d8b049d29cd8ea101a6306fa87 (diff)
downloaduhd-67e89717659605e4d8e0ddd26e4ccef4dec24eb2.tar.gz
uhd-67e89717659605e4d8e0ddd26e4ccef4dec24eb2.tar.bz2
uhd-67e89717659605e4d8e0ddd26e4ccef4dec24eb2.zip
Merge branch 'master' into next
Conflicts: host/lib/usrp/usrp2/CMakeLists.txt
Diffstat (limited to 'host/lib/CMakeLists.txt')
-rw-r--r--host/lib/CMakeLists.txt70
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 "")