diff options
author | Nicholas Corgan <nick.corgan@ettus.com> | 2013-05-10 14:59:04 -0700 |
---|---|---|
committer | Nicholas Corgan <nick.corgan@ettus.com> | 2013-05-10 15:04:00 -0700 |
commit | 4b72513a8930ec4147dab76c079afa1186e335cd (patch) | |
tree | c83c3323385266fe99f5132dbfc74fb636b9e6ba /host/CMakeLists.txt | |
parent | d63ce4fc3aabc208d97b5ff2a14bf2ba351103e7 (diff) | |
download | uhd-4b72513a8930ec4147dab76c079afa1186e335cd.tar.gz uhd-4b72513a8930ec4147dab76c079afa1186e335cd.tar.bz2 uhd-4b72513a8930ec4147dab76c079afa1186e335cd.zip |
Added CMake variables to customize builds to match Debian package configurations
* -DLIBUHD_PKG=ON installs with libuhd003 configuration
* -DLIBUHDDEV_PKG=ON installs with libuhd-dev configuration
* -DUHDHOST_PKG=ON installs with uhd-host configuration
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r-- | host/CMakeLists.txt | 51 |
1 files changed, 36 insertions, 15 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index eef9aa2e7..c7332e3a2 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2010-2012 Ettus Research LLC +# Copyright 2010-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 @@ -27,6 +27,15 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(UHD CXX) ENABLE_TESTING() LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) + +######################################################################## +# Packaging Variables +######################################################################## + +SET(LIBUHD_PKG ${LIBUHD_PKG} CACHE BOOL "Build Debian libuhd003 package") +SET(LIBUHDDEV_PKG ${LIBUHDDEV_PKG} CACHE BOOL "Build Debian libuhd-dev package") +SET(UHDHOST_PKG ${UHDPOST_PKG} CACHE BOOL "Build Debian uhd-host package") + INCLUDE(UHDComponent) #enable components INCLUDE(UHDPackage) #setup cpack @@ -187,7 +196,7 @@ ADD_CUSTOM_TARGET(uninstall ######################################################################## # Install Package Docs ######################################################################## -INSTALL(FILES +UHD_INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/README.txt ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt ${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS.txt @@ -215,12 +224,12 @@ LIBUHD_REGISTER_COMPONENT("Tests" ENABLE_TESTS ON "ENABLE_LIBUHD" OFF) ######################################################################## ADD_SUBDIRECTORY(docs) +ADD_SUBDIRECTORY(include) + IF(ENABLE_EXAMPLES) ADD_SUBDIRECTORY(examples) ENDIF(ENABLE_EXAMPLES) -ADD_SUBDIRECTORY(include) - IF(ENABLE_LIBUHD) ADD_SUBDIRECTORY(lib) ENDIF(ENABLE_LIBUHD) @@ -255,16 +264,18 @@ IF(CMAKE_CROSSCOMPILING) UNSET(UHD_PC_LIBS) ENDIF(CMAKE_CROSSCOMPILING) -CONFIGURE_FILE( - ${CMAKE_CURRENT_SOURCE_DIR}/uhd.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc -@ONLY) +IF(NOT LIBUHD_PKG AND NOT UHDHOST_PKG) + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/uhd.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc + @ONLY) -INSTALL( - FILES ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc - DESTINATION ${LIBRARY_DIR}/pkgconfig - COMPONENT libraries -) + INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/uhd.pc + DESTINATION ${LIBRARY_DIR}/pkgconfig + COMPONENT libraries + ) +ENDIF(NOT LIBUHD_PKG AND NOT UHDHOST_PKG) ######################################################################## # Handle pre-built images @@ -275,13 +286,23 @@ IF(DEFINED UHD_IMAGES_DIR AND EXISTS "${UHD_IMAGES_DIR}") FOREACH(_img ${_image_files}) MESSAGE(STATUS " ${_img}") ENDFOREACH(_img) - INSTALL(FILES ${_image_files} DESTINATION ${PKG_DATA_DIR}/images COMPONENT images) + UHD_INSTALL(FILES ${_image_files} DESTINATION ${PKG_DATA_DIR}/images COMPONENT images) ENDIF(DEFINED UHD_IMAGES_DIR AND EXISTS "${UHD_IMAGES_DIR}") ######################################################################## # Print Summary ######################################################################## +IF(LIBUHD_PKG) + MESSAGE(STATUS "") + SET(PRINT_APPEND " (Debian libuhd003 package configuration)") +ELSEIF(LIBUHDDEV_PKG) + MESSAGE(STATUS "") + SET(PRINT_APPEND " (Debian libuhd-dev package configuration)") +ELSEIF(UHDHOST_PKG) + MESSAGE(STATUS "") + SET(PRINT_APPEND " (Debian uhd-host package configuration)") +ENDIF(LIBUHD_PKG) UHD_PRINT_COMPONENT_SUMMARY() -MESSAGE(STATUS "Building version: ${UHD_VERSION}") +MESSAGE(STATUS "Building version: ${UHD_VERSION}${PRINT_APPEND}") MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") MESSAGE(STATUS "Compatible images can be downloaded from: ${UHD_IMAGES_DOWNLOAD_SRC}") |