aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake/Modules/UHDComponent.cmake
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2013-05-10 15:07:03 -0700
committerNicholas Corgan <nick.corgan@ettus.com>2013-05-10 15:07:03 -0700
commit6524f46bc54c36f8d50d6a3aa1c17aafb0a47d75 (patch)
tree40a0cf8ec54bae728041d7304ecd841339bace81 /host/cmake/Modules/UHDComponent.cmake
parentc6dcb2b4b63841925f4863bc0adbda9b2048475a (diff)
parent4b72513a8930ec4147dab76c079afa1186e335cd (diff)
downloaduhd-6524f46bc54c36f8d50d6a3aa1c17aafb0a47d75.tar.gz
uhd-6524f46bc54c36f8d50d6a3aa1c17aafb0a47d75.tar.bz2
uhd-6524f46bc54c36f8d50d6a3aa1c17aafb0a47d75.zip
Merge branch 'maint'
Conflicts: host/tests/CMakeLists.txt
Diffstat (limited to 'host/cmake/Modules/UHDComponent.cmake')
-rw-r--r--host/cmake/Modules/UHDComponent.cmake56
1 files changed, 55 insertions, 1 deletions
diff --git a/host/cmake/Modules/UHDComponent.cmake b/host/cmake/Modules/UHDComponent.cmake
index 52b7450d5..d0b8442d9 100644
--- a/host/cmake/Modules/UHDComponent.cmake
+++ b/host/cmake/Modules/UHDComponent.cmake
@@ -1,5 +1,5 @@
#
-# Copyright 2010-2011 Ettus Research LLC
+# Copyright 2010-2011,2013 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
@@ -54,6 +54,60 @@ MACRO(LIBUHD_REGISTER_COMPONENT name var enb deps dis)
ENDMACRO(LIBUHD_REGISTER_COMPONENT)
########################################################################
+# Install only if appropriate for package and if component is enabled
+########################################################################
+FUNCTION(UHD_INSTALL)
+ include(CMakeParseArguments)
+ CMAKE_PARSE_ARGUMENTS(UHD_INSTALL "" "DESTINATION;COMPONENT" "TARGETS;FILES;PROGRAMS" ${ARGN})
+
+ IF(UHD_INSTALL_FILES)
+ SET(TO_INSTALL "${UHD_INSTALL_FILES}")
+ ELSEIF(UHD_INSTALL_PROGRAMS)
+ SET(TO_INSTALL "${UHD_INSTALL_PROGRAMS}")
+ ELSEIF(UHD_INSTALL_TARGETS)
+ SET(TO_INSTALL "${UHD_INSTALL_TARGETS}")
+ ENDIF(UHD_INSTALL_FILES)
+
+ IF(UHD_INSTALL_COMPONENT STREQUAL "headers")
+ IF(NOT LIBUHD_PKG AND NOT UHDHOST_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT UHDHOST_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "examples")
+ IF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "tests")
+ IF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "utilities")
+ IF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "manual")
+ IF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "doxygen")
+ IF(NOT LIBUHD_PKG AND NOT UHDHOST_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT UHDHOST_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "manpages")
+ IF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "images")
+ IF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG AND NOT UHDHOST_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG AND NOT UHDHOST_PKG)
+ ELSEIF(UHD_INSTALL_COMPONENT STREQUAL "readme")
+ IF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG AND NOT UHDHOST_PKG)
+ INSTALL(${ARGN})
+ ENDIF(NOT LIBUHD_PKG AND NOT LIBUHDDEV_PKG AND NOT UHDHOST_PKG)
+ ENDIF(UHD_INSTALL_COMPONENT STREQUAL "headers")
+ENDFUNCTION(UHD_INSTALL)
+
+########################################################################
# Print the registered component summary
########################################################################
FUNCTION(UHD_PRINT_COMPONENT_SUMMARY)