aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-11-13 21:53:22 -0800
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-11-14 14:10:09 -0800
commita69ab0c23a0c38e3fed3e412df36538d8959d23c (patch)
treee6669a138dad84f79c46588f43a38c69dda90246 /host
parent4247f025020d7dd1f696dfbd3cce248957d6ace7 (diff)
downloaduhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.gz
uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.bz2
uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.zip
cmake: Update coding style to use lowercase commands
Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
Diffstat (limited to 'host')
-rw-r--r--host/CMakeLists.txt658
-rw-r--r--host/cmake/Modules/CMakeParseArgumentsCopy.cmake6
-rw-r--r--host/cmake/Modules/CodeCoverage.cmake102
-rw-r--r--host/cmake/Modules/FindDocutils.cmake4
-rw-r--r--host/cmake/Modules/FindGPSD.cmake28
-rw-r--r--host/cmake/Modules/FindGZip.cmake4
-rw-r--r--host/cmake/Modules/FindLIBERIO.cmake8
-rw-r--r--host/cmake/Modules/FindUSB1.cmake8
-rw-r--r--host/cmake/Modules/UHDBuildInfo.cmake66
-rw-r--r--host/cmake/Modules/UHDComponent.cmake208
-rw-r--r--host/cmake/Modules/UHDConfig.cmake.in96
-rw-r--r--host/cmake/Modules/UHDConfigVersion.cmake.in140
-rw-r--r--host/cmake/Modules/UHDGlobalDefs.cmake20
-rw-r--r--host/cmake/Modules/UHDLog.cmake114
-rw-r--r--host/cmake/Modules/UHDPackage.cmake256
-rw-r--r--host/cmake/Modules/UHDPython.cmake96
-rw-r--r--host/cmake/Modules/UHDUnitTest.cmake4
-rw-r--r--host/cmake/Modules/UHDVersion.cmake144
-rw-r--r--host/cmake/Toolchains/mingw_cross.cmake48
-rw-r--r--host/cmake/cmake_uninstall.cmake.in46
-rw-r--r--host/docs/CMakeLists.txt152
-rw-r--r--host/examples/CMakeLists.txt76
-rw-r--r--host/examples/getopt/CMakeLists.txt4
-rw-r--r--host/examples/init_usrp/CMakeLists.txt48
-rw-r--r--host/examples/python/CMakeLists.txt2
-rw-r--r--host/include/CMakeLists.txt8
-rw-r--r--host/include/uhd/CMakeLists.txt24
-rw-r--r--host/include/uhd/rfnoc/CMakeLists.txt8
-rw-r--r--host/include/uhd/rfnoc/blocks/CMakeLists.txt2
-rw-r--r--host/include/uhd/types/CMakeLists.txt4
-rw-r--r--host/include/uhd/usrp/CMakeLists.txt4
-rw-r--r--host/include/uhd/usrp_clock/CMakeLists.txt4
-rw-r--r--host/include/uhd/utils/CMakeLists.txt4
-rw-r--r--host/lib/CMakeLists.txt162
-rw-r--r--host/lib/cal/CMakeLists.txt8
-rw-r--r--host/lib/convert/CMakeLists.txt62
-rw-r--r--host/lib/deps/CMakeLists.txt6
-rw-r--r--host/lib/deps/rpc_CMakeLists.txt34
-rw-r--r--host/lib/deps/rpclib/CMakeLists.txt34
-rw-r--r--host/lib/experts/CMakeLists.txt12
-rw-r--r--host/lib/ic_reg_maps/CMakeLists.txt6
-rw-r--r--host/lib/include/CMakeLists.txt2
-rw-r--r--host/lib/rfnoc/nocscript/CMakeLists.txt8
-rw-r--r--host/lib/transport/CMakeLists.txt94
-rw-r--r--host/lib/transport/nirio/CMakeLists.txt8
-rw-r--r--host/lib/transport/nirio/lvbitx/CMakeLists.txt32
-rw-r--r--host/lib/types/CMakeLists.txt4
-rw-r--r--host/lib/usrp/CMakeLists.txt10
-rw-r--r--host/lib/usrp/b100/CMakeLists.txt4
-rw-r--r--host/lib/usrp/b200/CMakeLists.txt4
-rw-r--r--host/lib/usrp/common/CMakeLists.txt12
-rw-r--r--host/lib/usrp/cores/CMakeLists.txt4
-rw-r--r--host/lib/usrp/dboard/CMakeLists.txt24
-rw-r--r--host/lib/usrp/dboard/eiscat/CMakeLists.txt2
-rw-r--r--host/lib/usrp/dboard/magnesium/CMakeLists.txt2
-rw-r--r--host/lib/usrp/dboard/neon/CMakeLists.txt6
-rw-r--r--host/lib/usrp/dboard/rhodium/CMakeLists.txt6
-rw-r--r--host/lib/usrp/e300/CMakeLists.txt20
-rw-r--r--host/lib/usrp/mpmd/CMakeLists.txt16
-rw-r--r--host/lib/usrp/n230/CMakeLists.txt4
-rw-r--r--host/lib/usrp/usrp1/CMakeLists.txt4
-rw-r--r--host/lib/usrp/usrp2/CMakeLists.txt4
-rw-r--r--host/lib/usrp/x300/CMakeLists.txt4
-rw-r--r--host/lib/usrp_clock/CMakeLists.txt4
-rw-r--r--host/lib/usrp_clock/octoclock/CMakeLists.txt4
-rw-r--r--host/lib/utils/CMakeLists.txt154
-rw-r--r--host/python/CMakeLists.txt52
-rw-r--r--host/tests/CMakeLists.txt78
-rw-r--r--host/tests/common/CMakeLists.txt4
-rw-r--r--host/tests/devtest/CMakeLists.txt30
-rw-r--r--host/utils/CMakeLists.txt112
-rw-r--r--host/utils/latency/CMakeLists.txt30
72 files changed, 1731 insertions, 1731 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 1a4c2d0af..5c8b5054b 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -5,19 +5,19 @@
#
########################################################################
-#IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
-# MESSAGE(FATAL_ERROR "Prevented in-tree built. This is bad practice.")
-#ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+#if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+# message(FATAL_ERROR "Prevented in-tree built. This is bad practice.")
+#endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
########################################################################
# Project setup
########################################################################
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
-IF(POLICY CMP0048)
- CMAKE_POLICY(SET CMP0048 NEW) # Suppress Version warnings
-ENDIF(POLICY CMP0048)
-PROJECT(UHD CXX C)
-ENABLE_TESTING()
+cmake_minimum_required(VERSION 2.8.12)
+if(POLICY CMP0048)
+ cmake_policy(SET CMP0048 NEW) # Suppress Version warnings
+endif(POLICY CMP0048)
+project(UHD CXX C)
+enable_testing()
#make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
@@ -26,239 +26,239 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
# UHD Dependency Minimum Versions
########################################################################
# Full C++11 came with GCC 4.7, Clang >= 3.3.0, Apple Clang >= 500
-SET(GCC_MIN_VERSION "4.8.0")
-SET(CLANG_MIN_VERSION "3.3.0")
-SET(APPLECLANG_MIN_VERSION "500")
+set(GCC_MIN_VERSION "4.8.0")
+set(CLANG_MIN_VERSION "3.3.0")
+set(APPLECLANG_MIN_VERSION "500")
# Make sure to update the next two in unison:
-SET(MSVC_MIN_VERSION "1900")
-SET(MSVC_MIN_VERSION_READABLE "14.0")
+set(MSVC_MIN_VERSION "1900")
+set(MSVC_MIN_VERSION_READABLE "14.0")
# Other deps
-SET(BOOST_MIN_VERSION "1.53")
+set(BOOST_MIN_VERSION "1.53")
########################################################################
# Check Compiler Version
########################################################################
-IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
- IF(DEFINED CMAKE_CXX_COMPILER_VERSION)
- IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS ${GCC_MIN_VERSION})
- MESSAGE(WARNING "\nThe compiler selected to build UHD (GCC version ${CMAKE_CXX_COMPILER_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${GCC_MIN_VERSION} minimum). This build may or not work. We highly recommend using a more recent GCC version.")
- ENDIF()
- ELSE()
- MESSAGE(WARNING "\nCannot determine the version of the compiler selected to build UHD (GCC : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using GCC version ${GCC_MIN_VERSION} or more recent.")
- ENDIF()
- SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
-ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
- EXECUTE_PROCESS(COMMAND
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+ if(DEFINED CMAKE_CXX_COMPILER_VERSION)
+ if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS ${GCC_MIN_VERSION})
+ message(WARNING "\nThe compiler selected to build UHD (GCC version ${CMAKE_CXX_COMPILER_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${GCC_MIN_VERSION} minimum). This build may or not work. We highly recommend using a more recent GCC version.")
+ endif()
+ else()
+ message(WARNING "\nCannot determine the version of the compiler selected to build UHD (GCC : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using GCC version ${GCC_MIN_VERSION} or more recent.")
+ endif()
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og")
+elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ execute_process(COMMAND
${CMAKE_CXX_COMPILER} -v
RESULT_VARIABLE res ERROR_VARIABLE err
ERROR_STRIP_TRAILING_WHITESPACE)
- IF(${res} STREQUAL "0")
+ if(${res} STREQUAL "0")
# output is in error stream
- STRING(REGEX MATCH "^Apple.*" IS_APPLE ${err})
- IF("${IS_APPLE}" STREQUAL "")
- SET(MIN_VERSION ${CLANG_MIN_VERSION})
- SET(APPLE_STR "")
+ string(REGEX MATCH "^Apple.*" IS_APPLE ${err})
+ if("${IS_APPLE}" STREQUAL "")
+ set(MIN_VERSION ${CLANG_MIN_VERSION})
+ set(APPLE_STR "")
# retrieve the compiler's version from it
- STRING(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${err})
- STRING(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION})
- ELSE()
- SET(MIN_VERSION ${APPLECLANG_MIN_VERSION})
- SET(APPLE_STR "Apple ")
+ string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${err})
+ string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION})
+ else()
+ set(MIN_VERSION ${APPLECLANG_MIN_VERSION})
+ set(APPLE_STR "Apple ")
# retrieve the compiler's version from it
- STRING(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${err})
- STRING(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION})
- ENDIF()
- IF(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
- MESSAGE(WARNING "\nThe compiler selected to build UHD (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
- ENDIF()
- ELSE()
- MESSAGE(WARNING "\nCannot determine the version of the compiler selected to build UHD (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
- ENDIF()
-ELSEIF(MSVC)
- IF(${MSVC_VERSION} VERSION_LESS ${MSVC_MIN_VERSION})
- MESSAGE(FATAL_ERROR "\nMSVC version is less than the required minimum. Required: ${MSVC_MIN_VERSION_READABLE}")
- ENDIF(${MSVC_VERSION} VERSION_LESS ${MSVC_MIN_VERSION})
-ENDIF()
-
-IF(CMAKE_VERSION VERSION_LESS "3.1")
- IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
- SET(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
- ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
- IF("${IS_APPLE}" STREQUAL "")
- SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
- ELSE()
- SET(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
- ENDIF()
- ENDIF()
-ELSE()
- SET(CMAKE_CXX_STANDARD 11)
-ENDIF()
-
-IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
- SET(CMAKE_EXE_LINKER_FLAGS "-lthr ${CMAKE_EXE_LINKER_FLAGS}")
- SET(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
-ENDIF()
+ string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${err})
+ string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION})
+ endif()
+ if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
+ message(WARNING "\nThe compiler selected to build UHD (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
+ endif()
+ else()
+ message(WARNING "\nCannot determine the version of the compiler selected to build UHD (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
+ endif()
+elseif(MSVC)
+ if(${MSVC_VERSION} VERSION_LESS ${MSVC_MIN_VERSION})
+ message(FATAL_ERROR "\nMSVC version is less than the required minimum. Required: ${MSVC_MIN_VERSION_READABLE}")
+ endif(${MSVC_VERSION} VERSION_LESS ${MSVC_MIN_VERSION})
+endif()
+
+if(CMAKE_VERSION VERSION_LESS "3.1")
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+ set(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
+ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ if("${IS_APPLE}" STREQUAL "")
+ set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
+ else()
+ set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
+ endif()
+ endif()
+else()
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ set(CMAKE_EXE_LINKER_FLAGS "-lthr ${CMAKE_EXE_LINKER_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
+endif()
########################################################################
# 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
+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
########################################################################
# Install Dirs
########################################################################
#when the library suffix should be 64 (applies to redhat linux family)
-IF(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
- SET(LIB_SUFFIX 64)
-ENDIF()
-IF(CMAKE_INSTALL_LIBDIR MATCHES lib64)
- SET(LIB_SUFFIX 64)
-ENDIF()
-
-SET(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")
-SET(RUNTIME_DIR bin)
-SET(LIBRARY_DIR lib${LIB_SUFFIX})
-SET(INCLUDE_DIR include)
-SET(PKG_DATA_DIR share/uhd)
-IF(NOT DEFINED PKG_LIB_DIR)
- SET(PKG_LIB_DIR ${LIBRARY_DIR}/uhd)
-ENDIF()
-SET(PKG_DOC_DIR share/doc/uhd)
-SET(PKG_MAN_DIR share/man/man1)
+if(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
+ set(LIB_SUFFIX 64)
+endif()
+if(CMAKE_INSTALL_LIBDIR MATCHES lib64)
+ set(LIB_SUFFIX 64)
+endif()
+
+set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")
+set(RUNTIME_DIR bin)
+set(LIBRARY_DIR lib${LIB_SUFFIX})
+set(INCLUDE_DIR include)
+set(PKG_DATA_DIR share/uhd)
+if(NOT DEFINED PKG_LIB_DIR)
+ set(PKG_LIB_DIR ${LIBRARY_DIR}/uhd)
+endif()
+set(PKG_DOC_DIR share/doc/uhd)
+set(PKG_MAN_DIR share/man/man1)
########################################################################
# UHD config files
########################################################################
-SET(UHD_USER_CONF_FILE
+set(UHD_USER_CONF_FILE
".uhd/uhd.conf"
CACHE STRING
"Location of the user-specific UHD configuration file, relative to APPDATA (or HOME)"
)
-IF(UNIX)
- SET(UHD_SYS_CONF_FILE
+if(UNIX)
+ set(UHD_SYS_CONF_FILE
"/etc/uhd/uhd.conf"
CACHE STRING
"Location of the system-wide UHD configuration file"
)
-ELSEIF(WIN32)
- SET(UHD_SYS_CONF_FILE
+elseif(WIN32)
+ set(UHD_SYS_CONF_FILE
"%programdata%/uhd/uhd.conf"
CACHE STRING
"Location of the system-wide UHD configuration file"
)
-ELSE()
- MESSAGE(WARNING "Not setting UHD_SYS_CONF_FILE!")
-ENDIF()
+else()
+ message(WARNING "Not setting UHD_SYS_CONF_FILE!")
+endif()
########################################################################
# UHD Image Directories
########################################################################
-IF(NOT DEFINED UHD_IMAGES_DIR)
- IF(DEFINED FPGA_IMAGES_DIR)
- SET(UHD_IMAGES_DIR ${FPGA_IMAGES_DIR})
- ELSE(DEFINED FPGA_IMAGES_DIR)
- FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/share/uhd/images using_images_dir)
- SET(UHD_IMAGES_DIR ${using_images_dir})
- ENDIF(DEFINED FPGA_IMAGES_DIR)
-ENDIF(NOT DEFINED UHD_IMAGES_DIR)
+if(NOT DEFINED UHD_IMAGES_DIR)
+ if(DEFINED FPGA_IMAGES_DIR)
+ set(UHD_IMAGES_DIR ${FPGA_IMAGES_DIR})
+ else(DEFINED FPGA_IMAGES_DIR)
+ file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/share/uhd/images using_images_dir)
+ set(UHD_IMAGES_DIR ${using_images_dir})
+ endif(DEFINED FPGA_IMAGES_DIR)
+endif(NOT DEFINED UHD_IMAGES_DIR)
-OPTION(UHD_IMAGES_DIR "Path to installed UHD image binaries.")
-MESSAGE( STATUS "Using UHD Images Directory: ${UHD_IMAGES_DIR}" )
-ADD_DEFINITIONS(-DUHD_IMAGES_DIR=${UHD_IMAGES_DIR})
+option(UHD_IMAGES_DIR "Path to installed UHD image binaries.")
+message( STATUS "Using UHD Images Directory: ${UHD_IMAGES_DIR}" )
+add_definitions(-DUHD_IMAGES_DIR=${UHD_IMAGES_DIR})
-IF(DEFINED UHD_IMAGES_DIR_WINREG_KEY)
- ADD_DEFINITIONS(-DUHD_IMAGES_DIR_WINREG_KEY=${UHD_IMAGES_DIR_WINREG_KEY})
-ENDIF(DEFINED UHD_IMAGES_DIR_WINREG_KEY)
+if(DEFINED UHD_IMAGES_DIR_WINREG_KEY)
+ add_definitions(-DUHD_IMAGES_DIR_WINREG_KEY=${UHD_IMAGES_DIR_WINREG_KEY})
+endif(DEFINED UHD_IMAGES_DIR_WINREG_KEY)
########################################################################
# Local Include Dir
########################################################################
-INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/include)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+include_directories(${CMAKE_BINARY_DIR}/include)
+include_directories(${CMAKE_SOURCE_DIR}/include)
########################################################################
# Static Lib Configuration
########################################################################
-OPTION(ENABLE_STATIC_LIBS "Enable building of static libraries" OFF)
-IF(ENABLE_STATIC_LIBS)
- MESSAGE(STATUS "Building Static Libraries: ${ENABLE_STATIC_LIBS}")
-ENDIF(ENABLE_STATIC_LIBS)
+option(ENABLE_STATIC_LIBS "Enable building of static libraries" OFF)
+if(ENABLE_STATIC_LIBS)
+ message(STATUS "Building Static Libraries: ${ENABLE_STATIC_LIBS}")
+endif(ENABLE_STATIC_LIBS)
########################################################################
# On Apple only, set install name and use rpath correctly, if not already set
########################################################################
-IF(APPLE)
- IF(NOT CMAKE_INSTALL_NAME_DIR)
- SET(CMAKE_INSTALL_NAME_DIR
+if(APPLE)
+ if(NOT CMAKE_INSTALL_NAME_DIR)
+ set(CMAKE_INSTALL_NAME_DIR
${CMAKE_INSTALL_PREFIX}/${LIBRARY_DIR} CACHE
PATH "Library Install Name Destination Directory" FORCE)
- ENDIF(NOT CMAKE_INSTALL_NAME_DIR)
- IF(NOT CMAKE_INSTALL_RPATH)
- SET(CMAKE_INSTALL_RPATH
+ endif(NOT CMAKE_INSTALL_NAME_DIR)
+ if(NOT CMAKE_INSTALL_RPATH)
+ set(CMAKE_INSTALL_RPATH
${CMAKE_INSTALL_PREFIX}/${LIBRARY_DIR} CACHE
PATH "Library Install RPath" FORCE)
- ENDIF(NOT CMAKE_INSTALL_RPATH)
- IF(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
- SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE
+ endif(NOT CMAKE_INSTALL_RPATH)
+ if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE
BOOL "Do Build Using Library Install RPath" FORCE)
- ENDIF(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
-ENDIF(APPLE)
+ endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
+endif(APPLE)
########################################################################
# Optional Compiler Flags
########################################################################
-INCLUDE(CheckCXXCompilerFlag)
-MACRO(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG flag have)
+include(CheckCXXCompilerFlag)
+macro(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG flag have)
CHECK_CXX_COMPILER_FLAG(${flag} ${have})
- IF(${have})
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
- ENDIF(${have})
-ENDMACRO(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG)
+ if(${have})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+ endif(${have})
+endmacro(UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG)
#select the release build type by default to get optimization flags
-IF(NOT CMAKE_BUILD_TYPE)
- SET(CMAKE_BUILD_TYPE "Release")
- MESSAGE(STATUS "Build type not specified: defaulting to release.")
-ENDIF(NOT CMAKE_BUILD_TYPE)
-SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "")
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "Release")
+ message(STATUS "Build type not specified: defaulting to release.")
+endif(NOT CMAKE_BUILD_TYPE)
+set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "")
#force UHD_RELEASE_MODE to be a string for cmake-gui
-SET(UHD_RELEASE_MODE "${UHD_RELEASE_MODE}" CACHE STRING "UHD Release Mode")
+set(UHD_RELEASE_MODE "${UHD_RELEASE_MODE}" CACHE STRING "UHD Release Mode")
-IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR
${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
- IF(STRIP_BINARIES)
- IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
- ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
- ENDIF(STRIP_BINARIES)
- ADD_DEFINITIONS(-Wall)
- ADD_DEFINITIONS(-Wextra)
- ADD_DEFINITIONS(-Wsign-compare)
- #ADD_DEFINITIONS(-Wconversion)
- #ADD_DEFINITIONS(-pedantic)
- #ADD_DEFINITIONS(-ansi)
- IF(NOT WIN32)
+ if(STRIP_BINARIES)
+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s")
+ endif(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ endif(STRIP_BINARIES)
+ add_definitions(-Wall)
+ add_definitions(-Wextra)
+ add_definitions(-Wsign-compare)
+ #add_definitions(-Wconversion)
+ #add_definitions(-pedantic)
+ #add_definitions(-ansi)
+ if(NOT WIN32)
#only export symbols that are declared to be part of the uhd api (non dll platforms)
UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
UHD_ADD_OPTIONAL_CXX_COMPILER_FLAG(-fvisibility-inlines-hidden HAVE_VISIBILITY_INLINES_HIDDEN)
- ENDIF(NOT WIN32)
- IF(${CMAKE_BUILD_TYPE} STREQUAL "Coverage")
+ endif(NOT WIN32)
+ if(${CMAKE_BUILD_TYPE} STREQUAL "Coverage")
include(CodeCoverage)
setup_target_for_coverage(coverage "ctest || return 0" coverage) # never fail ctest, always generate coverage report
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C++ compiler during Coverage builds." FORCE)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C compiler during Coverage builds." FORCE)
- ENDIF()
-ENDIF()
-
-IF(MSVC)
- INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/cmake/msvc)
- ADD_DEFINITIONS( #stop all kinds of compatibility warnings
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C++ compiler during Coverage builds." FORCE)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING "Flags used by the C compiler during Coverage builds." FORCE)
+ endif()
+endif()
+
+if(MSVC)
+ include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc)
+ add_definitions( #stop all kinds of compatibility warnings
-DWIN32_LEAN_AND_MEAN
-DVC_EXTRALEAN
-D_SCL_SECURE_NO_WARNINGS
@@ -270,35 +270,35 @@ IF(MSVC)
-D_WINSOCK_DEPRECATED_NO_WARNINGS
)
# multi-threaded build and increases the number of addressable sections in an .obj file.
- SET (COMPILE_FLAGS ${COMPILE_FLAGS} /MP /bigobj)
-ENDIF(MSVC)
+ set (COMPILE_FLAGS ${COMPILE_FLAGS} /MP /bigobj)
+endif(MSVC)
-IF(CYGWIN)
- ADD_DEFINITIONS(-D__USE_W32_SOCKETS) #boost asio says we need this
-ENDIF(CYGWIN)
+if(CYGWIN)
+ add_definitions(-D__USE_W32_SOCKETS) #boost asio says we need this
+endif(CYGWIN)
-IF(WIN32)
- ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp
- ADD_DEFINITIONS(-DNOMINMAX) #disables stupidity and enables std::min and std::max
-ENDIF(WIN32)
+if(WIN32)
+ add_definitions(-D_WIN32_WINNT=0x0501) #minimum version required is windows xp
+ add_definitions(-DNOMINMAX) #disables stupidity and enables std::min and std::max
+endif(WIN32)
########################################################################
# Choose a version of Python
########################################################################
-OPTION(ENABLE_PYTHON3 "Enable Python 3. Default is Python 2" OFF)
-SET(BOOST_PYTHON_COMPONENT python)
-SET(BOOST_PYTHON_VERSION 2.7)
-IF(${ENABLE_PYTHON3})
- SET(BOOST_PYTHON_COMPONENT python3)
- SET(BOOST_PYTHON_VERSION 3)
-ENDIF()
+option(ENABLE_PYTHON3 "Enable Python 3. Default is Python 2" OFF)
+set(BOOST_PYTHON_COMPONENT python)
+set(BOOST_PYTHON_VERSION 2.7)
+if(${ENABLE_PYTHON3})
+ set(BOOST_PYTHON_COMPONENT python3)
+ set(BOOST_PYTHON_VERSION 3)
+endif()
########################################################################
# Setup Boost
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring Boost C++ Libraries...")
-SET(BOOST_REQUIRED_COMPONENTS
+message(STATUS "")
+message(STATUS "Configuring Boost C++ Libraries...")
+set(BOOST_REQUIRED_COMPONENTS
chrono
date_time
filesystem
@@ -309,73 +309,73 @@ SET(BOOST_REQUIRED_COMPONENTS
serialization
)
-SET(BOOST_OPTIONAL_COMPONENTS ${BOOST_PYTHON_COMPONENT})
-IF(MINGW)
- LIST(APPEND BOOST_REQUIRED_COMPONENTS thread_win32)
-ELSE()
- LIST(APPEND BOOST_REQUIRED_COMPONENTS thread)
-ENDIF()
-
-IF(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
- LIST(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
-ENDIF(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
-
-IF(MSVC)
- SET(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
- IF(BOOST_ALL_DYN_LINK)
- ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
- ELSE(BOOST_ALL_DYN_LINK)
- SET(BOOST_REQUIRED_COMPONENTS) #empty components list for static link
- ENDIF(BOOST_ALL_DYN_LINK)
-ENDIF(MSVC)
-
-SET(Boost_ADDITIONAL_VERSIONS
+set(BOOST_OPTIONAL_COMPONENTS ${BOOST_PYTHON_COMPONENT})
+if(MINGW)
+ list(APPEND BOOST_REQUIRED_COMPONENTS thread_win32)
+else()
+ list(APPEND BOOST_REQUIRED_COMPONENTS thread)
+endif()
+
+if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
+ list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
+endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
+
+if(MSVC)
+ set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
+ if(BOOST_ALL_DYN_LINK)
+ add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
+ else(BOOST_ALL_DYN_LINK)
+ set(BOOST_REQUIRED_COMPONENTS) #empty components list for static link
+ endif(BOOST_ALL_DYN_LINK)
+endif(MSVC)
+
+set(Boost_ADDITIONAL_VERSIONS
"1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.48.0" "1.49" "1.50.0" "1.50"
"1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54" "1.55.0" "1.55"
"1.56.0" "1.56" "1.57" "1.57" "1.58" "1.59" "1.60" "1.61" "1.62" "1.63"
)
#Python API requirements
-MESSAGE(STATUS "Looking for optional Boost components...")
-FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS})
+message(STATUS "Looking for optional Boost components...")
+find_package(Boost ${BOOST_MIN_VERSION} OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS})
-MESSAGE(STATUS "Looking for required Boost components...")
-FIND_PACKAGE(Boost ${BOOST_MIN_VERSION} COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
+message(STATUS "Looking for required Boost components...")
+find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
-INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
-LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
#Check to see if the Python version we're looking for exists
-SET(BOOST_PYTHON_FOUND ${Boost_PYTHON_FOUND})
-SET(BOOST_PYTHON_LIBRARY ${Boost_PYTHON_LIBRARY})
-IF(${ENABLE_PYTHON3})
- SET(BOOST_PYTHON_FOUND ${Boost_PYTHON3_FOUND})
- SET(BOOST_PYTHON_LIBRARY ${Boost_PYTHON3_LIBRARY})
-ENDIF()
+set(BOOST_PYTHON_FOUND ${Boost_PYTHON_FOUND})
+set(BOOST_PYTHON_LIBRARY ${Boost_PYTHON_LIBRARY})
+if(${ENABLE_PYTHON3})
+ set(BOOST_PYTHON_FOUND ${Boost_PYTHON3_FOUND})
+ set(BOOST_PYTHON_LIBRARY ${Boost_PYTHON3_LIBRARY})
+endif()
-MESSAGE(STATUS "Boost include directories: ${Boost_INCLUDE_DIRS}")
-MESSAGE(STATUS "Boost library directories: ${Boost_LIBRARY_DIRS}")
-MESSAGE(STATUS "Boost libraries: ${Boost_LIBRARIES}")
+message(STATUS "Boost include directories: ${Boost_INCLUDE_DIRS}")
+message(STATUS "Boost library directories: ${Boost_LIBRARY_DIRS}")
+message(STATUS "Boost libraries: ${Boost_LIBRARIES}")
########################################################################
# Additional settings for build environment
########################################################################
# Note: RFNoC never gets fully disabled, but the public APIs do
-SET(ENABLE_RFNOC OFF CACHE BOOL "Export RFNoC includes and symbols")
-INCLUDE(UHDGlobalDefs)
-INCLUDE(UHDLog)
+set(ENABLE_RFNOC OFF CACHE BOOL "Export RFNoC includes and symbols")
+include(UHDGlobalDefs)
+include(UHDLog)
########################################################################
# Check Python Modules
########################################################################
-FIND_PACKAGE(PythonInterp ${BOOST_PYTHON_VERSION})
-FIND_PACKAGE(PythonLibs ${BOOST_PYTHON_VERSION})
-INCLUDE(UHDPython)
+find_package(PythonInterp ${BOOST_PYTHON_VERSION})
+find_package(PythonLibs ${BOOST_PYTHON_VERSION})
+include(UHDPython)
-SET(PYTHON_VERSION "platform.python_version() >= '2.7' and platform.python_version() < '3.0'")
-IF(${ENABLE_PYTHON3})
- SET(PYTHON_VERSION "platform.python_version() >= '3.0'")
-ENDIF()
+set(PYTHON_VERSION "platform.python_version() >= '2.7' and platform.python_version() < '3.0'")
+if(${ENABLE_PYTHON3})
+ set(PYTHON_VERSION "platform.python_version() >= '3.0'")
+endif()
PYTHON_CHECK_MODULE(
"Python version ${BOOST_PYTHON_VERSION} or greater"
@@ -401,17 +401,17 @@ PYTHON_CHECK_MODULE(
HAVE_PYTHON_MODULE_NUMPY
)
-SET(PYTHON_ADDITIONAL_VERSIONS 2.7 3.4 3.5)
+set(PYTHON_ADDITIONAL_VERSIONS 2.7 3.4 3.5)
########################################################################
# Create Uninstall Target
########################################################################
-CONFIGURE_FILE(
+configure_file(
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY)
-ADD_CUSTOM_TARGET(uninstall
+add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
@@ -430,11 +430,11 @@ UHD_INSTALL(FILES
########################################################################
LIBUHD_REGISTER_COMPONENT("LibUHD" ENABLE_LIBUHD ON "Boost_FOUND;HAVE_PYTHON_PLAT_MIN_VERSION;HAVE_PYTHON_MODULE_MAKO" OFF ON)
LIBUHD_REGISTER_COMPONENT("LibUHD - C API" ENABLE_C_API ON "ENABLE_LIBUHD" OFF OFF)
-IF(WIN32)
+if(WIN32)
LIBUHD_REGISTER_COMPONENT("LibUHD - Python API" ENABLE_PYTHON_API OFF "ENABLE_LIBUHD;BOOST_PYTHON_FOUND;HAVE_PYTHON_MODULE_NUMPY;PythonLibs_FOUND" OFF OFF)
-ELSE()
+else()
LIBUHD_REGISTER_COMPONENT("LibUHD - Python API" ENABLE_PYTHON_API ON "ENABLE_LIBUHD;BOOST_PYTHON_FOUND;HAVE_PYTHON_MODULE_NUMPY;PythonLibs_FOUND" OFF OFF)
-ENDIF(WIN32)
+endif(WIN32)
LIBUHD_REGISTER_COMPONENT("Examples" ENABLE_EXAMPLES ON "ENABLE_LIBUHD" OFF OFF)
LIBUHD_REGISTER_COMPONENT("Utils" ENABLE_UTILS ON "ENABLE_LIBUHD" OFF OFF)
LIBUHD_REGISTER_COMPONENT("Tests" ENABLE_TESTS ON "ENABLE_LIBUHD" OFF OFF)
@@ -443,68 +443,68 @@ LIBUHD_REGISTER_COMPONENT("Tests" ENABLE_TESTS ON "ENABLE_LIBUHD" OFF OFF)
########################################################################
# Check for fpga-src submodule
########################################################################
-SET(HAS_FPGA_SUBMODULE FALSE)
-EXECUTE_PROCESS(
+set(HAS_FPGA_SUBMODULE FALSE)
+execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import os; print(os.path.abspath(os.path.join('${CMAKE_SOURCE_DIR}', '..', 'fpga-src')))"
OUTPUT_VARIABLE FPGA_SUBMODULE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
-IF(EXISTS "${FPGA_SUBMODULE_DIR}/docs/fpga.md")
- SET(HAS_FPGA_SUBMODULE TRUE)
- MESSAGE(STATUS "")
- MESSAGE(STATUS "Found FPGA submodule: ${FPGA_SUBMODULE_DIR}")
-ENDIF(EXISTS "${FPGA_SUBMODULE_DIR}/docs/fpga.md")
+if(EXISTS "${FPGA_SUBMODULE_DIR}/docs/fpga.md")
+ set(HAS_FPGA_SUBMODULE TRUE)
+ message(STATUS "")
+ message(STATUS "Found FPGA submodule: ${FPGA_SUBMODULE_DIR}")
+endif(EXISTS "${FPGA_SUBMODULE_DIR}/docs/fpga.md")
########################################################################
# Add the subdirectories
########################################################################
-IF(ENABLE_LIBUHD)
- ADD_SUBDIRECTORY(lib)
-ENDIF(ENABLE_LIBUHD)
+if(ENABLE_LIBUHD)
+ add_subdirectory(lib)
+endif(ENABLE_LIBUHD)
-ADD_SUBDIRECTORY(include)
+add_subdirectory(include)
-IF(ENABLE_EXAMPLES)
- ADD_SUBDIRECTORY(examples)
-ENDIF(ENABLE_EXAMPLES)
+if(ENABLE_EXAMPLES)
+ add_subdirectory(examples)
+endif(ENABLE_EXAMPLES)
-IF(ENABLE_TESTS)
- ADD_SUBDIRECTORY(tests)
-ENDIF(ENABLE_TESTS)
+if(ENABLE_TESTS)
+ add_subdirectory(tests)
+endif(ENABLE_TESTS)
-IF(ENABLE_UTILS)
- ADD_SUBDIRECTORY(utils)
-ENDIF(ENABLE_UTILS)
+if(ENABLE_UTILS)
+ add_subdirectory(utils)
+endif(ENABLE_UTILS)
-ADD_SUBDIRECTORY(docs)
+add_subdirectory(docs)
-IF(ENABLE_PYTHON_API)
- ADD_SUBDIRECTORY(python)
-ENDIF()
+if(ENABLE_PYTHON_API)
+ add_subdirectory(python)
+endif()
########################################################################
# Create Pkg Config File
########################################################################
-FOREACH(inc ${Boost_INCLUDE_DIRS})
- LIST(APPEND UHD_PC_CFLAGS "-I${inc}")
-ENDFOREACH(inc)
+foreach(inc ${Boost_INCLUDE_DIRS})
+ list(APPEND UHD_PC_CFLAGS "-I${inc}")
+endforeach(inc)
-FOREACH(lib ${Boost_LIBRARY_DIRS})
- LIST(APPEND UHD_PC_LIBS "-L${lib}")
-ENDFOREACH(lib)
+foreach(lib ${Boost_LIBRARY_DIRS})
+ list(APPEND UHD_PC_LIBS "-L${lib}")
+endforeach(lib)
#use space-separation format for the pc file
-STRING(REPLACE ";" " " UHD_PC_REQUIRES "${UHD_PC_REQUIRES}")
-STRING(REPLACE ";" " " UHD_PC_CFLAGS "${UHD_PC_CFLAGS}")
-STRING(REPLACE ";" " " UHD_PC_LIBS "${UHD_PC_LIBS}")
+string(REPLACE ";" " " UHD_PC_REQUIRES "${UHD_PC_REQUIRES}")
+string(REPLACE ";" " " UHD_PC_CFLAGS "${UHD_PC_CFLAGS}")
+string(REPLACE ";" " " UHD_PC_LIBS "${UHD_PC_LIBS}")
#unset these vars to avoid hard-coded paths to cross environment
-IF(CMAKE_CROSSCOMPILING)
- SET(UHD_PC_CFLAGS)
- SET(UHD_PC_LIBS)
-ENDIF(CMAKE_CROSSCOMPILING)
+if(CMAKE_CROSSCOMPILING)
+ set(UHD_PC_CFLAGS)
+ set(UHD_PC_LIBS)
+endif(CMAKE_CROSSCOMPILING)
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/uhd.pc.in
${CMAKE_CURRENT_BINARY_DIR}/uhd.pc
@ONLY)
@@ -518,40 +518,40 @@ UHD_INSTALL(
########################################################################
# Create and Install UHD cmake files
########################################################################
-IF(NOT CMAKE_MODULES_DIR)
- SET(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
-ENDIF(NOT CMAKE_MODULES_DIR)
+if(NOT CMAKE_MODULES_DIR)
+ set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
+endif(NOT CMAKE_MODULES_DIR)
# UHDConfig.cmake needs UHD_LINK_LIST_STATIC set:
-LIST(APPEND UHD_LINK_LIST_STATIC "dl")
-LIST(APPEND UHD_LINK_LIST_STATIC "pthread")
-FOREACH(Boost_Comp ${BOOST_REQUIRED_COMPONENTS})
- IF(NOT ${Boost_Comp} STREQUAL "unit_test_framework")
- LIST(APPEND UHD_LINK_LIST_STATIC "boost_${Boost_Comp}")
- ENDIF(NOT ${Boost_Comp} STREQUAL "unit_test_framework")
-ENDFOREACH(Boost_Comp)
-IF(ENABLE_USB)
- LIST(APPEND UHD_LINK_LIST_STATIC "usb-1.0")
-ENDIF(ENABLE_USB)
+list(APPEND UHD_LINK_LIST_STATIC "dl")
+list(APPEND UHD_LINK_LIST_STATIC "pthread")
+foreach(Boost_Comp ${BOOST_REQUIRED_COMPONENTS})
+ if(NOT ${Boost_Comp} STREQUAL "unit_test_framework")
+ list(APPEND UHD_LINK_LIST_STATIC "boost_${Boost_Comp}")
+ endif(NOT ${Boost_Comp} STREQUAL "unit_test_framework")
+endforeach(Boost_Comp)
+if(ENABLE_USB)
+ list(APPEND UHD_LINK_LIST_STATIC "usb-1.0")
+endif(ENABLE_USB)
# UHDConfig.cmake also needs UHD_RFNOC_FOUND
-IF(ENABLE_RFNOC)
- SET(UHD_RFNOC_FOUND "TRUE")
-ELSE()
- SET(UHD_RFNOC_FOUND "FALSE")
-ENDIF(ENABLE_RFNOC)
+if(ENABLE_RFNOC)
+ set(UHD_RFNOC_FOUND "TRUE")
+else()
+ set(UHD_RFNOC_FOUND "FALSE")
+endif(ENABLE_RFNOC)
-CONFIGURE_FILE(
+configure_file(
${CMAKE_SOURCE_DIR}/cmake/Modules/UHDConfigVersion.cmake.in
${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfigVersion.cmake
@ONLY
)
-CONFIGURE_FILE(
+configure_file(
${CMAKE_SOURCE_DIR}/cmake/Modules/UHDConfig.cmake.in
${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfig.cmake
@ONLY
)
-SET(cmake_configs
+set(cmake_configs
${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfig.cmake
${CMAKE_BINARY_DIR}/cmake/Modules/UHDConfigVersion.cmake
)
@@ -565,43 +565,43 @@ UHD_INSTALL(
########################################################################
# Handle pre-built UHD Images for packaging
########################################################################
-IF(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_DIR}")
- MESSAGE(STATUS "Reading images from directory `${UHD_IMAGES_SRC_DIR}'")
- FILE(GLOB_RECURSE _image_files "${UHD_IMAGES_SRC_DIR}/*")
- MESSAGE(STATUS "These images files will be installed/packaged:")
- FOREACH(_img ${_image_files})
- MESSAGE(STATUS " ${_img}")
- ENDFOREACH(_img)
+if(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_DIR}")
+ message(STATUS "Reading images from directory `${UHD_IMAGES_SRC_DIR}'")
+ file(GLOB_RECURSE _image_files "${UHD_IMAGES_SRC_DIR}/*")
+ message(STATUS "These images files will be installed/packaged:")
+ foreach(_img ${_image_files})
+ message(STATUS " ${_img}")
+ endforeach(_img)
UHD_INSTALL(FILES ${_image_files} DESTINATION ${PKG_DATA_DIR}/images COMPONENT images)
-ENDIF(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_DIR}")
+endif(DEFINED UHD_IMAGES_SRC_DIR AND EXISTS "${UHD_IMAGES_SRC_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)
+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()
-IF(UHD_VERSION_DEVEL AND NOT UHD_GIT_BRANCH MATCHES "^UHD-")
- MESSAGE(STATUS "******************************************************")
- IF(UHD_GIT_BRANCH STREQUAL "master")
- MESSAGE(STATUS "* You are building the UHD development master branch.")
- MESSAGE(STATUS "* For production code, we recommend our stable,")
- MESSAGE(STATUS "* releases or using the release branch (maint).")
- ELSE()
- MESSAGE(STATUS "* You are building a development branch of UHD.")
- MESSAGE(STATUS "* These branches are designed to provide early access")
- MESSAGE(STATUS "* to UHD and USRP features, but should be considered")
- MESSAGE(STATUS "* unstable and/or experimental!")
- ENDIF(UHD_GIT_BRANCH STREQUAL "master")
- MESSAGE(STATUS "******************************************************")
-ENDIF(UHD_VERSION_DEVEL AND NOT UHD_GIT_BRANCH MATCHES "^UHD-")
-MESSAGE(STATUS "Building version: ${UHD_VERSION}${PRINT_APPEND}")
-MESSAGE(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
+if(UHD_VERSION_DEVEL AND NOT UHD_GIT_BRANCH MATCHES "^UHD-")
+ message(STATUS "******************************************************")
+ if(UHD_GIT_BRANCH STREQUAL "master")
+ message(STATUS "* You are building the UHD development master branch.")
+ message(STATUS "* For production code, we recommend our stable,")
+ message(STATUS "* releases or using the release branch (maint).")
+ else()
+ message(STATUS "* You are building a development branch of UHD.")
+ message(STATUS "* These branches are designed to provide early access")
+ message(STATUS "* to UHD and USRP features, but should be considered")
+ message(STATUS "* unstable and/or experimental!")
+ endif(UHD_GIT_BRANCH STREQUAL "master")
+ message(STATUS "******************************************************")
+endif(UHD_VERSION_DEVEL AND NOT UHD_GIT_BRANCH MATCHES "^UHD-")
+message(STATUS "Building version: ${UHD_VERSION}${PRINT_APPEND}")
+message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
diff --git a/host/cmake/Modules/CMakeParseArgumentsCopy.cmake b/host/cmake/Modules/CMakeParseArgumentsCopy.cmake
index 7ce4c49ae..a7e78bbdc 100644
--- a/host/cmake/Modules/CMakeParseArgumentsCopy.cmake
+++ b/host/cmake/Modules/CMakeParseArgumentsCopy.cmake
@@ -1,6 +1,6 @@
-# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
+# cmake_parse_arguments(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
#
-# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
+# cmake_parse_arguments() is intended to be used in macros or functions for
# parsing the arguments given to that macro or function.
# It processes the arguments and defines a set of variables which hold the
# values of the respective options.
@@ -17,7 +17,7 @@
# which can be followed by more than one value, like e.g. the TARGETS or
# FILES keywords of the install() command.
#
-# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
+# When done, cmake_parse_arguments() will have defined for each of the
# keywords listed in <options>, <one_value_keywords> and
# <multi_value_keywords> a variable composed of the given <prefix>
# followed by "_" and the name of the respective keyword.
diff --git a/host/cmake/Modules/CodeCoverage.cmake b/host/cmake/Modules/CodeCoverage.cmake
index a0b0ef526..e19c6399d 100644
--- a/host/cmake/Modules/CodeCoverage.cmake
+++ b/host/cmake/Modules/CodeCoverage.cmake
@@ -43,11 +43,11 @@
# 1. Copy this file into your cmake modules path.
#
# 2. Add the following line to your CMakeLists.txt:
-# INCLUDE(CodeCoverage)
+# include(CodeCoverage)
#
# 3. Set compiler flags to turn off optimization and enable coverage:
-# SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
-# SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+# set(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+# set(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
#
# 3. Use the function SETUP_TARGET_FOR_COVERAGE to create a custom make target
# which runs your test executable and produces a lcov code coverage report:
@@ -68,48 +68,48 @@
#
# Check prereqs
-FIND_PROGRAM( GCOV_PATH gcov )
-FIND_PROGRAM( LCOV_PATH lcov )
-FIND_PROGRAM( GENHTML_PATH genhtml )
-FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
-
-IF(NOT GCOV_PATH)
- MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
-ENDIF() # NOT GCOV_PATH
-
-IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
- IF("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3)
- MESSAGE(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
- ENDIF()
-ELSEIF(NOT CMAKE_COMPILER_IS_GNUCXX)
- MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
-ENDIF() # CHECK VALID COMPILER
-
-SET(CMAKE_CXX_FLAGS_COVERAGE
+find_program( GCOV_PATH gcov )
+find_program( LCOV_PATH lcov )
+find_program( GENHTML_PATH genhtml )
+find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+
+if(NOT GCOV_PATH)
+ message(FATAL_ERROR "gcov not found! Aborting...")
+endif() # NOT GCOV_PATH
+
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
+ if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3)
+ message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
+ endif()
+elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
+ message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+endif() # CHECK VALID COMPILER
+
+set(CMAKE_CXX_FLAGS_COVERAGE
"-g -O0 --coverage -fprofile-arcs -ftest-coverage"
CACHE STRING "Flags used by the C++ compiler during coverage builds."
FORCE )
-SET(CMAKE_C_FLAGS_COVERAGE
+set(CMAKE_C_FLAGS_COVERAGE
"-g -O0 --coverage -fprofile-arcs -ftest-coverage"
CACHE STRING "Flags used by the C compiler during coverage builds."
FORCE )
-SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used for linking binaries during coverage builds."
FORCE )
-SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
""
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
FORCE )
-MARK_AS_ADVANCED(
+mark_as_advanced(
CMAKE_CXX_FLAGS_COVERAGE
CMAKE_C_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
-IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage"))
- MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
-ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
+if ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage"))
+ message( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
+endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
# Param _targetname The name of new the custom make target
@@ -120,23 +120,23 @@ ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
# HTML report is generated in _outputname/index.html
# Optional fourth parameter is passed as arguments to _testrunner
# Pass them in list form, e.g.: "-j;2" for -j 2
-FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
+function(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
- IF(NOT LCOV_PATH)
- MESSAGE(FATAL_ERROR "lcov not found! Aborting...")
- ENDIF() # NOT LCOV_PATH
+ if(NOT LCOV_PATH)
+ message(FATAL_ERROR "lcov not found! Aborting...")
+ endif() # NOT LCOV_PATH
- IF(NOT GENHTML_PATH)
- MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
- ENDIF() # NOT GENHTML_PATH
+ if(NOT GENHTML_PATH)
+ message(FATAL_ERROR "genhtml not found! Aborting...")
+ endif() # NOT GENHTML_PATH
- SET(coverage_info "${CMAKE_BINARY_DIR}/${_outputname}.info")
- SET(coverage_cleaned "${coverage_info}.cleaned")
+ set(coverage_info "${CMAKE_BINARY_DIR}/${_outputname}.info")
+ set(coverage_cleaned "${coverage_info}.cleaned")
- SEPARATE_ARGUMENTS(test_command UNIX_COMMAND "${_testrunner}")
+ separate_arguments(test_command UNIX_COMMAND "${_testrunner}")
# Setup target
- ADD_CUSTOM_TARGET(${_targetname}
+ add_custom_target(${_targetname}
# Cleanup lcov
${LCOV_PATH} --directory . --zerocounters
@@ -155,29 +155,29 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
)
# Show info where to find the report
- ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
+ add_custom_command(TARGET ${_targetname} POST_BUILD
COMMAND ;
COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report."
)
-ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE
+endfunction() # SETUP_TARGET_FOR_COVERAGE
# Param _targetname The name of new the custom make target
# Param _testrunner The name of the target which runs the tests
# Param _outputname cobertura output is generated as _outputname.xml
# Optional fourth parameter is passed as arguments to _testrunner
# Pass them in list form, e.g.: "-j;2" for -j 2
-FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname)
+function(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname)
- IF(NOT PYTHON_EXECUTABLE)
- MESSAGE(FATAL_ERROR "Python not found! Aborting...")
- ENDIF() # NOT PYTHON_EXECUTABLE
+ if(NOT PYTHON_EXECUTABLE)
+ message(FATAL_ERROR "Python not found! Aborting...")
+ endif() # NOT PYTHON_EXECUTABLE
- IF(NOT GCOVR_PATH)
- MESSAGE(FATAL_ERROR "gcovr not found! Aborting...")
- ENDIF() # NOT GCOVR_PATH
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
- ADD_CUSTOM_TARGET(${_targetname}
+ add_custom_target(${_targetname}
# Run tests
${_testrunner} ${ARGV3}
@@ -189,9 +189,9 @@ FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname
)
# Show info where to find the report
- ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
+ add_custom_command(TARGET ${_targetname} POST_BUILD
COMMAND ;
COMMENT "Cobertura code coverage report saved in ${_outputname}.xml."
)
-ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE_COBERTURA
+endfunction() # SETUP_TARGET_FOR_COVERAGE_COBERTURA
diff --git a/host/cmake/Modules/FindDocutils.cmake b/host/cmake/Modules/FindDocutils.cmake
index 7b103879e..2f7f3fa6a 100644
--- a/host/cmake/Modules/FindDocutils.cmake
+++ b/host/cmake/Modules/FindDocutils.cmake
@@ -6,6 +6,6 @@
#
########################################################################
-FIND_PROGRAM(RST2HTML_EXECUTABLE NAMES rst2html rst2html.py)
-INCLUDE(FindPackageHandleStandardArgs)
+find_program(RST2HTML_EXECUTABLE NAMES rst2html rst2html.py)
+include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Docutils DEFAULT_MSG RST2HTML_EXECUTABLE)
diff --git a/host/cmake/Modules/FindGPSD.cmake b/host/cmake/Modules/FindGPSD.cmake
index 3e29c7498..92216438f 100644
--- a/host/cmake/Modules/FindGPSD.cmake
+++ b/host/cmake/Modules/FindGPSD.cmake
@@ -12,40 +12,40 @@
# also defined, but not for general use are
# LIBGPS_LIBRARY, where to find the GPSD library.
-INCLUDE(FindPkgConfig)
+include(FindPkgConfig)
PKG_CHECK_MODULES(PC_GPSD "libgps")
PKG_CHECK_MODULES(PC_GPSD_V3_11 "libgps >= 3.11")
-IF(PC_GPSD_FOUND AND NOT PC_GPSD_V3_11_FOUND)
- MESSAGE(WARNING "GPSD version found is too old")
-ENDIF(PC_GPSD_FOUND AND NOT PC_GPSD_V3_11_FOUND)
+if(PC_GPSD_FOUND AND NOT PC_GPSD_V3_11_FOUND)
+ message(WARNING "GPSD version found is too old")
+endif(PC_GPSD_FOUND AND NOT PC_GPSD_V3_11_FOUND)
-IF(PC_GPSD_V3_11_FOUND)
- FIND_PATH(
+if(PC_GPSD_V3_11_FOUND)
+ find_path(
LIBGPS_INCLUDE_DIR
NAMES gps.h
HINTS ${PC_GPSD_INCLUDE_DIR}
)
- SET(
+ set(
LIBGPS_NAMES
${LIBGPS_NAMES} gps
)
- FIND_LIBRARY(
+ find_library(
LIBGPS_LIBRARY
NAMES ${LIBGPS_NAMES}
HINTS ${PC_GPSD_LIBDIR}
)
-ENDIF(PC_GPSD_V3_11_FOUND)
+endif(PC_GPSD_V3_11_FOUND)
# handle the QUIETLY and REQUIRED arguments and set LIBGPS_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
+include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGPS DEFAULT_MSG LIBGPS_LIBRARY LIBGPS_INCLUDE_DIR)
-IF(LIBGPS_FOUND)
- SET(LIBGPS_LIBRARIES ${LIBGPS_LIBRARY})
-ENDIF(LIBGPS_FOUND)
+if(LIBGPS_FOUND)
+ set(LIBGPS_LIBRARIES ${LIBGPS_LIBRARY})
+endif(LIBGPS_FOUND)
-MARK_AS_ADVANCED(LIBGPS_LIBRARY LIBGPS_INCLUDE_DIR)
+mark_as_advanced(LIBGPS_LIBRARY LIBGPS_INCLUDE_DIR)
diff --git a/host/cmake/Modules/FindGZip.cmake b/host/cmake/Modules/FindGZip.cmake
index 029e95a22..2964529b2 100644
--- a/host/cmake/Modules/FindGZip.cmake
+++ b/host/cmake/Modules/FindGZip.cmake
@@ -6,6 +6,6 @@
#
########################################################################
-FIND_PROGRAM(GZIP_EXECUTABLE NAMES gzip)
-INCLUDE(FindPackageHandleStandardArgs)
+find_program(GZIP_EXECUTABLE NAMES gzip)
+include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GZip DEFAULT_MSG GZIP_EXECUTABLE)
diff --git a/host/cmake/Modules/FindLIBERIO.cmake b/host/cmake/Modules/FindLIBERIO.cmake
index 9a29e52e8..77fd49735 100644
--- a/host/cmake/Modules/FindLIBERIO.cmake
+++ b/host/cmake/Modules/FindLIBERIO.cmake
@@ -13,22 +13,22 @@
# also defined, but not for general use are
# LIBERIO_LIBRARY, where to find the liberio library.
-FIND_PACKAGE(PkgConfig)
+find_package(PkgConfig)
PKG_CHECK_MODULES(PC_LIBERIO QUIET liberio >= 0.3)
-FIND_PATH(LIBERIO_INCLUDE_DIR liberio/liberio.h
+find_path(LIBERIO_INCLUDE_DIR liberio/liberio.h
HINTS $ENV{LIBERIO_DIR}/include ${PC_LIBERIO_INCLUDE_DIR}
PATH_SUFFIXES liberio
)
-FIND_LIBRARY(LIBERIO_LIBRARY
+find_library(LIBERIO_LIBRARY
NAMES erio liberio
HINTS $ENV{LIBERIO_DIR}/lib ${PC_LIBERIO_LIBDIR} ${PC_LIBERIO_LIBRARY_DIRS}
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBERIO DEFAULT_MSG LIBERIO_LIBRARY LIBERIO_INCLUDE_DIR)
-MARK_AS_ADVANCED(LIBERIO_INCLUDE_DIR LIBERIO_LIBRARY)
+mark_as_advanced(LIBERIO_INCLUDE_DIR LIBERIO_LIBRARY)
set(LIBERIO_LIBRARIES ${LIBERIO_LIBRARY})
set(LIBERIO_INCLUDE_DIRS ${LIBERIO_INCLUDE_DIR})
diff --git a/host/cmake/Modules/FindUSB1.cmake b/host/cmake/Modules/FindUSB1.cmake
index 7c4a8fb6b..3763d715b 100644
--- a/host/cmake/Modules/FindUSB1.cmake
+++ b/host/cmake/Modules/FindUSB1.cmake
@@ -3,10 +3,10 @@
#sets LIBUSB_FOUND, LIBUSB_LIBRARIES, LIBUSB_INCLUDE_DIRS
#override LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS to manually set
-INCLUDE(FindPkgConfig)
+include(FindPkgConfig)
PKG_CHECK_MODULES(PC_LIBUSB QUIET libusb-1.0)
-FIND_PATH(LIBUSB_INCLUDE_DIRS
+find_path(LIBUSB_INCLUDE_DIRS
NAMES libusb.h
HINTS $ENV{LIBUSB_DIR}/include $ENV{LIBUSB_DIR}/include/libusb-1.0
${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDEDIR}/libusb-1.0
@@ -27,7 +27,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD"
list(APPEND libusb1_library_names usb)
endif()
-FIND_LIBRARY(LIBUSB_LIBRARIES
+find_library(LIBUSB_LIBRARIES
NAMES ${libusb1_library_names}
HINTS $ENV{LIBUSB_DIR}/lib ${PC_LIBUSB_LIBDIR}
PATHS /usr/local/lib /usr/lib /opt/local/lib
@@ -59,4 +59,4 @@ endif(HAVE_LIBUSB_STRERROR)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS)
-MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIRS LIBUSB_LIBRARIES)
+mark_as_advanced(LIBUSB_INCLUDE_DIRS LIBUSB_LIBRARIES)
diff --git a/host/cmake/Modules/UHDBuildInfo.cmake b/host/cmake/Modules/UHDBuildInfo.cmake
index 21b1e3c1d..468635b15 100644
--- a/host/cmake/Modules/UHDBuildInfo.cmake
+++ b/host/cmake/Modules/UHDBuildInfo.cmake
@@ -8,46 +8,46 @@
# We need this to be macro because GET_DIRECTORY_PROPERTY works with
# the current directory.
#
-MACRO(UHD_LOAD_BUILD_INFO)
- MESSAGE(STATUS "")
- MESSAGE(STATUS "Loading build info.")
+macro(UHD_LOAD_BUILD_INFO)
+ message(STATUS "")
+ message(STATUS "Loading build info.")
# Build date
- IF(IGNORE_BUILD_DATE)
- SET(UHD_BUILD_DATE "")
- ELSE()
- EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c
+ if(IGNORE_BUILD_DATE)
+ set(UHD_BUILD_DATE "")
+ else()
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
"import time; print(time.strftime('%a, %d %b %Y %H:%M:%S', time.gmtime()))"
OUTPUT_VARIABLE UHD_BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE
)
- ENDIF(IGNORE_BUILD_DATE)
+ endif(IGNORE_BUILD_DATE)
# Compiler name
- IF(MSVC)
- IF(MSVC10)
- SET(UHD_C_COMPILER "MSVC 2010")
- SET(UHD_CXX_COMPILER "MSVC 2010")
- ELSEIF(MSVC11)
- SET(UHD_C_COMPILER "MSVC 2012")
- SET(UHD_CXX_COMPILER "MSVC 2012")
- ELSEIF(MSVC12)
- SET(UHD_C_COMPILER "MSVC 2013")
- SET(UHD_CXX_COMPILER "MSVC 2013")
- ELSEIF(MSVC14)
- SET(UHD_C_COMPILER "MSVC 2015")
- SET(UHD_CXX_COMPILER "MSVC 2015")
- ELSE()
+ if(MSVC)
+ if(MSVC10)
+ set(UHD_C_COMPILER "MSVC 2010")
+ set(UHD_CXX_COMPILER "MSVC 2010")
+ elseif(MSVC11)
+ set(UHD_C_COMPILER "MSVC 2012")
+ set(UHD_CXX_COMPILER "MSVC 2012")
+ elseif(MSVC12)
+ set(UHD_C_COMPILER "MSVC 2013")
+ set(UHD_CXX_COMPILER "MSVC 2013")
+ elseif(MSVC14)
+ set(UHD_C_COMPILER "MSVC 2015")
+ set(UHD_CXX_COMPILER "MSVC 2015")
+ else()
# Go with the ugly string
- SET(UHD_C_COMPILER "MSVC ${CMAKE_C_COMPILER_VERSION}")
- SET(UHD_CXX_COMPILER "MSVC ${CMAKE_CXX_COMPILER_VERSION}")
- ENDIF(MSVC10)
- ELSE()
- SET(UHD_C_COMPILER "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
- SET(UHD_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
- ENDIF(MSVC)
+ set(UHD_C_COMPILER "MSVC ${CMAKE_C_COMPILER_VERSION}")
+ set(UHD_CXX_COMPILER "MSVC ${CMAKE_CXX_COMPILER_VERSION}")
+ endif(MSVC10)
+ else()
+ set(UHD_C_COMPILER "${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}")
+ set(UHD_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
+ endif(MSVC)
# Compiler flags
- GET_DIRECTORY_PROPERTY(uhd_flags COMPILE_DEFINITIONS)
- SET(UHD_C_FLAGS "${uhd_flags}${CMAKE_C_FLAGS}") # CMAKE_C_FLAGS starts with a space
- SET(UHD_CXX_FLAGS "${uhd_flags}${CMAKE_CXX_FLAGS}") # CMAKE_CXX_FLAGS starts with a space
-ENDMACRO(UHD_LOAD_BUILD_INFO)
+ get_directory_property(uhd_flags COMPILE_DEFINITIONS)
+ set(UHD_C_FLAGS "${uhd_flags}${CMAKE_C_FLAGS}") # CMAKE_C_FLAGS starts with a space
+ set(UHD_CXX_FLAGS "${uhd_flags}${CMAKE_CXX_FLAGS}") # CMAKE_CXX_FLAGS starts with a space
+endmacro(UHD_LOAD_BUILD_INFO)
diff --git a/host/cmake/Modules/UHDComponent.cmake b/host/cmake/Modules/UHDComponent.cmake
index b18f651ea..db8806be9 100644
--- a/host/cmake/Modules/UHDComponent.cmake
+++ b/host/cmake/Modules/UHDComponent.cmake
@@ -6,8 +6,8 @@
#
########################################################################
-SET(_uhd_enabled_components "" CACHE INTERNAL "" FORCE)
-SET(_uhd_disabled_components "" CACHE INTERNAL "" FORCE)
+set(_uhd_enabled_components "" CACHE INTERNAL "" FORCE)
+set(_uhd_disabled_components "" CACHE INTERNAL "" FORCE)
########################################################################
# Register a component into the system
@@ -22,29 +22,29 @@ SET(_uhd_disabled_components "" CACHE INTERNAL "" FORCE)
# "FOO" which is enabled by calling CMake with -DENABLE_FOO=ON. It defaults to
# ON, unless DEPENDENCY_FOUND is false, in which case it becomes false.
########################################################################
-MACRO(LIBUHD_REGISTER_COMPONENT name var enb deps dis req)
- MESSAGE(STATUS "")
- MESSAGE(STATUS "Configuring ${name} support...")
- FOREACH(dep ${deps})
- MESSAGE(STATUS " Dependency ${dep} = ${${dep}}")
- ENDFOREACH(dep)
+macro(LIBUHD_REGISTER_COMPONENT name var enb deps dis req)
+ message(STATUS "")
+ message(STATUS "Configuring ${name} support...")
+ foreach(dep ${deps})
+ message(STATUS " Dependency ${dep} = ${${dep}}")
+ endforeach(dep)
# If user specified option, store here. Note: If the user doesn't specify
# this option on the cmake command line, both user_enabled and
# user_disabled will be false!
- IF("${${var}}" STREQUAL "OFF")
- SET(user_disabled TRUE)
- ELSE()
- SET(user_disabled FALSE)
- ENDIF("${${var}}" STREQUAL "OFF")
- IF("${${var}}" STREQUAL "ON")
- SET(user_enabled TRUE)
- ELSE()
- SET(user_enabled FALSE)
- ENDIF("${${var}}" STREQUAL "ON")
+ if("${${var}}" STREQUAL "OFF")
+ set(user_disabled TRUE)
+ else()
+ set(user_disabled FALSE)
+ endif("${${var}}" STREQUAL "OFF")
+ if("${${var}}" STREQUAL "ON")
+ set(user_enabled TRUE)
+ else()
+ set(user_enabled FALSE)
+ endif("${${var}}" STREQUAL "ON")
#setup the dependent option for this component
- INCLUDE(CMakeDependentOption)
+ include(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${enb} "${deps}" ${dis})
# There are two failure cases:
@@ -52,105 +52,105 @@ MACRO(LIBUHD_REGISTER_COMPONENT name var enb deps dis req)
# requirements are not met.
# 2) The user did not explicitly turn off this component (-DENABLE_FOO=OFF)
# but it is flagged as required by ${req}
- IF(NOT ${var} AND user_enabled) # Case 1)
- MESSAGE(FATAL_ERROR "Dependencies for required component ${name} not met.")
- ENDIF(NOT ${var} AND user_enabled)
- IF(NOT ${var} AND ${req} AND NOT user_disabled) # Case 2)
- MESSAGE(FATAL_ERROR "Dependencies for required component ${name} not met.")
- ENDIF(NOT ${var} AND ${req} AND NOT user_disabled)
+ if(NOT ${var} AND user_enabled) # Case 1)
+ message(FATAL_ERROR "Dependencies for required component ${name} not met.")
+ endif(NOT ${var} AND user_enabled)
+ if(NOT ${var} AND ${req} AND NOT user_disabled) # Case 2)
+ message(FATAL_ERROR "Dependencies for required component ${name} not met.")
+ endif(NOT ${var} AND ${req} AND NOT user_disabled)
#append the component into one of the lists
- IF(${var})
- MESSAGE(STATUS " Enabling ${name} support.")
- LIST(APPEND _uhd_enabled_components ${name})
- ELSE(${var})
- MESSAGE(STATUS " Disabling ${name} support.")
- LIST(APPEND _uhd_disabled_components ${name})
- ENDIF(${var})
- MESSAGE(STATUS " Override with -D${var}=ON/OFF")
+ if(${var})
+ message(STATUS " Enabling ${name} support.")
+ list(APPEND _uhd_enabled_components ${name})
+ else(${var})
+ message(STATUS " Disabling ${name} support.")
+ list(APPEND _uhd_disabled_components ${name})
+ endif(${var})
+ message(STATUS " Override with -D${var}=ON/OFF")
#make components lists into global variables
- SET(_uhd_enabled_components ${_uhd_enabled_components} CACHE INTERNAL "" FORCE)
- SET(_uhd_disabled_components ${_uhd_disabled_components} CACHE INTERNAL "" FORCE)
-ENDMACRO(LIBUHD_REGISTER_COMPONENT)
+ set(_uhd_enabled_components ${_uhd_enabled_components} CACHE INTERNAL "" FORCE)
+ set(_uhd_disabled_components ${_uhd_disabled_components} CACHE INTERNAL "" FORCE)
+endmacro(LIBUHD_REGISTER_COMPONENT)
########################################################################
# Install only if appropriate for package and if component is enabled
########################################################################
-FUNCTION(UHD_INSTALL)
+function(UHD_INSTALL)
include(CMakeParseArgumentsCopy)
- CMAKE_PARSE_ARGUMENTS(UHD_INSTALL "" "DESTINATION;COMPONENT" "TARGETS;FILES;PROGRAMS" ${ARGN})
+ 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_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 "devel")
- 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)
+ 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 "devel")
+ 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)
- MESSAGE(STATUS "")
- MESSAGE(STATUS "######################################################")
- MESSAGE(STATUS "# UHD enabled components ")
- MESSAGE(STATUS "######################################################")
- FOREACH(comp ${_uhd_enabled_components})
- MESSAGE(STATUS " * ${comp}")
- ENDFOREACH(comp)
+function(UHD_PRINT_COMPONENT_SUMMARY)
+ message(STATUS "")
+ message(STATUS "######################################################")
+ message(STATUS "# UHD enabled components ")
+ message(STATUS "######################################################")
+ foreach(comp ${_uhd_enabled_components})
+ message(STATUS " * ${comp}")
+ endforeach(comp)
- MESSAGE(STATUS "")
- MESSAGE(STATUS "######################################################")
- MESSAGE(STATUS "# UHD disabled components ")
- MESSAGE(STATUS "######################################################")
- FOREACH(comp ${_uhd_disabled_components})
- MESSAGE(STATUS " * ${comp}")
- ENDFOREACH(comp)
+ message(STATUS "")
+ message(STATUS "######################################################")
+ message(STATUS "# UHD disabled components ")
+ message(STATUS "######################################################")
+ foreach(comp ${_uhd_disabled_components})
+ message(STATUS " * ${comp}")
+ endforeach(comp)
- MESSAGE(STATUS "")
-ENDFUNCTION(UHD_PRINT_COMPONENT_SUMMARY)
+ message(STATUS "")
+endfunction(UHD_PRINT_COMPONENT_SUMMARY)
diff --git a/host/cmake/Modules/UHDConfig.cmake.in b/host/cmake/Modules/UHDConfig.cmake.in
index 4651e3a9c..30b0d92ff 100644
--- a/host/cmake/Modules/UHDConfig.cmake.in
+++ b/host/cmake/Modules/UHDConfig.cmake.in
@@ -25,50 +25,50 @@ set(ENV{UHD_CONFIG_USED} TRUE)
# set default values
-SET(UHD_FOUND TRUE)
-SET(UHD_RFNOC_FOUND @UHD_RFNOC_FOUND@)
-SET(UHD_INCLUDE_HINTS)
-SET(UHD_LIBDIR_HINTS)
-SET(UHD_DIR $ENV{UHD_DIR})
-
-IF(UHD_DIR)
- LIST(APPEND UHD_INCLUDE_HINTS ${UHD_DIR}/include)
- LIST(APPEND UHD_LIBDIR_HINTS ${UHD_DIR}/lib)
-ENDIF()
-
-INCLUDE(FindPkgConfig)
-IF(PKG_CONFIG_FOUND)
- IF(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.0")
- SET(UHD_QUIET "QUIET")
- ENDIF()
+set(UHD_FOUND TRUE)
+set(UHD_RFNOC_FOUND @UHD_RFNOC_FOUND@)
+set(UHD_INCLUDE_HINTS)
+set(UHD_LIBDIR_HINTS)
+set(UHD_DIR $ENV{UHD_DIR})
+
+if(UHD_DIR)
+ list(APPEND UHD_INCLUDE_HINTS ${UHD_DIR}/include)
+ list(APPEND UHD_LIBDIR_HINTS ${UHD_DIR}/lib)
+endif()
+
+include(FindPkgConfig)
+if(PKG_CONFIG_FOUND)
+ if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.0")
+ set(UHD_QUIET "QUIET")
+ endif()
PKG_CHECK_MODULES(PC_UHD ${UHD_QUIET} uhd)
- IF(PC_UHD_FOUND)
- LIST(APPEND UHD_INCLUDE_HINTS ${PC_UHD_INCLUDEDIR})
- LIST(APPEND UHD_LIBDIR_HINTS ${PC_UHD_LIBDIR})
- ENDIF()
-ENDIF()
+ if(PC_UHD_FOUND)
+ list(APPEND UHD_INCLUDE_HINTS ${PC_UHD_INCLUDEDIR})
+ list(APPEND UHD_LIBDIR_HINTS ${PC_UHD_LIBDIR})
+ endif()
+endif()
-LIST(APPEND UHD_INCLUDE_HINTS ${CMAKE_INSTALL_PREFIX}/include)
-LIST(APPEND UHD_LIBDIR_HINTS ${CMAKE_INSTALL_PREFIX}/lib)
+list(APPEND UHD_INCLUDE_HINTS ${CMAKE_INSTALL_PREFIX}/include)
+list(APPEND UHD_LIBDIR_HINTS ${CMAKE_INSTALL_PREFIX}/lib)
# Search for static libs if so required
-IF( UHD_USE_STATIC_LIBS )
- SET( _UHD_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
- IF(WIN32)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
- ELSE()
- SET(CMAKE_FIND_LIBRARY_SUFFIXES .a )
- ENDIF()
+if( UHD_USE_STATIC_LIBS )
+ set( _UHD_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ if(WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
+ endif()
# This is set during build of UHD to match the installed version:
- SET(UHD_STATIC_LIB_DEPS "@UHD_LINK_LIST_STATIC@")
-ENDIF()
+ set(UHD_STATIC_LIB_DEPS "@UHD_LINK_LIST_STATIC@")
+endif()
# Verify that <uhd/config.hpp> and libuhd are available, and, if a
# version is provided, that UHD meets the version requirements -- no
# matter what pkg-config might think.
-FIND_PATH(
+find_path(
UHD_INCLUDE_DIRS
NAMES uhd/config.hpp
HINTS ${UHD_INCLUDE_HINTS}
@@ -76,7 +76,7 @@ FIND_PATH(
/usr/include
)
-FIND_LIBRARY(
+find_library(
UHD_LIBRARIES
NAMES uhd
HINTS ${UHD_LIBDIR_HINTS}
@@ -85,25 +85,25 @@ FIND_LIBRARY(
)
# Set up linker flags for static linking:
-IF(UHD_USE_STATIC_LIBS)
- IF(WIN32)
- MESSAGE(FATAL_ERROR "Static linking not available on Windows")
- ELSE(WIN32)
+if(UHD_USE_STATIC_LIBS)
+ if(WIN32)
+ message(FATAL_ERROR "Static linking not available on Windows")
+ else(WIN32)
# This works for gcc and Clang:
- SET(UHD_STATIC_LIB_LINK_FLAG "-Wl,-whole-archive ${UHD_LIBRARIES} -Wl,-no-whole-archive")
- ENDIF(WIN32)
+ set(UHD_STATIC_LIB_LINK_FLAG "-Wl,-whole-archive ${UHD_LIBRARIES} -Wl,-no-whole-archive")
+ endif(WIN32)
# Restore the library suffixes, if we changed them:
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_UHD_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
-ENDIF(UHD_USE_STATIC_LIBS)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_UHD_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+endif(UHD_USE_STATIC_LIBS)
-IF(UHD_LIBRARIES AND UHD_INCLUDE_DIRS)
+if(UHD_LIBRARIES AND UHD_INCLUDE_DIRS)
- INCLUDE(FindPackageHandleStandardArgs)
+ include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
- MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS)
+ mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS)
-ELSEIF(UHD_FIND_REQUIRED)
+elseif(UHD_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "UHD is required, but was not found.")
+ message(FATAL_ERROR "UHD is required, but was not found.")
-ENDIF()
+endif()
diff --git a/host/cmake/Modules/UHDConfigVersion.cmake.in b/host/cmake/Modules/UHDConfigVersion.cmake.in
index 9945789b1..5e3e9558e 100644
--- a/host/cmake/Modules/UHDConfigVersion.cmake.in
+++ b/host/cmake/Modules/UHDConfigVersion.cmake.in
@@ -19,14 +19,14 @@ set(ENV{UHD_CONFIG_VERSION_USED} TRUE)
# version values as set in cmake/Modules/UHDVersion.cmake, placed
# statically in here to avoid using Python all over again.
-SET(MAJOR_VERSION @UHD_VERSION_MAJOR@)
-SET(API_VERSION @UHD_VERSION_API@)
-SET(ABI_VERSION @UHD_VERSION_ABI@)
-SET(PATCH_VERSION @UHD_VERSION_PATCH@)
-SET(DEVEL_VERSION @UHD_VERSION_DEVEL@)
+set(MAJOR_VERSION @UHD_VERSION_MAJOR@)
+set(API_VERSION @UHD_VERSION_API@)
+set(ABI_VERSION @UHD_VERSION_ABI@)
+set(PATCH_VERSION @UHD_VERSION_PATCH@)
+set(DEVEL_VERSION @UHD_VERSION_DEVEL@)
-SET(PACKAGE_VERSION @UHD_VERSION@)
-SET(ENV{UHD_PACKAGE_VERSION} ${PACKAGE_VERSION})
+set(PACKAGE_VERSION @UHD_VERSION@)
+set(ENV{UHD_PACKAGE_VERSION} ${PACKAGE_VERSION})
# There is a bug in CMake whereby calling "find_package(FOO)" within
# "find_package(FOO)" results in the version being checked in the
@@ -34,62 +34,62 @@ SET(ENV{UHD_PACKAGE_VERSION} ${PACKAGE_VERSION})
# "PACKAGE_FIND_VERSION" and if empty set return variables to TRUE to
# make CMake happy. Not the best solution, but it does the trick.
-IF(NOT PACKAGE_FIND_VERSION)
- SET(PACKAGE_VERSION_COMPATIBLE TRUE)
- SET(PACKAGE_VERSION_EXACT TRUE)
- RETURN()
-ENDIF(NOT PACKAGE_FIND_VERSION)
+if(NOT PACKAGE_FIND_VERSION)
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ set(PACKAGE_VERSION_EXACT TRUE)
+ return()
+endif(NOT PACKAGE_FIND_VERSION)
# Development branches of UHD don't have a patch version. This is a hack
# to add a fake patch version that should be higher than anything the user
# requests.
-IF(DEVEL_VERSION)
- SET(PACKAGE_VERSION "${MAJOR_VERSION}.${API_VERSION}.${ABI_VERSION}.999")
-ENDIF(DEVEL_VERSION)
+if(DEVEL_VERSION)
+ set(PACKAGE_VERSION "${MAJOR_VERSION}.${API_VERSION}.${ABI_VERSION}.999")
+endif(DEVEL_VERSION)
# assume incorrect versioning by default
-SET(PACKAGE_VERSION_COMPATIBLE FALSE)
-SET(PACKAGE_VERSION_EXACT FALSE)
+set(PACKAGE_VERSION_COMPATIBLE FALSE)
+set(PACKAGE_VERSION_EXACT FALSE)
# do not use ABI for now
-SET(UHD_USE_ABI FALSE)
+set(UHD_USE_ABI FALSE)
# leave the ABI checking in, for now, just in case it is wanted in the
# future. This code works nicely to find the ABI compatibility
# version from <uhd/version.hpp>.
-IF(UHD_USE_ABI)
+if(UHD_USE_ABI)
# find ABI compatible version from <uhd/version.hpp>
- SET(UHD_INCLUDE_HINTS)
- SET(UHD_DIR $ENV{UHD_DIR})
+ set(UHD_INCLUDE_HINTS)
+ set(UHD_DIR $ENV{UHD_DIR})
- IF(UHD_DIR)
- LIST(APPEND UHD_INCLUDE_HINTS ${UHD_DIR}/include)
- ENDIF()
+ if(UHD_DIR)
+ list(APPEND UHD_INCLUDE_HINTS ${UHD_DIR}/include)
+ endif()
- INCLUDE(FindPkgConfig)
- IF(PKG_CONFIG_FOUND)
- IF(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.0")
- SET(UHD_QUIET "QUIET")
- ENDIF()
- IF(PACKAGE_VERSION_EXACT)
+ include(FindPkgConfig)
+ if(PKG_CONFIG_FOUND)
+ if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.0")
+ set(UHD_QUIET "QUIET")
+ endif()
+ if(PACKAGE_VERSION_EXACT)
PKG_CHECK_MODULES(PC_UHD ${UHD_QUIET} uhd=${UHD_FIND_VERSION})
- ELSE()
+ else()
PKG_CHECK_MODULES(PC_UHD ${UHD_QUIET} uhd>=${UHD_FIND_VERSION})
- ENDIF()
- IF(PC_UHD_FOUND)
- LIST(APPEND UHD_INCLUDE_HINTS ${PC_UHD_INCLUDEDIR})
- ENDIF()
- ENDIF()
+ endif()
+ if(PC_UHD_FOUND)
+ list(APPEND UHD_INCLUDE_HINTS ${PC_UHD_INCLUDEDIR})
+ endif()
+ endif()
- LIST(APPEND UHD_INCLUDE_HINTS ${CMAKE_INSTALL_PREFIX}/include)
+ list(APPEND UHD_INCLUDE_HINTS ${CMAKE_INSTALL_PREFIX}/include)
# Verify that <uhd/config.hpp> and libuhd are available, and, if a
# version is provided, that UHD meets the version requirements -- no
# matter what pkg-config might think.
- FIND_PATH(
+ find_path(
UHD_INCLUDE_DIR
NAMES uhd/version.hpp
HINTS ${UHD_INCLUDE_HINTS}
@@ -97,72 +97,72 @@ IF(UHD_USE_ABI)
/usr/include
)
- IF(UHD_INCLUDE_DIR)
+ if(UHD_INCLUDE_DIR)
# extract the UHD API version from the installed header
- FILE(STRINGS "${UHD_INCLUDE_DIR}/uhd/version.hpp"
+ file(STRINGS "${UHD_INCLUDE_DIR}/uhd/version.hpp"
UHD_STRING_VERSION REGEX "UHD_VERSION_ABI_STRING")
- STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
UHD_ABI_VERSION_CONCISE ${UHD_STRING_VERSION})
# convert UHD_FIND_VERSION into concise #.#.# format for comparison
- STRING(REGEX REPLACE "([^\\.]*)\\.([^\\.]*)\\.([^\\.]*)"
+ string(REGEX REPLACE "([^\\.]*)\\.([^\\.]*)\\.([^\\.]*)"
"\\1.\\2.\\3" UHD_ABI_VERSION_TMP ${UHD_ABI_VERSION_CONCISE})
- STRING(REPLACE "0" "" UHD_ABI_MAJOR ${CMAKE_MATCH_1})
- STRING(REPLACE "0" "" UHD_ABI_MINOR ${CMAKE_MATCH_2})
- STRING(REPLACE "0" "" UHD_ABI_PATCH ${CMAKE_MATCH_3})
+ string(REPLACE "0" "" UHD_ABI_MAJOR ${CMAKE_MATCH_1})
+ string(REPLACE "0" "" UHD_ABI_MINOR ${CMAKE_MATCH_2})
+ string(REPLACE "0" "" UHD_ABI_PATCH ${CMAKE_MATCH_3})
# fix the case where the version number is "000"
- IF(NOT UHD_ABI_MAJOR)
- SET(UHD_ABI_MAJOR "0")
- ENDIF()
- IF(NOT UHD_ABI_MINOR)
- SET(UHD_ABI_MINOR "0")
- ENDIF()
- IF(NOT UHD_ABI_PATCH)
- SET(UHD_ABI_PATCH "0")
- ENDIF()
+ if(NOT UHD_ABI_MAJOR)
+ set(UHD_ABI_MAJOR "0")
+ endif()
+ if(NOT UHD_ABI_MINOR)
+ set(UHD_ABI_MINOR "0")
+ endif()
+ if(NOT UHD_ABI_PATCH)
+ set(UHD_ABI_PATCH "0")
+ endif()
- SET(UHD_ABI_VERSION_CONCISE ${UHD_ABI_MAJOR}.${UHD_ABI_MINOR}.${UHD_ABI_PATCH})
+ set(UHD_ABI_VERSION_CONCISE ${UHD_ABI_MAJOR}.${UHD_ABI_MINOR}.${UHD_ABI_PATCH})
- ELSE(UHD_INCLUDE_DIR)
+ else(UHD_INCLUDE_DIR)
# no header found ... not a good sign! Assume ABI version is the
# same as that known internally here. Let UHDConfig.cmake fail if
# it cannot find <uhd/config.hpp> or "libuhd" ...
- SET(UHD_ABI_VERSION_CONCISE ${PACKAGE_VERSION})
+ set(UHD_ABI_VERSION_CONCISE ${PACKAGE_VERSION})
- ENDIF(UHD_INCLUDE_DIR)
+ endif(UHD_INCLUDE_DIR)
# check for ABI compatibility, both:
# ACTUAL VERSION >= DESIRED VERSION >= ABI VERSION
- IF(NOT ${PACKAGE_FIND_VERSION} VERSION_LESS ${UHD_ABI_VERSION_CONCISE} AND
+ if(NOT ${PACKAGE_FIND_VERSION} VERSION_LESS ${UHD_ABI_VERSION_CONCISE} AND
NOT ${PACKAGE_FIND_VERSION} VERSION_GREATER ${PACKAGE_VERSION})
- SET(PACKAGE_VERSION_COMPATIBLE TRUE)
- ENDIF()
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ endif()
-ELSE(UHD_USE_ABI)
+else(UHD_USE_ABI)
# use API only, and assume compatible of requested <= actual
# which is the same as "not >"
- IF(NOT ${PACKAGE_FIND_VERSION} VERSION_GREATER ${PACKAGE_VERSION})
- SET(PACKAGE_VERSION_COMPATIBLE TRUE)
- ENDIF()
+ if(NOT ${PACKAGE_FIND_VERSION} VERSION_GREATER ${PACKAGE_VERSION})
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ endif()
-ENDIF(UHD_USE_ABI)
+endif(UHD_USE_ABI)
# check for exact version
-IF(${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION})
- SET(PACKAGE_VERSION_EXACT TRUE)
-ENDIF()
+if(${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION})
+ set(PACKAGE_VERSION_EXACT TRUE)
+endif()
# Undo our patch-version-number hack
-SET(PACKAGE_VERSION @UHD_VERSION@)
+set(PACKAGE_VERSION @UHD_VERSION@)
diff --git a/host/cmake/Modules/UHDGlobalDefs.cmake b/host/cmake/Modules/UHDGlobalDefs.cmake
index d21519479..47bb83511 100644
--- a/host/cmake/Modules/UHDGlobalDefs.cmake
+++ b/host/cmake/Modules/UHDGlobalDefs.cmake
@@ -7,22 +7,22 @@
# This file sets up all the stuff for the config.h file
-INCLUDE(CheckCXXSymbolExistsCopy)
+include(CheckCXXSymbolExistsCopy)
## Check for std::log2
CHECK_CXX_SYMBOL_EXISTS(log2 cmath HAVE_LOG2)
## Macros for the version number
-IF(UHD_VERSION_DEVEL)
- MATH(EXPR UHD_VERSION_ADDED "1000000 * ${UHD_VERSION_MAJOR} + 10000 * ${UHD_VERSION_API} + 100 * ${UHD_VERSION_ABI} + 99")
-ELSE()
- MATH(EXPR UHD_VERSION_ADDED "1000000 * ${UHD_VERSION_MAJOR} + 10000 * ${UHD_VERSION_API} + 100 * ${UHD_VERSION_ABI} + ${UHD_VERSION_PATCH}")
-ENDIF(UHD_VERSION_DEVEL)
+if(UHD_VERSION_DEVEL)
+ math(EXPR UHD_VERSION_ADDED "1000000 * ${UHD_VERSION_MAJOR} + 10000 * ${UHD_VERSION_API} + 100 * ${UHD_VERSION_ABI} + 99")
+else()
+ math(EXPR UHD_VERSION_ADDED "1000000 * ${UHD_VERSION_MAJOR} + 10000 * ${UHD_VERSION_API} + 100 * ${UHD_VERSION_ABI} + ${UHD_VERSION_PATCH}")
+endif(UHD_VERSION_DEVEL)
## RFNoC
-IF(ENABLE_RFNOC)
- ADD_DEFINITIONS(-DUHD_RFNOC_ENABLED)
-ENDIF(ENABLE_RFNOC)
+if(ENABLE_RFNOC)
+ add_definitions(-DUHD_RFNOC_ENABLED)
+endif(ENABLE_RFNOC)
## make sure the code knows about config.h
-ADD_DEFINITIONS(-DHAVE_CONFIG_H)
+add_definitions(-DHAVE_CONFIG_H)
diff --git a/host/cmake/Modules/UHDLog.cmake b/host/cmake/Modules/UHDLog.cmake
index 4bc1daf13..18643e672 100644
--- a/host/cmake/Modules/UHDLog.cmake
+++ b/host/cmake/Modules/UHDLog.cmake
@@ -1,72 +1,72 @@
########################################################################
# Logging Variables
########################################################################
-IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
- SET(UHD_LOG_MIN_LEVEL "debug" CACHE STRING "Set UHD log level to {trace, debug, info, warning, error, fatal}")
- SET(UHD_LOG_CONSOLE_DISABLE "OFF" CACHE BOOL "Disable UHD logging to stderr")
- SET(UHD_LOG_FILE_LEVEL "trace" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
- SET(UHD_LOG_CONSOLE_LEVEL "debug" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
-ELSE()
- SET(UHD_LOG_MIN_LEVEL "debug" CACHE STRING "Set UHD log level to {trace, debug, info, warning, error, fatal}")
- SET(UHD_LOG_CONSOLE_DISABLE "OFF" CACHE BOOL "Disable UHD logging to stderr")
- SET(UHD_LOG_FILE_LEVEL "info" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
- SET(UHD_LOG_CONSOLE_LEVEL "info" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
-ENDIF()
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(UHD_LOG_MIN_LEVEL "debug" CACHE STRING "Set UHD log level to {trace, debug, info, warning, error, fatal}")
+ set(UHD_LOG_CONSOLE_DISABLE "OFF" CACHE BOOL "Disable UHD logging to stderr")
+ set(UHD_LOG_FILE_LEVEL "trace" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
+ set(UHD_LOG_CONSOLE_LEVEL "debug" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
+else()
+ set(UHD_LOG_MIN_LEVEL "debug" CACHE STRING "Set UHD log level to {trace, debug, info, warning, error, fatal}")
+ set(UHD_LOG_CONSOLE_DISABLE "OFF" CACHE BOOL "Disable UHD logging to stderr")
+ set(UHD_LOG_FILE_LEVEL "info" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
+ set(UHD_LOG_CONSOLE_LEVEL "info" CACHE STRING "SET UHD file logging level to {trace, debug, info, warning, error, fatal}")
+endif()
-FUNCTION(UHD_LOG_LEVEL_CONVERT ARG1 ARG2)
+function(UHD_LOG_LEVEL_CONVERT ARG1 ARG2)
string(TOLOWER "${ARG1}" LOG_LEVEL_LOWER)
- IF(LOG_LEVEL_LOWER STREQUAL "trace")
- ADD_DEFINITIONS(-D${ARG2}=0)
- ELSEIF(LOG_LEVEL_LOWER STREQUAL "debug")
- ADD_DEFINITIONS(-D${ARG2}=1)
- ELSEIF(LOG_LEVEL_LOWER STREQUAL "info")
- ADD_DEFINITIONS(-D${ARG2}=2)
- ELSEIF(LOG_LEVEL_LOWER STREQUAL "warning")
- ADD_DEFINITIONS(-D${ARG2}=3)
- ELSEIF(LOG_LEVEL_LOWER STREQUAL "error")
- ADD_DEFINITIONS(-D${ARG2}=4)
- ELSEIF(LOG_LEVEL_LOWER STREQUAL "fatal")
- ADD_DEFINITIONS(-D${ARG2}=5)
- ELSE()
- ADD_DEFINITIONS(-D${ARG2}=${ARG1})
- ENDIF()
-ENDFUNCTION()
+ if(LOG_LEVEL_LOWER STREQUAL "trace")
+ add_definitions(-D${ARG2}=0)
+ elseif(LOG_LEVEL_LOWER STREQUAL "debug")
+ add_definitions(-D${ARG2}=1)
+ elseif(LOG_LEVEL_LOWER STREQUAL "info")
+ add_definitions(-D${ARG2}=2)
+ elseif(LOG_LEVEL_LOWER STREQUAL "warning")
+ add_definitions(-D${ARG2}=3)
+ elseif(LOG_LEVEL_LOWER STREQUAL "error")
+ add_definitions(-D${ARG2}=4)
+ elseif(LOG_LEVEL_LOWER STREQUAL "fatal")
+ add_definitions(-D${ARG2}=5)
+ else()
+ add_definitions(-D${ARG2}=${ARG1})
+ endif()
+endfunction()
UHD_LOG_LEVEL_CONVERT(${UHD_LOG_MIN_LEVEL} "UHD_LOG_MIN_LEVEL")
UHD_LOG_LEVEL_CONVERT(${UHD_LOG_CONSOLE_LEVEL} "UHD_LOG_CONSOLE_LEVEL")
UHD_LOG_LEVEL_CONVERT(${UHD_LOG_FILE_LEVEL} "UHD_LOG_FILE_LEVEL")
-IF(UHD_LOG_CONSOLE_DISABLE)
- ADD_DEFINITIONS(-DUHD_LOG_CONSOLE_DISABLE)
-ELSE()
- IF(UHD_LOG_CONSOLE_TIME)
- ADD_DEFINITIONS(-DUHD_LOG_CONSOLE_TIME)
- ENDIF()
- IF(UHD_LOG_CONSOLE_THREAD)
- ADD_DEFINITIONS(-DUHD_LOG_CONSOLE_THREAD)
- ENDIF()
- IF(UHD_LOG_CONSOLE_SRC)
- ADD_DEFINITIONS(-DUHD_LOG_CONSOLE_SRC)
- ENDIF()
-ENDIF()
+if(UHD_LOG_CONSOLE_DISABLE)
+ add_definitions(-DUHD_LOG_CONSOLE_DISABLE)
+else()
+ if(UHD_LOG_CONSOLE_TIME)
+ add_definitions(-DUHD_LOG_CONSOLE_TIME)
+ endif()
+ if(UHD_LOG_CONSOLE_THREAD)
+ add_definitions(-DUHD_LOG_CONSOLE_THREAD)
+ endif()
+ if(UHD_LOG_CONSOLE_SRC)
+ add_definitions(-DUHD_LOG_CONSOLE_SRC)
+ endif()
+endif()
-SET(UHD_LOG_FASTPATH_DISABLE "OFF" CACHE BOOL "Disable printing of fastpath logging symbols to stderr (DOSU)")
-IF(UHD_LOG_FASTPATH_DISABLE)
- ADD_DEFINITIONS(-DUHD_LOG_FASTPATH_DISABLE)
-ENDIF()
+set(UHD_LOG_FASTPATH_DISABLE "OFF" CACHE BOOL "Disable printing of fastpath logging symbols to stderr (DOSU)")
+if(UHD_LOG_FASTPATH_DISABLE)
+ add_definitions(-DUHD_LOG_FASTPATH_DISABLE)
+endif()
-IF(MSVC OR CYGWIN)
- SET(UHD_LOG_CONSOLE_COLOR "OFF" CACHE BOOL "Enable color output on the terminal")
-ELSE()
- SET(UHD_LOG_CONSOLE_COLOR "ON" CACHE BOOL "Enable color output on the terminal")
-ENDIF()
+if(MSVC OR CYGWIN)
+ set(UHD_LOG_CONSOLE_COLOR "OFF" CACHE BOOL "Enable color output on the terminal")
+else()
+ set(UHD_LOG_CONSOLE_COLOR "ON" CACHE BOOL "Enable color output on the terminal")
+endif()
-IF(UHD_LOG_CONSOLE_COLOR)
- ADD_DEFINITIONS(-DUHD_LOG_CONSOLE_COLOR)
-ENDIF()
+if(UHD_LOG_CONSOLE_COLOR)
+ add_definitions(-DUHD_LOG_CONSOLE_COLOR)
+endif()
-SET(UHD_LOG_FILE "" CACHE FILE "Set UHD log file to a file in a existing directory")
-IF(NOT UHD_LOG_FILE STREQUAL "")
- ADD_DEFINITIONS(-DUHD_LOG_FILE=${UHD_LOG_FILE})
-ENDIF()
+set(UHD_LOG_FILE "" CACHE FILE "Set UHD log file to a file in a existing directory")
+if(NOT UHD_LOG_FILE STREQUAL "")
+ add_definitions(-DUHD_LOG_FILE=${UHD_LOG_FILE})
+endif()
diff --git a/host/cmake/Modules/UHDPackage.cmake b/host/cmake/Modules/UHDPackage.cmake
index 1ba981398..9c418f331 100644
--- a/host/cmake/Modules/UHDPackage.cmake
+++ b/host/cmake/Modules/UHDPackage.cmake
@@ -6,169 +6,169 @@
#
########################################################################
-INCLUDE(UHDVersion) #sets version information
+include(UHDVersion) #sets version information
-SET(UHD_RELEASE_MODE "${UHD_RELEASE_MODE}" CACHE BOOL "set UHD to release mode to build installers")
+set(UHD_RELEASE_MODE "${UHD_RELEASE_MODE}" CACHE BOOL "set UHD to release mode to build installers")
########################################################################
# Setup additional defines for OS types
########################################################################
-IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- SET(LINUX TRUE)
-ENDIF()
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ set(LINUX TRUE)
+endif()
-IF(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/debian_version")
- SET(DEBIAN TRUE)
-ENDIF()
+if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/debian_version")
+ set(DEBIAN TRUE)
+endif()
-IF(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/redhat-release")
- SET(REDHAT TRUE)
-ENDIF()
+if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/redhat-release")
+ set(REDHAT TRUE)
+endif()
########################################################################
# Set generator type for recognized systems
########################################################################
-IF(CPACK_GENERATOR)
+if(CPACK_GENERATOR)
#already set
-ELSEIF(APPLE)
- SET(CPACK_GENERATOR PackageMaker)
-ELSEIF(WIN32)
- SET(CPACK_GENERATOR NSIS)
-ELSEIF(DEBIAN)
- SET(CPACK_GENERATOR DEB)
-ELSEIF(REDHAT)
- SET(CPACK_GENERATOR RPM)
-ELSE()
- SET(CPACK_GENERATOR TGZ)
-ENDIF()
+elseif(APPLE)
+ set(CPACK_GENERATOR PackageMaker)
+elseif(WIN32)
+ set(CPACK_GENERATOR NSIS)
+elseif(DEBIAN)
+ set(CPACK_GENERATOR DEB)
+elseif(REDHAT)
+ set(CPACK_GENERATOR RPM)
+else()
+ set(CPACK_GENERATOR TGZ)
+endif()
########################################################################
# Setup package file name
########################################################################
-IF(DEBIAN AND LIBUHD_PKG)
- SET(CPACK_PACKAGE_FILE_NAME "libuhd${UHD_VERSION_MAJOR}_${UHD_VERSION}_${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
-ELSEIF(DEBIAN AND LIBUHDDEV_PKG)
- SET(CPACK_PACKAGE_FILE_NAME "libuhd-dev_${UHD_VERSION}_${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
-ELSEIF(DEBIAN AND UHDHOST_PKG)
- SET(CPACK_PACKAGE_FILE_NAME "uhd-host_${UHD_VERSION}_${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
-ELSE()
- IF(DEBIAN OR REDHAT)
- FIND_PROGRAM(LSB_RELEASE_EXECUTABLE lsb_release)
-
- IF(LSB_RELEASE_EXECUTABLE)
+if(DEBIAN AND LIBUHD_PKG)
+ set(CPACK_PACKAGE_FILE_NAME "libuhd${UHD_VERSION_MAJOR}_${UHD_VERSION}_${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
+elseif(DEBIAN AND LIBUHDDEV_PKG)
+ set(CPACK_PACKAGE_FILE_NAME "libuhd-dev_${UHD_VERSION}_${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
+elseif(DEBIAN AND UHDHOST_PKG)
+ set(CPACK_PACKAGE_FILE_NAME "uhd-host_${UHD_VERSION}_${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
+else()
+ if(DEBIAN OR REDHAT)
+ find_program(LSB_RELEASE_EXECUTABLE lsb_release)
+
+ if(LSB_RELEASE_EXECUTABLE)
#extract system information by executing the commands
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${LSB_RELEASE_EXECUTABLE} --short --id
OUTPUT_VARIABLE LSB_ID OUTPUT_STRIP_TRAILING_WHITESPACE
)
- EXECUTE_PROCESS(
+ execute_process(
COMMAND ${LSB_RELEASE_EXECUTABLE} --short --release
OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE
)
#set a more sensible package name for this system
- SET(CPACK_PACKAGE_FILE_NAME "uhd_${UHD_VERSION}_${LSB_ID}-${LSB_RELEASE}-${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
- ENDIF(LSB_RELEASE_EXECUTABLE)
- ENDIF(DEBIAN OR REDHAT)
-ENDIF(DEBIAN AND LIBUHD_PKG)
+ set(CPACK_PACKAGE_FILE_NAME "uhd_${UHD_VERSION}_${LSB_ID}-${LSB_RELEASE}-${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "")
+ endif(LSB_RELEASE_EXECUTABLE)
+ endif(DEBIAN OR REDHAT)
+endif(DEBIAN AND LIBUHD_PKG)
-IF(${CPACK_GENERATOR} STREQUAL NSIS)
+if(${CPACK_GENERATOR} STREQUAL NSIS)
- ENABLE_LANGUAGE(C)
+ enable_language(C)
include(CheckTypeSize)
check_type_size("void*[8]" BIT_WIDTH BUILTIN_TYPES_ONLY)
# If CMake option given, specify MSVC version in installer filename
- IF(SPECIFY_MSVC_VERSION)
- IF(MSVC90) # Visual Studio 2008 (9.0)
- SET(MSVC_VERSION "VS2008")
- ELSEIF(MSVC10) # Visual Studio 2010 (10.0)
- SET(MSVC_VERSION "VS2010")
- ELSEIF(MSVC11) # Visual Studio 2012 (11.0)
- SET(MSVC_VERSION "VS2012")
- ELSEIF(MSVC12) # Visual Studio 2013 (12.0)
- SET(MSVC_VERSION "VS2013")
- ELSEIF(MSVC14) # Visual Studio 2015 (14.0)
- SET(MSVC_VERSION "VS2015")
- ENDIF()
- SET(CPACK_PACKAGE_FILE_NAME "uhd_${UHD_VERSION}_Win${BIT_WIDTH}_${MSVC_VERSION}" CACHE INTERNAL "")
- ELSE()
- SET(CPACK_PACKAGE_FILE_NAME "uhd_${UHD_VERSION}_Win${BIT_WIDTH}" CACHE INTERNAL "")
- ENDIF(SPECIFY_MSVC_VERSION)
-
- SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
-ENDIF()
+ if(SPECIFY_MSVC_VERSION)
+ if(MSVC90) # Visual Studio 2008 (9.0)
+ set(MSVC_VERSION "VS2008")
+ elseif(MSVC10) # Visual Studio 2010 (10.0)
+ set(MSVC_VERSION "VS2010")
+ elseif(MSVC11) # Visual Studio 2012 (11.0)
+ set(MSVC_VERSION "VS2012")
+ elseif(MSVC12) # Visual Studio 2013 (12.0)
+ set(MSVC_VERSION "VS2013")
+ elseif(MSVC14) # Visual Studio 2015 (14.0)
+ set(MSVC_VERSION "VS2015")
+ endif()
+ set(CPACK_PACKAGE_FILE_NAME "uhd_${UHD_VERSION}_Win${BIT_WIDTH}_${MSVC_VERSION}" CACHE INTERNAL "")
+ else()
+ set(CPACK_PACKAGE_FILE_NAME "uhd_${UHD_VERSION}_Win${BIT_WIDTH}" CACHE INTERNAL "")
+ endif(SPECIFY_MSVC_VERSION)
+
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
+endif()
########################################################################
# Setup CPack General
########################################################################
-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ettus Research - USRP Hardware Driver")
-SET(CPACK_PACKAGE_VENDOR "Ettus Research (National Instruments)")
-SET(CPACK_PACKAGE_CONTACT "Ettus Research <support@ettus.com>")
-SET(CPACK_PACKAGE_VERSION "${UHD_VERSION}")
-SET(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README.md)
-SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ettus Research - USRP Hardware Driver")
+set(CPACK_PACKAGE_VENDOR "Ettus Research (National Instruments)")
+set(CPACK_PACKAGE_CONTACT "Ettus Research <support@ettus.com>")
+set(CPACK_PACKAGE_VERSION "${UHD_VERSION}")
+set(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_SOURCE_DIR}/README.md)
+set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE)
########################################################################
# Setup CPack Source
########################################################################
-SET(CPACK_SOURCE_PACKAGE_FILE_NAME "uhd-${UHD_VERSION}" CACHE INTERNAL "")
-SET(CPACK_SOURCE_IGNORE_FILES "\\\\.git*;\\\\.swp$")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "uhd-${UHD_VERSION}" CACHE INTERNAL "")
+set(CPACK_SOURCE_IGNORE_FILES "\\\\.git*;\\\\.swp$")
########################################################################
# Setup CPack Components
########################################################################
-SET(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
-SET(CPACK_COMPONENT_PYTHONAPI_GROUP "Development")
-SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
-SET(CPACK_COMPONENT_UTILITIES_GROUP "Runtime")
-SET(CPACK_COMPONENT_EXAMPLES_GROUP "Runtime")
-SET(CPACK_COMPONENT_MANUAL_GROUP "Documentation")
-SET(CPACK_COMPONENT_DOXYGEN_GROUP "Documentation")
-SET(CPACK_COMPONENT_README_GROUP "Documentation")
-
-SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
-SET(CPACK_COMPONENT_PYTHONAPI_DISPLAY_NAME "UHD Python API")
-SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
-SET(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME "Utilities")
-SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
-SET(CPACK_COMPONENT_MANUAL_DISPLAY_NAME "Manual")
-SET(CPACK_COMPONENT_DOXYGEN_DISPLAY_NAME "Doxygen")
-SET(CPACK_COMPONENT_README_DISPLAY_NAME "Readme")
-SET(CPACK_COMPONENT_IMAGES_DISPLAY_NAME "Images")
-
-SET(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Dynamic link library")
-SET(CPACK_COMPONENT_PYTHONAPI_DESCRIPTION "UHD Python API")
-SET(CPACK_COMPONENT_HEADERS_DESCRIPTION "C++ development headers")
-SET(CPACK_COMPONENT_UTILITIES_DESCRIPTION "Utility executables and python scripts")
-SET(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Example executables")
-SET(CPACK_COMPONENT_MANUAL_DESCRIPTION "Manual/application notes (rst and html)")
-SET(CPACK_COMPONENT_DOXYGEN_DESCRIPTION "API documentation (html)")
-SET(CPACK_COMPONENT_README_DESCRIPTION "Readme files (txt)")
-SET(CPACK_COMPONENT_IMAGES_DESCRIPTION "FPGA and firmware images")
-
-SET(CPACK_COMPONENT_README_REQUIRED TRUE)
-
-SET(CPACK_COMPONENT_UTILITIES_DEPENDS libraries)
-SET(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries)
-SET(CPACK_COMPONENT_TESTS_DEPENDS libraries)
-
-SET(CPACK_COMPONENTS_ALL libraries pythonapi headers utilities examples manual doxygen readme images)
+set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
+set(CPACK_COMPONENT_PYTHONAPI_GROUP "Development")
+set(CPACK_COMPONENT_HEADERS_GROUP "Development")
+set(CPACK_COMPONENT_UTILITIES_GROUP "Runtime")
+set(CPACK_COMPONENT_EXAMPLES_GROUP "Runtime")
+set(CPACK_COMPONENT_MANUAL_GROUP "Documentation")
+set(CPACK_COMPONENT_DOXYGEN_GROUP "Documentation")
+set(CPACK_COMPONENT_README_GROUP "Documentation")
+
+set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
+set(CPACK_COMPONENT_PYTHONAPI_DISPLAY_NAME "UHD Python API")
+set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
+set(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME "Utilities")
+set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
+set(CPACK_COMPONENT_MANUAL_DISPLAY_NAME "Manual")
+set(CPACK_COMPONENT_DOXYGEN_DISPLAY_NAME "Doxygen")
+set(CPACK_COMPONENT_README_DISPLAY_NAME "Readme")
+set(CPACK_COMPONENT_IMAGES_DISPLAY_NAME "Images")
+
+set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Dynamic link library")
+set(CPACK_COMPONENT_PYTHONAPI_DESCRIPTION "UHD Python API")
+set(CPACK_COMPONENT_HEADERS_DESCRIPTION "C++ development headers")
+set(CPACK_COMPONENT_UTILITIES_DESCRIPTION "Utility executables and python scripts")
+set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Example executables")
+set(CPACK_COMPONENT_MANUAL_DESCRIPTION "Manual/application notes (rst and html)")
+set(CPACK_COMPONENT_DOXYGEN_DESCRIPTION "API documentation (html)")
+set(CPACK_COMPONENT_README_DESCRIPTION "Readme files (txt)")
+set(CPACK_COMPONENT_IMAGES_DESCRIPTION "FPGA and firmware images")
+
+set(CPACK_COMPONENT_README_REQUIRED TRUE)
+
+set(CPACK_COMPONENT_UTILITIES_DEPENDS libraries)
+set(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries)
+set(CPACK_COMPONENT_TESTS_DEPENDS libraries)
+
+set(CPACK_COMPONENTS_ALL libraries pythonapi headers utilities examples manual doxygen readme images)
########################################################################
# Setup CPack Debian
########################################################################
-SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-all-dev, python-requests")
-SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python, python-tk")
-FOREACH(filename preinst postinst prerm postrm)
- LIST(APPEND CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_BINARY_DIR}/debian/${filename})
- FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/debian)
- CONFIGURE_FILE(
+set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-all-dev, python-requests")
+set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python, python-tk")
+foreach(filename preinst postinst prerm postrm)
+ list(APPEND CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CMAKE_BINARY_DIR}/debian/${filename})
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/debian)
+ configure_file(
${CMAKE_SOURCE_DIR}/cmake/debian/${filename}.in
${CMAKE_BINARY_DIR}/debian/${filename}
@ONLY)
-ENDFOREACH(filename)
-CONFIGURE_FILE(
+endforeach(filename)
+configure_file(
${CMAKE_SOURCE_DIR}/cmake/debian/watch
${CMAKE_BINARY_DIR}/debian/watch
@ONLY)
@@ -176,37 +176,37 @@ CONFIGURE_FILE(
########################################################################
# Setup CPack RPM
########################################################################
-SET(CPACK_RPM_PACKAGE_REQUIRES "boost-devel, python-requests")
+set(CPACK_RPM_PACKAGE_REQUIRES "boost-devel, python-requests")
-FOREACH(filename post_install post_uninstall pre_install pre_uninstall)
- STRING(TOUPPER ${filename} filename_upper)
- LIST(APPEND CPACK_RPM_${filename_upper}_SCRIPT_FILE ${CMAKE_BINARY_DIR}/redhat/${filename})
- FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/redhat)
- CONFIGURE_FILE(
+foreach(filename post_install post_uninstall pre_install pre_uninstall)
+ string(TOUPPER ${filename} filename_upper)
+ list(APPEND CPACK_RPM_${filename_upper}_SCRIPT_FILE ${CMAKE_BINARY_DIR}/redhat/${filename})
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/redhat)
+ configure_file(
${CMAKE_SOURCE_DIR}/cmake/redhat/${filename}.in
${CMAKE_BINARY_DIR}/redhat/${filename}
@ONLY)
-ENDFOREACH(filename)
+endforeach(filename)
########################################################################
# Setup CPack NSIS
########################################################################
-SET(CPACK_NSIS_MODIFY_PATH ON)
+set(CPACK_NSIS_MODIFY_PATH ON)
-SET(HLKM_ENV "\\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\"")
+set(HLKM_ENV "\\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\"")
-SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
+set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
WriteRegStr HKLM ${HLKM_ENV} \\\"UHD_PKG_PATH\\\" \\\"$INSTDIR\\\"
")
-SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
+set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
DeleteRegValue HKLM ${HLKM_ENV} \\\"UHD_PKG_PATH\\\"
")
-IF(WIN32)
+if(WIN32)
#Install necessary runtime DLL's
- INCLUDE(InstallRequiredSystemLibraries)
-ENDIF(WIN32)
+ include(InstallRequiredSystemLibraries)
+endif(WIN32)
########################################################################
-INCLUDE(CPack) #include after setting vars
+include(CPack) #include after setting vars
diff --git a/host/cmake/Modules/UHDPython.cmake b/host/cmake/Modules/UHDPython.cmake
index f8f3686c8..fb5874ada 100644
--- a/host/cmake/Modules/UHDPython.cmake
+++ b/host/cmake/Modules/UHDPython.cmake
@@ -5,58 +5,58 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
-IF(NOT DEFINED INCLUDED_UHD_PYTHON_CMAKE)
-SET(INCLUDED_UHD_PYTHON_CMAKE TRUE)
+if(NOT DEFINED INCLUDED_UHD_PYTHON_CMAKE)
+set(INCLUDED_UHD_PYTHON_CMAKE TRUE)
########################################################################
# Setup Python
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring the python interpreter...")
+message(STATUS "")
+message(STATUS "Configuring the python interpreter...")
#this allows the user to override PYTHON_EXECUTABLE
-IF(PYTHON_EXECUTABLE)
+if(PYTHON_EXECUTABLE)
- SET(PYTHONINTERP_FOUND TRUE)
+ set(PYTHONINTERP_FOUND TRUE)
#otherwise if not set, try to automatically find it
-ELSE(PYTHON_EXECUTABLE)
+else(PYTHON_EXECUTABLE)
#use the built-in find script
- IF(ENABLE_PYTHON3)
- FIND_PACKAGE(PythonInterp 3.0)
- ELSE(ENABLE_PYTHON3)
- FIND_PACKAGE(PythonInterp 2.0)
- ENDIF(ENABLE_PYTHON3)
+ if(ENABLE_PYTHON3)
+ find_package(PythonInterp 3.0)
+ else(ENABLE_PYTHON3)
+ find_package(PythonInterp 2.0)
+ endif(ENABLE_PYTHON3)
#and if that fails use the find program routine
- IF(NOT PYTHONINTERP_FOUND)
- IF(ENABLE_PYTHON3)
- FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python3 python3.5 python3.6)
- ELSE(ENABLE_PYTHON3)
- FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python2 python2.7)
- ENDIF(ENABLE_PYTHON3)
+ if(NOT PYTHONINTERP_FOUND)
+ if(ENABLE_PYTHON3)
+ find_program(PYTHON_EXECUTABLE NAMES python3 python3.5 python3.6)
+ else(ENABLE_PYTHON3)
+ find_program(PYTHON_EXECUTABLE NAMES python2 python2.7)
+ endif(ENABLE_PYTHON3)
- IF(PYTHON_EXECUTABLE)
- SET(PYTHONINTERP_FOUND TRUE)
- ENDIF(PYTHON_EXECUTABLE)
- ENDIF(NOT PYTHONINTERP_FOUND)
+ if(PYTHON_EXECUTABLE)
+ set(PYTHONINTERP_FOUND TRUE)
+ endif(PYTHON_EXECUTABLE)
+ endif(NOT PYTHONINTERP_FOUND)
-ENDIF(PYTHON_EXECUTABLE)
+endif(PYTHON_EXECUTABLE)
#make the path to the executable appear in the cmake gui
-SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
+set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
-MESSAGE(STATUS "Python interpreter: ${PYTHON_EXECUTABLE}")
-MESSAGE(STATUS "Override with: -DPYTHON_EXECUTABLE=<path-to-python>")
+message(STATUS "Python interpreter: ${PYTHON_EXECUTABLE}")
+message(STATUS "Override with: -DPYTHON_EXECUTABLE=<path-to-python>")
-IF(NOT PYTHONINTERP_FOUND)
- MESSAGE(FATAL_ERROR "Error: Python interpreter required by the build system.")
-ENDIF(NOT PYTHONINTERP_FOUND)
+if(NOT PYTHONINTERP_FOUND)
+ message(FATAL_ERROR "Error: Python interpreter required by the build system.")
+endif(NOT PYTHONINTERP_FOUND)
-MACRO(PYTHON_CHECK_MODULE desc mod cmd have)
- MESSAGE(STATUS "")
- MESSAGE(STATUS "Python checking for ${desc}")
- EXECUTE_PROCESS(
+macro(PYTHON_CHECK_MODULE desc mod cmd have)
+ message(STATUS "")
+ message(STATUS "Python checking for ${desc}")
+ execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "
#########################################
from distutils.version import LooseVersion
@@ -68,19 +68,19 @@ exit(0)
#########################################"
RESULT_VARIABLE ${have}
)
- IF(${have} EQUAL 0)
- MESSAGE(STATUS "Python checking for ${desc} - found")
- SET(${have} TRUE)
- ELSEIF(${have} EQUAL 1)
- MESSAGE(STATUS "Python checking for ${desc} - \"import ${mod}\" failed")
- SET(${have} FALSE)
- ELSEIF(${have} EQUAL 2)
- MESSAGE(STATUS "Python checking for ${desc} - \"assert ${cmd}\" failed")
- SET(${have} FALSE)
- ELSE()
- MESSAGE(STATUS "Python checking for ${desc} - unknown error")
- SET(${have} FALSE)
- ENDIF()
-ENDMACRO(PYTHON_CHECK_MODULE)
+ if(${have} EQUAL 0)
+ message(STATUS "Python checking for ${desc} - found")
+ set(${have} TRUE)
+ elseif(${have} EQUAL 1)
+ message(STATUS "Python checking for ${desc} - \"import ${mod}\" failed")
+ set(${have} FALSE)
+ elseif(${have} EQUAL 2)
+ message(STATUS "Python checking for ${desc} - \"assert ${cmd}\" failed")
+ set(${have} FALSE)
+ else()
+ message(STATUS "Python checking for ${desc} - unknown error")
+ set(${have} FALSE)
+ endif()
+endmacro(PYTHON_CHECK_MODULE)
-ENDIF(NOT DEFINED INCLUDED_UHD_PYTHON_CMAKE)
+endif(NOT DEFINED INCLUDED_UHD_PYTHON_CMAKE)
diff --git a/host/cmake/Modules/UHDUnitTest.cmake b/host/cmake/Modules/UHDUnitTest.cmake
index db245484c..7937db4d3 100644
--- a/host/cmake/Modules/UHDUnitTest.cmake
+++ b/host/cmake/Modules/UHDUnitTest.cmake
@@ -36,8 +36,8 @@ function(UHD_ADD_TEST test_name)
#http://www.cmake.org/pipermail/cmake/2009-May/029464.html
#Replaced this add test + set environs code with the shell script generation.
#Its nicer to be able to manually run the shell script to diagnose problems.
- #ADD_TEST(${ARGV})
- #SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}")
+ #add_test(${ARGV})
+ #set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "${environs}")
if(UNIX)
set(LD_PATH_VAR "LD_LIBRARY_PATH")
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake
index 2cee7db6f..0021ddec9 100644
--- a/host/cmake/Modules/UHDVersion.cmake
+++ b/host/cmake/Modules/UHDVersion.cmake
@@ -6,8 +6,8 @@
#
########################################################################
-INCLUDE(UHDPython) #requires python for parsing
-FIND_PACKAGE(Git QUIET)
+include(UHDPython) #requires python for parsing
+find_package(Git QUIET)
########################################################################
# Setup Version Numbers
@@ -17,64 +17,64 @@ FIND_PACKAGE(Git QUIET)
# - Increment patch for bugfixes and docs
# - set UHD_VERSION_DEVEL to true for master and development branches
########################################################################
-SET(UHD_VERSION_MAJOR 3)
-SET(UHD_VERSION_API 14)
-SET(UHD_VERSION_ABI 0)
-SET(UHD_VERSION_PATCH 0)
-SET(UHD_VERSION_DEVEL TRUE)
+set(UHD_VERSION_MAJOR 3)
+set(UHD_VERSION_API 14)
+set(UHD_VERSION_ABI 0)
+set(UHD_VERSION_PATCH 0)
+set(UHD_VERSION_DEVEL TRUE)
########################################################################
# If we're on a development branch, we skip the patch version
########################################################################
-IF(DEFINED UHD_VERSION_PATCH_OVERRIDE)
- SET(UHD_VERSION_DEVEL FALSE)
- SET(UHD_VERSION_PATCH ${UHD_VERSION_PATCH_OVERRIDE})
-ENDIF(DEFINED UHD_VERSION_PATCH_OVERRIDE)
-IF(NOT DEFINED UHD_VERSION_DEVEL)
- SET(UHD_VERSION_DEVEL FALSE)
-ENDIF(NOT DEFINED UHD_VERSION_DEVEL)
-SET(UHD_GIT_BRANCH "")
-IF(GIT_FOUND)
- EXECUTE_PROCESS(
+if(DEFINED UHD_VERSION_PATCH_OVERRIDE)
+ set(UHD_VERSION_DEVEL FALSE)
+ set(UHD_VERSION_PATCH ${UHD_VERSION_PATCH_OVERRIDE})
+endif(DEFINED UHD_VERSION_PATCH_OVERRIDE)
+if(NOT DEFINED UHD_VERSION_DEVEL)
+ set(UHD_VERSION_DEVEL FALSE)
+endif(NOT DEFINED UHD_VERSION_DEVEL)
+set(UHD_GIT_BRANCH "")
+if(GIT_FOUND)
+ execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE _git_branch OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _git_branch_result
)
- IF(_git_branch_result EQUAL 0)
- SET(UHD_GIT_BRANCH ${_git_branch})
- IF(UHD_GIT_BRANCH MATCHES "^UHD-")
- MESSAGE(STATUS "Operating on release branch (${UHD_GIT_BRANCH}).")
- SET(UHD_VERSION_DEVEL FALSE)
- ELSEIF(UHD_GIT_BRANCH STREQUAL "master")
- MESSAGE(STATUS "Operating on master branch.")
- SET(UHD_VERSION_DEVEL TRUE)
- ELSE()
- MESSAGE(STATUS "Working off of feature or development branch. Updating version number.")
- EXECUTE_PROCESS(
+ if(_git_branch_result EQUAL 0)
+ set(UHD_GIT_BRANCH ${_git_branch})
+ if(UHD_GIT_BRANCH MATCHES "^UHD-")
+ message(STATUS "Operating on release branch (${UHD_GIT_BRANCH}).")
+ set(UHD_VERSION_DEVEL FALSE)
+ elseif(UHD_GIT_BRANCH STREQUAL "master")
+ message(STATUS "Operating on master branch.")
+ set(UHD_VERSION_DEVEL TRUE)
+ else()
+ message(STATUS "Working off of feature or development branch. Updating version number.")
+ execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "print('${_git_branch}'.replace('/', '-'))"
OUTPUT_VARIABLE _git_safe_branch OUTPUT_STRIP_TRAILING_WHITESPACE
)
- SET(UHD_VERSION_PATCH ${_git_safe_branch})
- SET(UHD_VERSION_DEVEL TRUE)
- ENDIF()
- ELSE()
- MESSAGE(STATUS "Could not determine git branch. Probably building from tarball.")
- ENDIF()
-ELSE(GIT_FOUND)
- MESSAGE(WARNING "Could not detect git executable! Could not determine exact version of UHD!")
-ENDIF(GIT_FOUND)
-IF(DEFINED UHD_GIT_BRANCH_OVERRIDE)
- MESSAGE(STATUS "Overriding auto-detected git branch and setting to: ${UHD_GIT_BRANCH_OVERRIDE}")
- SET(UHD_GIT_BRANCH ${UHD_GIT_BRANCH_OVERRIDE})
-ENDIF(DEFINED UHD_GIT_BRANCH_OVERRIDE)
+ set(UHD_VERSION_PATCH ${_git_safe_branch})
+ set(UHD_VERSION_DEVEL TRUE)
+ endif()
+ else()
+ message(STATUS "Could not determine git branch. Probably building from tarball.")
+ endif()
+else(GIT_FOUND)
+ message(WARNING "Could not detect git executable! Could not determine exact version of UHD!")
+endif(GIT_FOUND)
+if(DEFINED UHD_GIT_BRANCH_OVERRIDE)
+ message(STATUS "Overriding auto-detected git branch and setting to: ${UHD_GIT_BRANCH_OVERRIDE}")
+ set(UHD_GIT_BRANCH ${UHD_GIT_BRANCH_OVERRIDE})
+endif(DEFINED UHD_GIT_BRANCH_OVERRIDE)
########################################################################
# Version information discovery through git log
########################################################################
#grab the git ref id for the current head
-EXECUTE_PROCESS(
+execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long
OUTPUT_VARIABLE _git_describe OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -82,9 +82,9 @@ EXECUTE_PROCESS(
)
#only set the build info on success
-IF(_git_describe_result EQUAL 0)
- IF(NOT UHD_GIT_COUNT)
- EXECUTE_PROCESS(
+if(_git_describe_result EQUAL 0)
+ if(NOT UHD_GIT_COUNT)
+ execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE} -c "
try:
@@ -94,9 +94,9 @@ except IndexError:
"
OUTPUT_VARIABLE UHD_GIT_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE
)
- ENDIF()
- IF(NOT UHD_GIT_HASH)
- EXECUTE_PROCESS(
+ endif()
+ if(NOT UHD_GIT_HASH)
+ execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE} -c "
try:
@@ -106,42 +106,42 @@ except IndexError:
"
OUTPUT_VARIABLE UHD_GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE
)
- ENDIF()
-ENDIF()
+ endif()
+endif()
## Set default values if all fails. Make sure they're identical to the ones above.
-IF(NOT UHD_GIT_COUNT)
- SET(UHD_GIT_COUNT "0")
-ENDIF()
+if(NOT UHD_GIT_COUNT)
+ set(UHD_GIT_COUNT "0")
+endif()
-IF(NOT UHD_GIT_HASH)
- SET(UHD_GIT_HASH "unknown")
-ENDIF()
+if(NOT UHD_GIT_HASH)
+ set(UHD_GIT_HASH "unknown")
+endif()
-IF(UHD_RELEASE_MODE)
- SET(UHD_GIT_HASH ${UHD_RELEASE_MODE})
+if(UHD_RELEASE_MODE)
+ set(UHD_GIT_HASH ${UHD_RELEASE_MODE})
#Ignore UHD_GIT_COUNT in UHD_VERSION if the string 'release' is in UHD_RELEASE_MODE
- EXECUTE_PROCESS(
+ execute_process(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE} -c "print ('release' in '${UHD_RELEASE_MODE}') or ('rc' in '${UHD_RELEASE_MODE}')"
OUTPUT_VARIABLE TRIM_UHD_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
)
-ENDIF()
+endif()
########################################################################
# Define the derived version variables:
-IF(DEFINED UHD_VERSION)
- SET(UHD_VERSION "${UHD_VERSION}" CACHE STRING "Set UHD_VERSION to a custom value")
-ELSEIF(TRIM_UHD_VERSION STREQUAL "True")
- SET(UHD_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}.${UHD_VERSION_PATCH}-${UHD_GIT_HASH}")
-ELSE()
- SET(UHD_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}.${UHD_VERSION_PATCH}-${UHD_GIT_COUNT}-${UHD_GIT_HASH}")
-ENDIF()
-IF(DEFINED UHD_ABI_VERSION)
- SET(UHD_ABI_VERSION "${UHD_ABI_VERSION}"
+if(DEFINED UHD_VERSION)
+ set(UHD_VERSION "${UHD_VERSION}" CACHE STRING "Set UHD_VERSION to a custom value")
+elseif(TRIM_UHD_VERSION STREQUAL "True")
+ set(UHD_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}.${UHD_VERSION_PATCH}-${UHD_GIT_HASH}")
+else()
+ set(UHD_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}.${UHD_VERSION_PATCH}-${UHD_GIT_COUNT}-${UHD_GIT_HASH}")
+endif()
+if(DEFINED UHD_ABI_VERSION)
+ set(UHD_ABI_VERSION "${UHD_ABI_VERSION}"
CACHE STRING "Set UHD_ABI_VERSION to a custom value")
-ELSE()
- SET(UHD_ABI_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}")
-ENDIF()
+else()
+ set(UHD_ABI_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_API}.${UHD_VERSION_ABI}")
+endif()
diff --git a/host/cmake/Toolchains/mingw_cross.cmake b/host/cmake/Toolchains/mingw_cross.cmake
index f1406ec46..264e1a597 100644
--- a/host/cmake/Toolchains/mingw_cross.cmake
+++ b/host/cmake/Toolchains/mingw_cross.cmake
@@ -3,10 +3,10 @@
# most likely default if none given.
#
-SET(CMAKE_SYSTEM_NAME Windows)
+set(CMAKE_SYSTEM_NAME Windows)
-IF(NOT DEFINED MINGW_PREFIX)
- SET(POSSIBLE_PREFIXES
+if(NOT DEFINED MINGW_PREFIX)
+ set(POSSIBLE_PREFIXES
i586-mingw32msvc
i686-pc-mingw32
x86_64-pc-mingw32
@@ -14,36 +14,36 @@ IF(NOT DEFINED MINGW_PREFIX)
x86_64-w64-mingw32
)
- SET(MINGW_FOUND 0)
- FOREACH(prefix ${POSSIBLE_PREFIXES})
- IF(EXISTS /usr/${prefix})
- SET(MINGW_PREFIX ${prefix})
- SET(MINGW_FOUND 1)
- BREAK()
- ENDIF(EXISTS /usr/${prefix})
- ENDFOREACH(prefix ${POSSIBLE_PREFIXES})
+ set(MINGW_FOUND 0)
+ foreach(prefix ${POSSIBLE_PREFIXES})
+ if(EXISTS /usr/${prefix})
+ set(MINGW_PREFIX ${prefix})
+ set(MINGW_FOUND 1)
+ break()
+ endif(EXISTS /usr/${prefix})
+ endforeach(prefix ${POSSIBLE_PREFIXES})
- IF(NOT MINGW_FOUND)
- MESSAGE(FATAL_ERROR "No MinGW type specified, but none detected in the usual locations.")
- ENDIF(NOT MINGW_FOUND)
-ENDIF(NOT DEFINED MINGW_PREFIX)
+ if(NOT MINGW_FOUND)
+ message(FATAL_ERROR "No MinGW type specified, but none detected in the usual locations.")
+ endif(NOT MINGW_FOUND)
+endif(NOT DEFINED MINGW_PREFIX)
-SET(MINGW_PREFIX ${MINGW_PREFIX} CACHE STRING "MinGW prefix")
+set(MINGW_PREFIX ${MINGW_PREFIX} CACHE STRING "MinGW prefix")
-SET(CMAKE_C_COMPILER ${MINGW_PREFIX}-gcc)
-SET(CMAKE_CXX_COMPILER ${MINGW_PREFIX}-g++)
-SET(CMAKE_RC_COMPILER ${MINGW_PREFIX}-windres)
+set(CMAKE_C_COMPILER ${MINGW_PREFIX}-gcc)
+set(CMAKE_CXX_COMPILER ${MINGW_PREFIX}-g++)
+set(CMAKE_RC_COMPILER ${MINGW_PREFIX}-windres)
-IF(NOT DEFINED CMAKE_FIND_ROOT_PATH)
- SET(CMAKE_FIND_ROOT_PATH /usr/${MINGW_PREFIX})
-ENDIF(NOT DEFINED CMAKE_FIND_ROOT_PATH)
+if(NOT DEFINED CMAKE_FIND_ROOT_PATH)
+ set(CMAKE_FIND_ROOT_PATH /usr/${MINGW_PREFIX})
+endif(NOT DEFINED CMAKE_FIND_ROOT_PATH)
-SET(CMAKE_INCLUDE_PATH
+set(CMAKE_INCLUDE_PATH
${CMAKE_FIND_ROOT_PATH}/local/include
${CMAKE_FIND_ROOT_PATH}/include
)
-SET(CMAKE_LIBRARY_PATH
+set(CMAKE_LIBRARY_PATH
${CMAKE_FIND_ROOT_PATH}/local/lib
${CMAKE_FIND_ROOT_PATH}/lib
)
diff --git a/host/cmake/cmake_uninstall.cmake.in b/host/cmake/cmake_uninstall.cmake.in
index b4d731a14..c22bb4a10 100644
--- a/host/cmake/cmake_uninstall.cmake.in
+++ b/host/cmake/cmake_uninstall.cmake.in
@@ -1,34 +1,34 @@
# http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
-IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
- MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
-ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
-FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
-STRING(REGEX REPLACE "\n" ";" files "${files}")
-FOREACH(file ${files})
- MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
- IF(EXISTS "$ENV{DESTDIR}${file}")
- EXEC_PROGRAM(
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+foreach(file ${files})
+ message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ if(EXISTS "$ENV{DESTDIR}${file}")
+ exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
- IF(NOT "${rm_retval}" STREQUAL 0)
- MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
- ENDIF(NOT "${rm_retval}" STREQUAL 0)
- ELSEIF(NOT "${CMAKE_VERSION}" STRLESS "2.8.1")
- IF(IS_SYMLINK "$ENV{DESTDIR}${file}")
- EXEC_PROGRAM(
+ if(NOT "${rm_retval}" STREQUAL 0)
+ message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ endif(NOT "${rm_retval}" STREQUAL 0)
+ elseif(NOT "${CMAKE_VERSION}" STRLESS "2.8.1")
+ if(IS_SYMLINK "$ENV{DESTDIR}${file}")
+ exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
- IF(NOT "${rm_retval}" STREQUAL 0)
- MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
- ENDIF(NOT "${rm_retval}" STREQUAL 0)
- ENDIF(IS_SYMLINK "$ENV{DESTDIR}${file}")
- ELSE(EXISTS "$ENV{DESTDIR}${file}")
- MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
- ENDIF(EXISTS "$ENV{DESTDIR}${file}")
-ENDFOREACH(file)
+ if(NOT "${rm_retval}" STREQUAL 0)
+ message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ endif(NOT "${rm_retval}" STREQUAL 0)
+ endif(IS_SYMLINK "$ENV{DESTDIR}${file}")
+ else(EXISTS "$ENV{DESTDIR}${file}")
+ message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ endif(EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
diff --git a/host/docs/CMakeLists.txt b/host/docs/CMakeLists.txt
index 8a9c8b7f4..c65bc2c0a 100644
--- a/host/docs/CMakeLists.txt
+++ b/host/docs/CMakeLists.txt
@@ -12,8 +12,8 @@
########################################################################
# Setup general Doxygen variables
########################################################################
-FIND_PACKAGE(Doxygen)
-SET(ENABLE_MANUAL_OR_DOXYGEN false)
+find_package(Doxygen)
+set(ENABLE_MANUAL_OR_DOXYGEN false)
########################################################################
# Setup Manual (using Doxygen)
@@ -26,102 +26,102 @@ LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "DOXYGEN_FOUND" OFF OFF)
# If no:
# - Make FPGA Manual reference link to our website
-IF(ENABLE_MANUAL)
- SET(ENABLE_MANUAL_OR_DOXYGEN true)
+if(ENABLE_MANUAL)
+ set(ENABLE_MANUAL_OR_DOXYGEN true)
# First: Set up UHD manual only
- FILE(GLOB manual_sources "*.dox")
- SET(DOXYGEN_DEPENDENCIES ${manual_sources})
- SET(DOXYGEN_INPUT_DIRS "${CMAKE_SOURCE_DIR}/docs ${CMAKE_CURRENT_BINARY_DIR}")
- SET(DOXYGEN_DEP_COMPONENT "manual")
- SET(DOXYGEN_FPGA_MANUAL_REFERENCE "<a href=\"http://files.ettus.com/manual/md_fpga.html\">Part III: FPGA Manual</a>")
- SET(DOXYGEN_STRIP_EXTRA "")
- SET(DOXYGEN_EXCLUDE_DIRS "")
- IF(NOT ENABLE_RFNOC)
- SET(DOXYGEN_EXCLUDE_DIRS "${DOXYGEN_EXCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include/uhd/rfnoc")
- ENDIF(NOT ENABLE_RFNOC)
+ file(GLOB manual_sources "*.dox")
+ set(DOXYGEN_DEPENDENCIES ${manual_sources})
+ set(DOXYGEN_INPUT_DIRS "${CMAKE_SOURCE_DIR}/docs ${CMAKE_CURRENT_BINARY_DIR}")
+ set(DOXYGEN_DEP_COMPONENT "manual")
+ set(DOXYGEN_FPGA_MANUAL_REFERENCE "<a href=\"http://files.ettus.com/manual/md_fpga.html\">Part III: FPGA Manual</a>")
+ set(DOXYGEN_STRIP_EXTRA "")
+ set(DOXYGEN_EXCLUDE_DIRS "")
+ if(NOT ENABLE_RFNOC)
+ set(DOXYGEN_EXCLUDE_DIRS "${DOXYGEN_EXCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/include/uhd/rfnoc")
+ endif(NOT ENABLE_RFNOC)
# Now, check if we have the FPGA sources as well.
# If so, pull them in:
- IF(HAS_FPGA_SUBMODULE)
- FILE(GLOB_RECURSE fpga_manual_sources "${FPGA_SUBMODULE_DIR}/docs/*.md")
- LIST(APPEND manual_sources ${fpga_manual_sources})
- SET(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${FPGA_SUBMODULE_DIR}/docs")
- SET(DOXYGEN_FPGA_MANUAL_REFERENCE "\\subpage md_fpga \"Part III: FPGA Manual\"")
- SET(DOXYGEN_STRIP_EXTRA "${FPGA_SUBMODULE_DIR}/docs")
- ENDIF(HAS_FPGA_SUBMODULE)
- CONFIGURE_FILE(
+ if(HAS_FPGA_SUBMODULE)
+ file(GLOB_RECURSE fpga_manual_sources "${FPGA_SUBMODULE_DIR}/docs/*.md")
+ list(APPEND manual_sources ${fpga_manual_sources})
+ set(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${FPGA_SUBMODULE_DIR}/docs")
+ set(DOXYGEN_FPGA_MANUAL_REFERENCE "\\subpage md_fpga \"Part III: FPGA Manual\"")
+ set(DOXYGEN_STRIP_EXTRA "${FPGA_SUBMODULE_DIR}/docs")
+ endif(HAS_FPGA_SUBMODULE)
+ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox.in
${CMAKE_CURRENT_BINARY_DIR}/mainpage.dox
@ONLY)
-ENDIF(ENABLE_MANUAL)
+endif(ENABLE_MANUAL)
########################################################################
# Setup API documentation (using Doxygen)
########################################################################
LIBUHD_REGISTER_COMPONENT("API/Doxygen" ENABLE_DOXYGEN ON "DOXYGEN_FOUND" OFF OFF)
-OPTION(ENABLE_DOXYGEN_FULL "Use Doxygen to document the entire source tree (not just API)" OFF)
-OPTION(ENABLE_DOXYGEN_DOT "Let Doxygen use dot (requires graphviz)" OFF)
-OPTION(ENABLE_DOXYGEN_SHORTNAMES "Let Doxygen use shorter filenames (helps on Windows)" OFF)
+option(ENABLE_DOXYGEN_FULL "Use Doxygen to document the entire source tree (not just API)" OFF)
+option(ENABLE_DOXYGEN_DOT "Let Doxygen use dot (requires graphviz)" OFF)
+option(ENABLE_DOXYGEN_SHORTNAMES "Let Doxygen use shorter filenames (helps on Windows)" OFF)
-IF(LIBUHDDEV_PKG)
- SET(PKG_DOC_DIR share/doc/libuhd-dev)
-ENDIF(LIBUHDDEV_PKG)
+if(LIBUHDDEV_PKG)
+ set(PKG_DOC_DIR share/doc/libuhd-dev)
+endif(LIBUHDDEV_PKG)
-IF(ENABLE_DOXYGEN)
- SET(ENABLE_MANUAL_OR_DOXYGEN true)
+if(ENABLE_DOXYGEN)
+ set(ENABLE_MANUAL_OR_DOXYGEN true)
#make doxygen directory depend on the header files
- FILE(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
- FILE(GLOB_RECURSE h_files ${CMAKE_SOURCE_DIR}/include/*.h)
- LIST(APPEND header_files ${h_files})
- SET(DOXYGEN_DEPENDENCIES ${DOXYGEN_DEPENDENCIES} ${header_files} "${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/gen_basic_funcs.py")
- IF(ENABLE_DOXYGEN_FULL)
- SET(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/python")
- ELSE(ENABLE_DOXYGEN_FULL)
- SET(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include")
- ENDIF(ENABLE_DOXYGEN_FULL)
-
- SET(DOXYGEN_DEP_COMPONENT "doxygen")
-ENDIF(ENABLE_DOXYGEN)
+ file(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
+ file(GLOB_RECURSE h_files ${CMAKE_SOURCE_DIR}/include/*.h)
+ list(APPEND header_files ${h_files})
+ set(DOXYGEN_DEPENDENCIES ${DOXYGEN_DEPENDENCIES} ${header_files} "${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/gen_basic_funcs.py")
+ if(ENABLE_DOXYGEN_FULL)
+ set(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/python")
+ else(ENABLE_DOXYGEN_FULL)
+ set(DOXYGEN_INPUT_DIRS "${DOXYGEN_INPUT_DIRS} ${CMAKE_SOURCE_DIR}/include")
+ endif(ENABLE_DOXYGEN_FULL)
+
+ set(DOXYGEN_DEP_COMPONENT "doxygen")
+endif(ENABLE_DOXYGEN)
########################################################################
# Run Doxygen (on code and/or manual, depending on CMake flags)
########################################################################
-IF(ENABLE_MANUAL_OR_DOXYGEN)
+if(ENABLE_MANUAL_OR_DOXYGEN)
#generate the doxygen configuration file
- SET(CMAKE_CURRENT_BINARY_DIR_DOXYGEN ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
- IF(ENABLE_DOXYGEN_DOT)
- SET(DOXYGEN_HAVE_DOT "YES")
- ELSE(ENABLE_DOXYGEN_DOT)
- SET(DOXYGEN_HAVE_DOT "NO")
- ENDIF(ENABLE_DOXYGEN_DOT)
- IF(ENABLE_DOXYGEN_SHORTNAMES)
- SET(DOXYGEN_SHORT_NAMES "YES")
- ELSE(ENABLE_DOXYGEN_SHORTNAMES)
- SET(DOXYGEN_SHORT_NAMES "NO")
- ENDIF(ENABLE_DOXYGEN_SHORTNAMES)
-
- CONFIGURE_FILE(
+ set(CMAKE_CURRENT_BINARY_DIR_DOXYGEN ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
+ if(ENABLE_DOXYGEN_DOT)
+ set(DOXYGEN_HAVE_DOT "YES")
+ else(ENABLE_DOXYGEN_DOT)
+ set(DOXYGEN_HAVE_DOT "NO")
+ endif(ENABLE_DOXYGEN_DOT)
+ if(ENABLE_DOXYGEN_SHORTNAMES)
+ set(DOXYGEN_SHORT_NAMES "YES")
+ else(ENABLE_DOXYGEN_SHORTNAMES)
+ set(DOXYGEN_SHORT_NAMES "NO")
+ endif(ENABLE_DOXYGEN_SHORTNAMES)
+
+ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
#make doxygen directory depend on the header files
- FILE(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
- ADD_CUSTOM_COMMAND(
+ file(GLOB_RECURSE header_files ${CMAKE_SOURCE_DIR}/include/*.hpp)
+ add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN} DEPENDS ${DOXYGEN_DEPENDENCIES}
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMENT "Generating documentation with doxygen"
)
#make the doxygen generation a built-time dependency
- ADD_CUSTOM_TARGET(doxygen_docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN})
+ add_custom_target(doxygen_docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN})
UHD_INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR_DOXYGEN} DESTINATION ${PKG_DOC_DIR} COMPONENT ${DOXYGEN_DEP_COMPONENT})
-ENDIF(ENABLE_MANUAL_OR_DOXYGEN)
+endif(ENABLE_MANUAL_OR_DOXYGEN)
########################################################################
# List of man page sources
########################################################################
-SET(man_page_sources
+set(man_page_sources
octoclock_firmware_burner.1
uhd_cal_rx_iq_balance.1
uhd_cal_tx_dc_offset.1
@@ -139,23 +139,23 @@ SET(man_page_sources
########################################################################
# Setup man pages
########################################################################
-FIND_PACKAGE(GZip)
+find_package(GZip)
# No elegant way in CMake to reverse a boolean
-IF(NOT WIN32)
- SET(NOT_WIN32 TRUE)
-ENDIF(NOT WIN32)
+if(NOT WIN32)
+ set(NOT_WIN32 TRUE)
+endif(NOT WIN32)
LIBUHD_REGISTER_COMPONENT("Man Pages" ENABLE_MAN_PAGES ON "GZIP_FOUND;NOT_WIN32" OFF OFF)
-IF(ENABLE_MAN_PAGES)
+if(ENABLE_MAN_PAGES)
#Generate man pages
- FOREACH(manfile ${man_page_sources})
+ foreach(manfile ${man_page_sources})
#make the gzip file depend on the text file
- STRING(REPLACE ".1" "" PROGRAM_NAME "${manfile}")
- SET(gzfile "${CMAKE_CURRENT_BINARY_DIR}/${manfile}.gz")
- SET(manfile "${CMAKE_CURRENT_SOURCE_DIR}/${manfile}")
- ADD_CUSTOM_COMMAND(
+ string(REPLACE ".1" "" PROGRAM_NAME "${manfile}")
+ set(gzfile "${CMAKE_CURRENT_BINARY_DIR}/${manfile}.gz")
+ set(manfile "${CMAKE_CURRENT_SOURCE_DIR}/${manfile}")
+ add_custom_command(
OUTPUT ${gzfile}
DEPENDS ${manfile}
COMMAND ${GZIP_EXECUTABLE} -9 -cf ${manfile} > ${gzfile}
@@ -163,10 +163,10 @@ IF(ENABLE_MAN_PAGES)
)
#make the man page target depend on the gz file
- LIST(APPEND man_page_gz_files ${gzfile})
+ list(APPEND man_page_gz_files ${gzfile})
UHD_INSTALL(FILES ${gzfile} DESTINATION ${PKG_MAN_DIR} COMPONENT manpages)
- ENDFOREACH(manfile ${man_page_sources})
+ endforeach(manfile ${man_page_sources})
#make the man pages a build-time dependency
- ADD_CUSTOM_TARGET(man_page_gzips ALL DEPENDS ${man_page_gz_files})
-ENDIF(ENABLE_MAN_PAGES)
+ add_custom_target(man_page_gzips ALL DEPENDS ${man_page_gz_files})
+endif(ENABLE_MAN_PAGES)
diff --git a/host/examples/CMakeLists.txt b/host/examples/CMakeLists.txt
index 8ebf2cc09..3d4e064bd 100644
--- a/host/examples/CMakeLists.txt
+++ b/host/examples/CMakeLists.txt
@@ -8,7 +8,7 @@
########################################################################
# example applications
########################################################################
-SET(example_sources
+set(example_sources
benchmark_rate.cpp
network_relay.cpp
rx_multi_samples.cpp
@@ -30,52 +30,52 @@ SET(example_sources
sync_to_gps.cpp
)
-IF(ENABLE_RFNOC)
- LIST(APPEND
+if(ENABLE_RFNOC)
+ list(APPEND
example_sources
rfnoc_nullsource_ce_rx.cpp
rfnoc_rx_to_file.cpp
rfnoc_radio_loopback.cpp
benchmark_streamer.cpp
)
-ENDIF(ENABLE_RFNOC)
+endif(ENABLE_RFNOC)
-IF(ENABLE_OCTOCLOCK)
- LIST(APPEND example_sources test_clock_synch.cpp)
-ENDIF(ENABLE_OCTOCLOCK)
+if(ENABLE_OCTOCLOCK)
+ list(APPEND example_sources test_clock_synch.cpp)
+endif(ENABLE_OCTOCLOCK)
#for each source: build an executable and install
-FOREACH(example_source ${example_sources})
- GET_FILENAME_COMPONENT(example_name ${example_source} NAME_WE)
- ADD_EXECUTABLE(${example_name} ${example_source})
- TARGET_LINK_LIBRARIES(${example_name} uhd ${Boost_LIBRARIES})
+foreach(example_source ${example_sources})
+ get_filename_component(example_name ${example_source} NAME_WE)
+ add_executable(${example_name} ${example_source})
+ target_link_libraries(${example_name} uhd ${Boost_LIBRARIES})
UHD_INSTALL(TARGETS ${example_name} RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples)
-ENDFOREACH(example_source)
+endforeach(example_source)
########################################################################
# ASCII Art DFT - requires curses, so this part is optional
########################################################################
-FIND_PACKAGE(Curses)
+find_package(Curses)
-IF(CURSES_FOUND)
- INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR})
- ADD_EXECUTABLE(rx_ascii_art_dft rx_ascii_art_dft.cpp)
- TARGET_LINK_LIBRARIES(rx_ascii_art_dft uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES})
+if(CURSES_FOUND)
+ include_directories(${CURSES_INCLUDE_DIR})
+ add_executable(rx_ascii_art_dft rx_ascii_art_dft.cpp)
+ target_link_libraries(rx_ascii_art_dft uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES})
UHD_INSTALL(TARGETS rx_ascii_art_dft RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples)
- ADD_EXECUTABLE(twinrx_freq_hopping twinrx_freq_hopping.cpp)
- TARGET_LINK_LIBRARIES(twinrx_freq_hopping uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES})
+ add_executable(twinrx_freq_hopping twinrx_freq_hopping.cpp)
+ target_link_libraries(twinrx_freq_hopping uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES})
UHD_INSTALL(TARGETS twinrx_freq_hopping RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples)
-ENDIF(CURSES_FOUND)
+endif(CURSES_FOUND)
########################################################################
# Examples using C API
########################################################################
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
#
# Check if this particular C99 feature is available with this compiler
#
- INCLUDE(CheckCSourceCompiles)
+ include(CheckCSourceCompiles)
CHECK_C_SOURCE_COMPILES("
typedef struct {
int bar;
@@ -93,26 +93,26 @@ IF(ENABLE_C_API)
}
" HAVE_C99_STRUCTDECL)
- IF(HAVE_C99_STRUCTDECL)
- ADD_SUBDIRECTORY(getopt)
- INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/getopt)
+ if(HAVE_C99_STRUCTDECL)
+ add_subdirectory(getopt)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/getopt)
- SET(C_API_EXAMPLES
+ set(C_API_EXAMPLES
rx_samples_c
tx_samples_c
)
- FOREACH(example ${C_API_EXAMPLES})
- ADD_EXECUTABLE(${example} ${example}.c)
- TARGET_LINK_LIBRARIES(${example} uhd getopt)
- IF(UNIX)
- TARGET_LINK_LIBRARIES(${example} m)
- ENDIF(UNIX)
+ foreach(example ${C_API_EXAMPLES})
+ add_executable(${example} ${example}.c)
+ target_link_libraries(${example} uhd getopt)
+ if(UNIX)
+ target_link_libraries(${example} m)
+ endif(UNIX)
UHD_INSTALL(TARGETS ${example} RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples)
- ENDFOREACH(example ${C_API_EXAMPLES})
- ENDIF(HAVE_C99_STRUCTDECL)
-ENDIF(ENABLE_C_API)
+ endforeach(example ${C_API_EXAMPLES})
+ endif(HAVE_C99_STRUCTDECL)
+endif(ENABLE_C_API)
-IF(ENABLE_PYTHON_API)
- ADD_SUBDIRECTORY(python)
-ENDIF(ENABLE_PYTHON_API)
+if(ENABLE_PYTHON_API)
+ add_subdirectory(python)
+endif(ENABLE_PYTHON_API)
diff --git a/host/examples/getopt/CMakeLists.txt b/host/examples/getopt/CMakeLists.txt
index 047572108..4fe8ab43d 100644
--- a/host/examples/getopt/CMakeLists.txt
+++ b/host/examples/getopt/CMakeLists.txt
@@ -8,7 +8,7 @@
########################################################################
# getopt library for C examples since MSVC does not include it
########################################################################
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIRECTORY})
-ADD_LIBRARY(getopt STATIC
+include_directories(${CMAKE_CURRENT_SOURCE_DIRECTORY})
+add_library(getopt STATIC
${CMAKE_CURRENT_SOURCE_DIR}/getopt.c
)
diff --git a/host/examples/init_usrp/CMakeLists.txt b/host/examples/init_usrp/CMakeLists.txt
index ccbe3a1e3..9cc835442 100644
--- a/host/examples/init_usrp/CMakeLists.txt
+++ b/host/examples/init_usrp/CMakeLists.txt
@@ -36,24 +36,24 @@ find_package(UHD "3.8.0" REQUIRED)
#find_package(UHD 3.8.1 EXACT REQUIRED)
### Configure Compiler ########################################################
-IF(CMAKE_VERSION VERSION_LESS "3.1")
- IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
- SET(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
- ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
- IF("${IS_APPLE}" STREQUAL "")
- SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
- ELSE()
- SET(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
- ENDIF()
- ENDIF()
-ELSE()
- SET(CMAKE_CXX_STANDARD 11)
-ENDIF()
+if(CMAKE_VERSION VERSION_LESS "3.1")
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+ set(CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
+ elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ if("${IS_APPLE}" STREQUAL "")
+ set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
+ else()
+ set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
+ endif()
+ endif()
+else()
+ set(CMAKE_CXX_STANDARD 11)
+endif()
-IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
- SET(CMAKE_EXE_LINKER_FLAGS "-lthr ${CMAKE_EXE_LINKER_FLAGS}")
- SET(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
-ENDIF()
+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ set(CMAKE_EXE_LINKER_FLAGS "-lthr ${CMAKE_EXE_LINKER_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
+endif()
include_directories(
${Boost_INCLUDE_DIRS}
@@ -64,13 +64,13 @@ link_directories(${Boost_LIBRARY_DIRS})
### Make the executable #######################################################
add_executable(init_usrp init_usrp.cpp)
-SET(CMAKE_BUILD_TYPE "Release")
-MESSAGE(STATUS "******************************************************************************")
-MESSAGE(STATUS "* NOTE: When building your own app, you probably need all kinds of different ")
-MESSAGE(STATUS "* compiler flags. This is just an example, so it's unlikely these settings ")
-MESSAGE(STATUS "* exactly match what you require. Make sure to double-check compiler and ")
-MESSAGE(STATUS "* linker flags to make sure your specific requirements are included. ")
-MESSAGE(STATUS "******************************************************************************")
+set(CMAKE_BUILD_TYPE "Release")
+message(STATUS "******************************************************************************")
+message(STATUS "* NOTE: When building your own app, you probably need all kinds of different ")
+message(STATUS "* compiler flags. This is just an example, so it's unlikely these settings ")
+message(STATUS "* exactly match what you require. Make sure to double-check compiler and ")
+message(STATUS "* linker flags to make sure your specific requirements are included. ")
+message(STATUS "******************************************************************************")
# Shared library case: All we need to do is link against the library, and
# anything else we need (in this case, some Boost libraries):
diff --git a/host/examples/python/CMakeLists.txt b/host/examples/python/CMakeLists.txt
index 758a69af1..23d1b83c6 100644
--- a/host/examples/python/CMakeLists.txt
+++ b/host/examples/python/CMakeLists.txt
@@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
-SET(python_examples
+set(python_examples
rx_to_file.py
tx_waveforms.py
curses_fft.py
diff --git a/host/include/CMakeLists.txt b/host/include/CMakeLists.txt
index 0efed9785..f46870dc2 100644
--- a/host/include/CMakeLists.txt
+++ b/host/include/CMakeLists.txt
@@ -5,16 +5,16 @@
# SPDX-License-Identifier: GPL-3.0
#
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
UHD_INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/uhd.h
DESTINATION ${INCLUDE_DIR}
COMPONENT headers
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
-ADD_SUBDIRECTORY(uhd)
+add_subdirectory(uhd)
diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt
index e0599fd82..b184fb30d 100644
--- a/host/include/uhd/CMakeLists.txt
+++ b/host/include/uhd/CMakeLists.txt
@@ -5,15 +5,15 @@
# SPDX-License-Identifier: GPL-3.0
#
-ADD_SUBDIRECTORY(rfnoc)
-ADD_SUBDIRECTORY(transport)
-ADD_SUBDIRECTORY(types)
-ADD_SUBDIRECTORY(cal)
-ADD_SUBDIRECTORY(usrp)
-ADD_SUBDIRECTORY(usrp_clock)
-ADD_SUBDIRECTORY(utils)
+add_subdirectory(rfnoc)
+add_subdirectory(transport)
+add_subdirectory(types)
+add_subdirectory(cal)
+add_subdirectory(usrp)
+add_subdirectory(usrp_clock)
+add_subdirectory(utils)
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/version.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/version.hpp
)
@@ -33,19 +33,19 @@ UHD_INSTALL(FILES
COMPONENT headers
)
-IF(ENABLE_RFNOC)
+if(ENABLE_RFNOC)
UHD_INSTALL(FILES
device3.hpp
DESTINATION ${INCLUDE_DIR}/uhd
COMPONENT headers
)
-ENDIF(ENABLE_RFNOC)
+endif(ENABLE_RFNOC)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
UHD_INSTALL(FILES
config.h
error.h
DESTINATION ${INCLUDE_DIR}/uhd
COMPONENT headers
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
diff --git a/host/include/uhd/rfnoc/CMakeLists.txt b/host/include/uhd/rfnoc/CMakeLists.txt
index 981a32c98..67b629acb 100644
--- a/host/include/uhd/rfnoc/CMakeLists.txt
+++ b/host/include/uhd/rfnoc/CMakeLists.txt
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-3.0
#
-IF(ENABLE_RFNOC)
+if(ENABLE_RFNOC)
UHD_INSTALL(FILES
# Infrastructure
block_ctrl_base.hpp
@@ -38,8 +38,8 @@ IF(ENABLE_RFNOC)
DESTINATION ${INCLUDE_DIR}/uhd/rfnoc
COMPONENT headers
)
-ENDIF(ENABLE_RFNOC)
+endif(ENABLE_RFNOC)
-ADD_SUBDIRECTORY(blocks)
-#ADD_SUBDIRECTORY(components)
+add_subdirectory(blocks)
+#add_subdirectory(components)
diff --git a/host/include/uhd/rfnoc/blocks/CMakeLists.txt b/host/include/uhd/rfnoc/blocks/CMakeLists.txt
index 027b6eb53..d694517c6 100644
--- a/host/include/uhd/rfnoc/blocks/CMakeLists.txt
+++ b/host/include/uhd/rfnoc/blocks/CMakeLists.txt
@@ -5,7 +5,7 @@
# SPDX-License-Identifier: GPL-3.0
#
-FILE(GLOB xml_files "*.xml")
+file(GLOB xml_files "*.xml")
# We always need this, even when RFNoC is 'disabled'
UHD_INSTALL(
diff --git a/host/include/uhd/types/CMakeLists.txt b/host/include/uhd/types/CMakeLists.txt
index d9f28b08c..516459e01 100644
--- a/host/include/uhd/types/CMakeLists.txt
+++ b/host/include/uhd/types/CMakeLists.txt
@@ -33,7 +33,7 @@ UHD_INSTALL(FILES
COMPONENT headers
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
UHD_INSTALL(FILES
metadata.h
ranges.h
@@ -45,4 +45,4 @@ IF(ENABLE_C_API)
DESTINATION ${INCLUDE_DIR}/uhd/types
COMPONENT headers
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
diff --git a/host/include/uhd/usrp/CMakeLists.txt b/host/include/uhd/usrp/CMakeLists.txt
index abc159d8f..2c80ed59f 100644
--- a/host/include/uhd/usrp/CMakeLists.txt
+++ b/host/include/uhd/usrp/CMakeLists.txt
@@ -28,7 +28,7 @@ UHD_INSTALL(FILES
COMPONENT headers
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
UHD_INSTALL(FILES
dboard_eeprom.h
mboard_eeprom.h
@@ -37,4 +37,4 @@ IF(ENABLE_C_API)
DESTINATION ${INCLUDE_DIR}/uhd/usrp
COMPONENT headers
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
diff --git a/host/include/uhd/usrp_clock/CMakeLists.txt b/host/include/uhd/usrp_clock/CMakeLists.txt
index 5bb2499b2..f45770d03 100644
--- a/host/include/uhd/usrp_clock/CMakeLists.txt
+++ b/host/include/uhd/usrp_clock/CMakeLists.txt
@@ -12,10 +12,10 @@ UHD_INSTALL(FILES
COMPONENT headers
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
UHD_INSTALL(FILES
usrp_clock.h
DESTINATION ${INCLUDE_DIR}/uhd/usrp_clock
COMPONENT headers
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
diff --git a/host/include/uhd/utils/CMakeLists.txt b/host/include/uhd/utils/CMakeLists.txt
index 9c2fed964..7f45df1d3 100644
--- a/host/include/uhd/utils/CMakeLists.txt
+++ b/host/include/uhd/utils/CMakeLists.txt
@@ -33,11 +33,11 @@ UHD_INSTALL(FILES
COMPONENT headers
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
UHD_INSTALL(FILES
thread_priority.h
log.h
DESTINATION ${INCLUDE_DIR}/uhd/utils
COMPONENT headers
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt
index 0645a1a32..ebe518842 100644
--- a/host/lib/CMakeLists.txt
+++ b/host/lib/CMakeLists.txt
@@ -8,21 +8,21 @@
########################################################################
# Helpful Macros
########################################################################
-MACRO(LIBUHD_APPEND_SOURCES)
- LIST(APPEND libuhd_sources ${ARGV})
-ENDMACRO(LIBUHD_APPEND_SOURCES)
+macro(LIBUHD_APPEND_SOURCES)
+ list(APPEND libuhd_sources ${ARGV})
+endmacro(LIBUHD_APPEND_SOURCES)
-MACRO(LIBUHD_APPEND_LIBS)
- LIST(APPEND libuhd_libs ${ARGV})
-ENDMACRO(LIBUHD_APPEND_LIBS)
+macro(LIBUHD_APPEND_LIBS)
+ list(APPEND libuhd_libs ${ARGV})
+endmacro(LIBUHD_APPEND_LIBS)
-MACRO(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile)
+macro(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile)
#ensure that the directory exists for outfile
- GET_FILENAME_COMPONENT(outfile_dir ${outfile} PATH)
- FILE(MAKE_DIRECTORY ${outfile_dir})
+ get_filename_component(outfile_dir ${outfile} PATH)
+ file(MAKE_DIRECTORY ${outfile_dir})
#make the outfile depend on the python script
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${outfile} DEPENDS ${pyfile} ${LIBUHD_PYTHON_GEN_SOURCE_DEPS}
COMMAND ${PYTHON_EXECUTABLE} -B ${pyfile} ${outfile}
COMMENT "Generating ${outfile}"
@@ -30,39 +30,39 @@ MACRO(LIBUHD_PYTHON_GEN_SOURCE pyfile outfile)
#make libuhd depend on the outfile
LIBUHD_APPEND_SOURCES(${outfile})
-ENDMACRO(LIBUHD_PYTHON_GEN_SOURCE)
+endmacro(LIBUHD_PYTHON_GEN_SOURCE)
-MACRO(INCLUDE_SUBDIRECTORY subdir)
+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})
+ 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})
+ 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)
+ 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)
+ 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)
+ list(REMOVE_AT _cmake_source_dirs 0)
+ list(REMOVE_AT _cmake_binary_dirs 0)
+endmacro(INCLUDE_SUBDIRECTORY)
########################################################################
# Register lower level components
########################################################################
-MESSAGE(STATUS "")
+message(STATUS "")
# Dependencies
-FIND_PACKAGE(USB1)
-FIND_PACKAGE(GPSD)
-FIND_PACKAGE(LIBERIO)
-FIND_PACKAGE(DPDK)
+find_package(USB1)
+find_package(GPSD)
+find_package(LIBERIO)
+find_package(DPDK)
LIBUHD_REGISTER_COMPONENT("LIBERIO" ENABLE_LIBERIO ON "ENABLE_LIBUHD;LIBERIO_FOUND" OFF OFF)
LIBUHD_REGISTER_COMPONENT("USB" ENABLE_USB ON "ENABLE_LIBUHD;LIBUSB_FOUND" OFF OFF)
LIBUHD_REGISTER_COMPONENT("GPSD" ENABLE_GPSD OFF "ENABLE_LIBUHD;ENABLE_GPSD;LIBGPS_FOUND" OFF OFF)
@@ -99,9 +99,9 @@ INCLUDE_SUBDIRECTORY(transport)
########################################################################
# Build info
########################################################################
-INCLUDE(UHDBuildInfo)
+include(UHDBuildInfo)
UHD_LOAD_BUILD_INFO()
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/build_info.cpp
${CMAKE_CURRENT_BINARY_DIR}/build_info.cpp
@ONLY)
@@ -109,7 +109,7 @@ CONFIGURE_FILE(
########################################################################
# Setup UHD_VERSION_STRING for version.cpp
########################################################################
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/version.cpp
${CMAKE_CURRENT_BINARY_DIR}/version.cpp
@ONLY)
@@ -129,80 +129,80 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_BINARY_DIR}/version.cpp
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/error_c.cpp
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
########################################################################
# Add DLL resource file to Windows build
########################################################################
-IF(MSVC)
- MATH(EXPR RC_VERSION_MAJOR_API "${UHD_VERSION_MAJOR} * 1000 + ${UHD_VERSION_API}")
- SET(RC_VERSION_PATCH ${UHD_VERSION_PATCH})
- IF(UHD_VERSION_DEVEL)
- SET(RC_VERSION_PATCH "999")
- ENDIF(UHD_VERSION_DEVEL)
+if(MSVC)
+ math(EXPR RC_VERSION_MAJOR_API "${UHD_VERSION_MAJOR} * 1000 + ${UHD_VERSION_API}")
+ set(RC_VERSION_PATCH ${UHD_VERSION_PATCH})
+ if(UHD_VERSION_DEVEL)
+ set(RC_VERSION_PATCH "999")
+ endif(UHD_VERSION_DEVEL)
# Allow a custom .rc template file to be used
- IF(CUSTOM_RC_FILE)
- IF(IS_ABSOLUTE "${CUSTOM_RC_FILE}")
- SET(UHD_RC_IN "${CUSTOM_RC_FILE}")
- ELSE()
- SET(UHD_RC_IN "${CMAKE_BINARY_DIR}/${CUSTOM_RC_FILE}")
- ENDIF(IS_ABSOLUTE "${CUSTOM_RC_FILE}")
- MESSAGE(STATUS "")
- MESSAGE(STATUS "Using custom RC template: ${UHD_RC_IN}")
- MESSAGE(STATUS "")
- ELSE()
- SET(UHD_RC_IN "${CMAKE_CURRENT_SOURCE_DIR}/uhd.rc.in")
- ENDIF(CUSTOM_RC_FILE)
- SET(UHD_RC_IN ${UHD_RC_IN} CACHE STRING "uhd.rc template filepath")
-
- CONFIGURE_FILE(
+ if(CUSTOM_RC_FILE)
+ if(IS_ABSOLUTE "${CUSTOM_RC_FILE}")
+ set(UHD_RC_IN "${CUSTOM_RC_FILE}")
+ else()
+ set(UHD_RC_IN "${CMAKE_BINARY_DIR}/${CUSTOM_RC_FILE}")
+ endif(IS_ABSOLUTE "${CUSTOM_RC_FILE}")
+ message(STATUS "")
+ message(STATUS "Using custom RC template: ${UHD_RC_IN}")
+ message(STATUS "")
+ else()
+ set(UHD_RC_IN "${CMAKE_CURRENT_SOURCE_DIR}/uhd.rc.in")
+ endif(CUSTOM_RC_FILE)
+ set(UHD_RC_IN ${UHD_RC_IN} CACHE STRING "uhd.rc template filepath")
+
+ configure_file(
${UHD_RC_IN}
${CMAKE_CURRENT_BINARY_DIR}/uhd.rc
@ONLY)
- LIST(APPEND libuhd_sources ${CMAKE_CURRENT_BINARY_DIR}/uhd.rc)
-ENDIF(MSVC)
+ list(APPEND libuhd_sources ${CMAKE_CURRENT_BINARY_DIR}/uhd.rc)
+endif(MSVC)
########################################################################
# Setup libuhd library
########################################################################
-IF(ENABLE_MPMD)
- INCLUDE_DIRECTORIES(deps/rpclib/include)
- ADD_SUBDIRECTORY(deps)
- LIST(APPEND libuhd_sources $<TARGET_OBJECTS:uhd_rpclib>)
-ENDIF()
-ADD_LIBRARY(uhd SHARED ${libuhd_sources})
-TARGET_LINK_LIBRARIES(uhd ${Boost_LIBRARIES} ${libuhd_libs})
-SET_TARGET_PROPERTIES(uhd PROPERTIES DEFINE_SYMBOL "UHD_DLL_EXPORTS")
-IF(NOT LIBUHDDEV_PKG)
- SET_TARGET_PROPERTIES(uhd PROPERTIES SOVERSION "${UHD_ABI_VERSION}")
- SET_TARGET_PROPERTIES(uhd PROPERTIES VERSION "${UHD_ABI_VERSION}")
-ENDIF(NOT LIBUHDDEV_PKG)
-IF(DEFINED LIBUHD_OUTPUT_NAME)
- SET_TARGET_PROPERTIES(uhd PROPERTIES OUTPUT_NAME ${LIBUHD_OUTPUT_NAME})
-ENDIF(DEFINED LIBUHD_OUTPUT_NAME)
-
-IF(NOT UHDHOST_PKG) #Syntax makes it unusable by UHD_INSTALL
- INSTALL(TARGETS uhd
+if(ENABLE_MPMD)
+ include_directories(deps/rpclib/include)
+ add_subdirectory(deps)
+ list(APPEND libuhd_sources $<TARGET_OBJECTS:uhd_rpclib>)
+endif()
+add_library(uhd SHARED ${libuhd_sources})
+target_link_libraries(uhd ${Boost_LIBRARIES} ${libuhd_libs})
+set_target_properties(uhd PROPERTIES DEFINE_SYMBOL "UHD_DLL_EXPORTS")
+if(NOT LIBUHDDEV_PKG)
+ set_target_properties(uhd PROPERTIES SOVERSION "${UHD_ABI_VERSION}")
+ set_target_properties(uhd PROPERTIES VERSION "${UHD_ABI_VERSION}")
+endif(NOT LIBUHDDEV_PKG)
+if(DEFINED LIBUHD_OUTPUT_NAME)
+ set_target_properties(uhd PROPERTIES OUTPUT_NAME ${LIBUHD_OUTPUT_NAME})
+endif(DEFINED LIBUHD_OUTPUT_NAME)
+
+if(NOT UHDHOST_PKG) #Syntax makes it unusable by UHD_INSTALL
+ install(TARGETS uhd
LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT libraries # .so file
ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT libraries # .lib file
RUNTIME DESTINATION ${RUNTIME_DIR} COMPONENT libraries # .dll file
)
-ENDIF(NOT UHDHOST_PKG)
+endif(NOT UHDHOST_PKG)
#######################################################
# Setup libuhd library (static)
#######################################################
-IF(ENABLE_STATIC_LIBS)
- ADD_LIBRARY(uhd_static STATIC ${libuhd_sources})
- SET_TARGET_PROPERTIES(uhd_static PROPERTIES OUTPUT_NAME uhd)
- SET_TARGET_PROPERTIES(uhd_static PROPERTIES COMPILE_DEFINITIONS UHD_STATIC_LIB)
- INSTALL(TARGETS uhd_static
+if(ENABLE_STATIC_LIBS)
+ add_library(uhd_static STATIC ${libuhd_sources})
+ set_target_properties(uhd_static PROPERTIES OUTPUT_NAME uhd)
+ set_target_properties(uhd_static PROPERTIES COMPILE_DEFINITIONS UHD_STATIC_LIB)
+ install(TARGETS uhd_static
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib or .a file
)
-ENDIF(ENABLE_STATIC_LIBS)
+endif(ENABLE_STATIC_LIBS)
diff --git a/host/lib/cal/CMakeLists.txt b/host/lib/cal/CMakeLists.txt
index db15334a4..a66f16aa7 100644
--- a/host/lib/cal/CMakeLists.txt
+++ b/host/lib/cal/CMakeLists.txt
@@ -8,14 +8,14 @@
########################################################################
# This file included, use CMake directory variables
########################################################################
-INCLUDE(CheckIncludeFileCXX)
-MESSAGE(STATUS "")
+include(CheckIncludeFileCXX)
+message(STATUS "")
########################################################################
# Convert types generation
########################################################################
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/power_container_impl.cpp
diff --git a/host/lib/convert/CMakeLists.txt b/host/lib/convert/CMakeLists.txt
index 82d1e51f2..5034e2850 100644
--- a/host/lib/convert/CMakeLists.txt
+++ b/host/lib/convert/CMakeLists.txt
@@ -8,31 +8,31 @@
########################################################################
# This file included, use CMake directory variables
########################################################################
-INCLUDE(CheckIncludeFileCXX)
-MESSAGE(STATUS "")
+include(CheckIncludeFileCXX)
+message(STATUS "")
########################################################################
# Check for SSE2 SIMD headers
########################################################################
-IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(EMMINTRIN_FLAGS -msse2)
- SET(TMMINTRIN_FLAGS -mssse3)
-ELSEIF(MSVC)
- SET(EMMINTRIN_FLAGS /arch:SSE2)
-ENDIF()
+if(CMAKE_COMPILER_IS_GNUCXX)
+ set(EMMINTRIN_FLAGS -msse2)
+ set(TMMINTRIN_FLAGS -mssse3)
+elseif(MSVC)
+ set(EMMINTRIN_FLAGS /arch:SSE2)
+endif()
-SET(CMAKE_REQUIRED_FLAGS ${EMMINTRIN_FLAGS})
+set(CMAKE_REQUIRED_FLAGS ${EMMINTRIN_FLAGS})
CHECK_INCLUDE_FILE_CXX(emmintrin.h HAVE_EMMINTRIN_H)
-SET(CMAKE_REQUIRED_FLAGS)
+set(CMAKE_REQUIRED_FLAGS)
-IF(ENABLE_SSSE3)
-SET(CMAKE_REQUIRED_FLAGS ${TMMINTRIN_FLAGS})
+if(ENABLE_SSSE3)
+set(CMAKE_REQUIRED_FLAGS ${TMMINTRIN_FLAGS})
CHECK_INCLUDE_FILE_CXX(tmmintrin.h HAVE_TMMINTRIN_H)
-SET(CMAKE_REQUIRED_FLAGS)
-ENDIF(ENABLE_SSSE3)
+set(CMAKE_REQUIRED_FLAGS)
+endif(ENABLE_SSSE3)
-IF(HAVE_EMMINTRIN_H)
- SET(convert_with_sse2_sources
+if(HAVE_EMMINTRIN_H)
+ set(convert_with_sse2_sources
${CMAKE_CURRENT_SOURCE_DIR}/sse2_sc16_to_sc16.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sse2_sc16_to_fc64.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sse2_sc16_to_fc32.cpp
@@ -43,50 +43,50 @@ IF(HAVE_EMMINTRIN_H)
${CMAKE_CURRENT_SOURCE_DIR}/sse2_fc64_to_sc8.cpp
${CMAKE_CURRENT_SOURCE_DIR}/sse2_fc32_to_sc8.cpp
)
- SET_SOURCE_FILES_PROPERTIES(
+ set_source_files_properties(
${convert_with_sse2_sources}
PROPERTIES COMPILE_FLAGS "${EMMINTRIN_FLAGS}"
)
LIBUHD_APPEND_SOURCES(${convert_with_sse2_sources})
-ENDIF(HAVE_EMMINTRIN_H)
+endif(HAVE_EMMINTRIN_H)
-IF(HAVE_TMMINTRIN_H)
- SET(convert_with_ssse3_sources
+if(HAVE_TMMINTRIN_H)
+ set(convert_with_ssse3_sources
${CMAKE_CURRENT_SOURCE_DIR}/ssse3_pack_sc12.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ssse3_unpack_sc12.cpp
)
- SET_SOURCE_FILES_PROPERTIES(
+ set_source_files_properties(
${convert_with_ssse3_sources}
PROPERTIES COMPILE_FLAGS "${TMMINTRIN_FLAGS}"
)
LIBUHD_APPEND_SOURCES(${convert_with_ssse3_sources})
-ENDIF(HAVE_TMMINTRIN_H)
+endif(HAVE_TMMINTRIN_H)
########################################################################
# Check for NEON SIMD headers
########################################################################
-SET(NEON_SIMD_ENABLE ON CACHE BOOL
+set(NEON_SIMD_ENABLE ON CACHE BOOL
"Use NEON SIMD instructions, if applicable")
-MARK_AS_ADVANCED(NEON_SIMD_ENABLE)
-IF(CMAKE_COMPILER_IS_GNUCXX)
+mark_as_advanced(NEON_SIMD_ENABLE)
+if(CMAKE_COMPILER_IS_GNUCXX)
CHECK_INCLUDE_FILE_CXX(arm_neon.h HAVE_ARM_NEON_H)
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+endif(CMAKE_COMPILER_IS_GNUCXX)
-IF(NEON_SIMD_ENABLE AND HAVE_ARM_NEON_H AND
+if(NEON_SIMD_ENABLE AND HAVE_ARM_NEON_H AND
(${CMAKE_SIZEOF_VOID_P} EQUAL 4))
- ENABLE_LANGUAGE(ASM)
+ enable_language(ASM)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/convert_with_neon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/convert_neon.S
)
-ENDIF()
+endif()
########################################################################
# Convert types generation
########################################################################
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
LIBUHD_PYTHON_GEN_SOURCE(
${CMAKE_CURRENT_SOURCE_DIR}/gen_convert_general.py
diff --git a/host/lib/deps/CMakeLists.txt b/host/lib/deps/CMakeLists.txt
index a3858bad8..6e171efea 100644
--- a/host/lib/deps/CMakeLists.txt
+++ b/host/lib/deps/CMakeLists.txt
@@ -4,6 +4,6 @@
# SPDX-License-Identifier: GPL-3.0
#
-IF(ENABLE_MPMD)
- ADD_SUBDIRECTORY(rpclib)
-ENDIF()
+if(ENABLE_MPMD)
+ add_subdirectory(rpclib)
+endif()
diff --git a/host/lib/deps/rpc_CMakeLists.txt b/host/lib/deps/rpc_CMakeLists.txt
index c8cb322da..ef28dbaf1 100644
--- a/host/lib/deps/rpc_CMakeLists.txt
+++ b/host/lib/deps/rpc_CMakeLists.txt
@@ -1,26 +1,26 @@
-PROJECT(UHD_RPCLIB CXX)
+project(UHD_RPCLIB CXX)
-SET(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size")
+set(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size")
-SET(RPCLIB_VERSION_MAJOR ${rpclib_major_version})
-SET(RPCLIB_VERSION_MINOR ${rpclib_minor_version})
-SET(RPCLIB_VERSION_PATCH ${rpclib_patch_version})
+set(RPCLIB_VERSION_MAJOR ${rpclib_major_version})
+set(RPCLIB_VERSION_MINOR ${rpclib_minor_version})
+set(RPCLIB_VERSION_PATCH ${rpclib_patch_version})
-CONFIGURE_FILE(
+configure_file(
${"${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/version.h.in"}
${"${CMAKE_CURRENT_BINARY_DIR}/version.h"})
-CONFIGURE_FILE(
+configure_file(
${"${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/config.h.in"}
${"${CMAKE_CURRENT_BINARY_DIR}/config.h"})
-SET(RPCLIB_COMPILE_DEFINITIONS "")
-IF(${"${CMAKE_CXX_COMPILER_ID}"} MATCHES "Clang")
+set(RPCLIB_COMPILE_DEFINITIONS "")
+if(${"${CMAKE_CXX_COMPILER_ID}"} MATCHES "Clang")
-ELSEIF(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "GNU")
+elseif(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "GNU")
-ELSEIF(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "MSVC")
- SET(RPCLIB_COMPILE_DEFINITIONS
+elseif(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "MSVC")
+ set(RPCLIB_COMPILE_DEFINITIONS
"${"${RPCLIB_COMPILE_DEFINITIONS}"}"
"WIN32_LEAN_AND_MEAN"
"NOMINMAX"
@@ -35,11 +35,11 @@ ELSEIF(${"${CMAKE_CXX_COMPILER_ID}"} STREQUAL "MSVC")
"ASIO_HAS_STD_SHARED_PTR"
"ASIO_HAS_STD_TYPE_TRAITS"
)
-ENDIF()
+endif()
-INCLUDE_DIRECTORIES(include)
-INCLUDE_DIRECTORIES(include/rpc)
-ADD_LIBRARY(uhd_rpclib OBJECT
+include_directories(include)
+include_directories(include/rpc)
+add_library(uhd_rpclib OBJECT
lib/rpc/dispatcher.cc
lib/rpc/server.cc
lib/rpc/client.cc
@@ -51,7 +51,7 @@ ADD_LIBRARY(uhd_rpclib OBJECT
lib/rpc/detail/response.cc
lib/rpc/detail/client_error.cc
)
-SET_TARGET_PROPERTIES(uhd_rpclib
+set_target_properties(uhd_rpclib
PROPERTIES
POSITION_INDEPENDENT_CODE ON
COMPILE_DEFINITIONS "${"${RPCLIB_COMPILE_DEFINITIONS}"}"
diff --git a/host/lib/deps/rpclib/CMakeLists.txt b/host/lib/deps/rpclib/CMakeLists.txt
index dd53fabe8..56c4865c4 100644
--- a/host/lib/deps/rpclib/CMakeLists.txt
+++ b/host/lib/deps/rpclib/CMakeLists.txt
@@ -1,26 +1,26 @@
-PROJECT(UHD_RPCLIB CXX)
+project(UHD_RPCLIB CXX)
-SET(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size")
+set(RPCLIB_DEFAULT_BUFFER_SIZE "1024 << 10" CACHE STRING "Default buffer size")
-SET(RPCLIB_VERISION_MAJOR 1)
-SET(RPCLIB_VERSION_MINOR 0)
-SET(RPCLIB_VERSION_PATCH 0)
+set(RPCLIB_VERISION_MAJOR 1)
+set(RPCLIB_VERSION_MINOR 0)
+set(RPCLIB_VERSION_PATCH 0)
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/version.h)
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/include/rpc/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
-SET(RPCLIB_COMPILE_DEFINITIONS "")
-IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+set(RPCLIB_COMPILE_DEFINITIONS "")
+if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
-ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
-ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
- SET(RPCLIB_COMPILE_DEFINITIONS
+elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
+ set(RPCLIB_COMPILE_DEFINITIONS
"${RPCLIB_COMPILE_DEFINITIONS}"
"WIN32_LEAN_AND_MEAN"
"NOMINMAX"
@@ -35,11 +35,11 @@ ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
"ASIO_HAS_STD_SHARED_PTR"
"ASIO_HAS_STD_TYPE_TRAITS"
)
-ENDIF()
+endif()
-INCLUDE_DIRECTORIES(include)
-INCLUDE_DIRECTORIES(include/rpc)
-ADD_LIBRARY(uhd_rpclib OBJECT
+include_directories(include)
+include_directories(include/rpc)
+add_library(uhd_rpclib OBJECT
lib/rpc/dispatcher.cc
lib/rpc/server.cc
lib/rpc/client.cc
@@ -51,7 +51,7 @@ ADD_LIBRARY(uhd_rpclib OBJECT
lib/rpc/detail/response.cc
lib/rpc/detail/client_error.cc
)
-SET_TARGET_PROPERTIES(uhd_rpclib
+set_target_properties(uhd_rpclib
PROPERTIES
POSITION_INDEPENDENT_CODE ON
COMPILE_DEFINITIONS "${RPCLIB_COMPILE_DEFINITIONS}"
diff --git a/host/lib/experts/CMakeLists.txt b/host/lib/experts/CMakeLists.txt
index 3101a7330..393c999f1 100644
--- a/host/lib/experts/CMakeLists.txt
+++ b/host/lib/experts/CMakeLists.txt
@@ -14,9 +14,9 @@ LIBUHD_APPEND_SOURCES(
)
# Verbose Debug output for send/recv
-SET( UHD_EXPERT_LOGGING OFF CACHE BOOL "Enable verbose logging for experts" )
-OPTION( UHD_EXPERT_LOGGING "Enable verbose logging for experts" "" )
-IF(UHD_EXPERT_LOGGING)
- MESSAGE(STATUS "Enabling verbose logging for experts")
- ADD_DEFINITIONS(-DUHD_EXPERT_LOGGING)
-ENDIF()
+set( UHD_EXPERT_LOGGING OFF CACHE BOOL "Enable verbose logging for experts" )
+option( UHD_EXPERT_LOGGING "Enable verbose logging for experts" "" )
+if(UHD_EXPERT_LOGGING)
+ message(STATUS "Enabling verbose logging for experts")
+ add_definitions(-DUHD_EXPERT_LOGGING)
+endif()
diff --git a/host/lib/ic_reg_maps/CMakeLists.txt b/host/lib/ic_reg_maps/CMakeLists.txt
index 3f06d9419..42ac4d051 100644
--- a/host/lib/ic_reg_maps/CMakeLists.txt
+++ b/host/lib/ic_reg_maps/CMakeLists.txt
@@ -9,8 +9,8 @@
# This file included, use CMake directory variables
########################################################################
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
-SET(LIBUHD_PYTHON_GEN_SOURCE_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/common.py)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+set(LIBUHD_PYTHON_GEN_SOURCE_DEPS ${CMAKE_CURRENT_SOURCE_DIR}/common.py)
LIBUHD_PYTHON_GEN_SOURCE(
${CMAKE_CURRENT_SOURCE_DIR}/gen_adf4350_regs.py
@@ -142,4 +142,4 @@ LIBUHD_PYTHON_GEN_SOURCE(
${CMAKE_CURRENT_BINARY_DIR}/rhodium_cpld_regs.hpp
)
-SET(LIBUHD_PYTHON_GEN_SOURCE_DEPS)
+set(LIBUHD_PYTHON_GEN_SOURCE_DEPS)
diff --git a/host/lib/include/CMakeLists.txt b/host/lib/include/CMakeLists.txt
index a688f4ea9..fc1a6c4d5 100644
--- a/host/lib/include/CMakeLists.txt
+++ b/host/lib/include/CMakeLists.txt
@@ -4,5 +4,5 @@
# SPDX-License-Identifier: GPL-3.0+
#
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/host/lib/rfnoc/nocscript/CMakeLists.txt b/host/lib/rfnoc/nocscript/CMakeLists.txt
index 503bd5e03..8fb7215ad 100644
--- a/host/lib/rfnoc/nocscript/CMakeLists.txt
+++ b/host/lib/rfnoc/nocscript/CMakeLists.txt
@@ -5,19 +5,19 @@
# SPDX-License-Identifier: GPL-3.0
#
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
LIBUHD_PYTHON_GEN_SOURCE(
${CMAKE_CURRENT_SOURCE_DIR}/gen_basic_funcs.py
${CMAKE_CURRENT_BINARY_DIR}/basic_functions.hpp
)
-IF(ENABLE_MANUAL)
+if(ENABLE_MANUAL)
LIBUHD_PYTHON_GEN_SOURCE(
${CMAKE_CURRENT_SOURCE_DIR}/gen_basic_funcs.py
${CMAKE_BINARY_DIR}/docs/nocscript_functions.dox
)
-ENDIF(ENABLE_MANUAL)
+endif(ENABLE_MANUAL)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/expression.cpp
diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt
index 7c79bc67c..a7f986277 100644
--- a/host/lib/transport/CMakeLists.txt
+++ b/host/lib/transport/CMakeLists.txt
@@ -12,17 +12,17 @@
########################################################################
# Include subdirectories (different than add)
########################################################################
-IF(ENABLE_X300)
+if(ENABLE_X300)
INCLUDE_SUBDIRECTORY(nirio)
-ENDIF(ENABLE_X300)
+endif(ENABLE_X300)
########################################################################
# Setup libusb
########################################################################
-IF(ENABLE_USB)
- MESSAGE(STATUS "")
- MESSAGE(STATUS "USB support enabled via libusb.")
- INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS})
+if(ENABLE_USB)
+ message(STATUS "")
+ message(STATUS "USB support enabled via libusb.")
+ include_directories(${LIBUSB_INCLUDE_DIRS})
LIBUHD_APPEND_LIBS(${LIBUSB_LIBRARIES})
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/libusb1_control.cpp
@@ -30,23 +30,23 @@ IF(ENABLE_USB)
${CMAKE_CURRENT_SOURCE_DIR}/libusb1_base.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libusb1_base.hpp
)
- SET_SOURCE_FILES_PROPERTIES(
+ set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/libusb1_zero_copy.cpp
PROPERTIES COMPILE_DEFINITIONS "${LIBUSB_DEFINITIONS}"
)
-ELSE(ENABLE_USB)
+else(ENABLE_USB)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/usb_dummy_impl.cpp
)
-ENDIF(ENABLE_USB)
+endif(ENABLE_USB)
########################################################################
# Setup defines for interface address discovery
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring interface address discovery...")
-INCLUDE(CheckCXXSourceCompiles)
-INCLUDE(CheckIncludeFileCXX)
+message(STATUS "")
+message(STATUS "Configuring interface address discovery...")
+include(CheckCXXSourceCompiles)
+include(CheckIncludeFileCXX)
CHECK_CXX_SOURCE_COMPILES("
#include <ifaddrs.h>
@@ -60,18 +60,18 @@ CHECK_CXX_SOURCE_COMPILES("
CHECK_INCLUDE_FILE_CXX(winsock2.h HAVE_WINSOCK2_H)
-IF(HAVE_GETIFADDRS)
- MESSAGE(STATUS " Interface address discovery supported through getifaddrs.")
- SET(IF_ADDRS_DEFS HAVE_GETIFADDRS)
-ELSEIF(HAVE_WINSOCK2_H)
- MESSAGE(STATUS " Interface address discovery supported through SIO_GET_INTERFACE_LIST.")
- SET(IF_ADDRS_DEFS HAVE_SIO_GET_INTERFACE_LIST)
-ELSE()
- MESSAGE(STATUS " Interface address discovery not supported.")
- SET(IF_ADDRS_DEFS HAVE_IF_ADDRS_DUMMY)
-ENDIF()
-
-SET_SOURCE_FILES_PROPERTIES(
+if(HAVE_GETIFADDRS)
+ message(STATUS " Interface address discovery supported through getifaddrs.")
+ set(IF_ADDRS_DEFS HAVE_GETIFADDRS)
+elseif(HAVE_WINSOCK2_H)
+ message(STATUS " Interface address discovery supported through SIO_GET_INTERFACE_LIST.")
+ set(IF_ADDRS_DEFS HAVE_SIO_GET_INTERFACE_LIST)
+else()
+ message(STATUS " Interface address discovery not supported.")
+ set(IF_ADDRS_DEFS HAVE_IF_ADDRS_DUMMY)
+endif()
+
+set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/if_addrs.cpp
PROPERTIES COMPILE_DEFINITIONS "${IF_ADDRS_DEFS}"
)
@@ -79,29 +79,29 @@ SET_SOURCE_FILES_PROPERTIES(
########################################################################
# Setup UDP
########################################################################
-IF(WIN32)
+if(WIN32)
LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/udp_wsa_zero_copy.cpp)
-ELSE()
+else()
LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/udp_zero_copy.cpp)
-ENDIF()
+endif()
#On windows, the boost asio implementation uses the winsock2 library.
#Note: we exclude the .lib extension for cygwin and mingw platforms.
-IF(WIN32)
+if(WIN32)
LIBUHD_APPEND_LIBS(ws2_32)
-ENDIF()
+endif()
#atlbase.h is not included with visual studio express
#conditionally check for atlbase.h and define if found
-INCLUDE(CheckIncludeFileCXX)
+include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(atlbase.h HAVE_ATLBASE_H)
-IF(HAVE_ATLBASE_H)
- SET_SOURCE_FILES_PROPERTIES(
+if(HAVE_ATLBASE_H)
+ set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/udp_zero_copy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/udp_wsa_zero_copy.cpp
PROPERTIES COMPILE_DEFINITIONS "HAVE_ATLBASE_H"
)
-ENDIF(HAVE_ATLBASE_H)
+endif(HAVE_ATLBASE_H)
########################################################################
# Append to the list of sources for lib uhd
@@ -123,29 +123,29 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/zero_copy_flow_ctrl.cpp
)
-IF(ENABLE_X300)
+if(ENABLE_X300)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/nirio_zero_copy.cpp
)
-ENDIF(ENABLE_X300)
+endif(ENABLE_X300)
-IF(ENABLE_LIBERIO)
- INCLUDE_DIRECTORIES(${LIBERIO_INCLUDE_DIRS})
+if(ENABLE_LIBERIO)
+ include_directories(${LIBERIO_INCLUDE_DIRS})
LIBUHD_APPEND_LIBS(${LIBERIO_LIBRARIES})
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/liberio_zero_copy.cpp
)
-ENDIF(ENABLE_LIBERIO)
+endif(ENABLE_LIBERIO)
-IF(ENABLE_DPDK)
+if(ENABLE_DPDK)
INCLUDE_SUBDIRECTORY(uhd-dpdk)
-ENDIF(ENABLE_DPDK)
+endif(ENABLE_DPDK)
# Verbose Debug output for send/recv
-SET( UHD_TXRX_DEBUG_PRINTS OFF CACHE BOOL "Use verbose debug output for send/recv" )
-OPTION( UHD_TXRX_DEBUG_PRINTS "Use verbose debug output for send/recv" "" )
-IF(UHD_TXRX_DEBUG_PRINTS)
- MESSAGE(STATUS "Using verbose debug output for send/recv")
- ADD_DEFINITIONS(-DUHD_TXRX_DEBUG_PRINTS)
-ENDIF()
+set( UHD_TXRX_DEBUG_PRINTS OFF CACHE BOOL "Use verbose debug output for send/recv" )
+option( UHD_TXRX_DEBUG_PRINTS "Use verbose debug output for send/recv" "" )
+if(UHD_TXRX_DEBUG_PRINTS)
+ message(STATUS "Using verbose debug output for send/recv")
+ add_definitions(-DUHD_TXRX_DEBUG_PRINTS)
+endif()
diff --git a/host/lib/transport/nirio/CMakeLists.txt b/host/lib/transport/nirio/CMakeLists.txt
index 8336d6063..af456c595 100644
--- a/host/lib/transport/nirio/CMakeLists.txt
+++ b/host/lib/transport/nirio/CMakeLists.txt
@@ -29,10 +29,10 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/status.cpp
)
-IF(WIN32)
+if(WIN32)
LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/nirio_driver_iface_win.cpp)
-ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") #Built-in variable encompasses all UNIX-like systems
+elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") #Built-in variable encompasses all UNIX-like systems
LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/nirio_driver_iface_linux.cpp)
-ELSE()
+else()
LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_SOURCE_DIR}/nirio_driver_iface_unsupported.cpp)
-ENDIF(WIN32)
+endif(WIN32)
diff --git a/host/lib/transport/nirio/lvbitx/CMakeLists.txt b/host/lib/transport/nirio/lvbitx/CMakeLists.txt
index 6fbd6b469..8fb5bd079 100644
--- a/host/lib/transport/nirio/lvbitx/CMakeLists.txt
+++ b/host/lib/transport/nirio/lvbitx/CMakeLists.txt
@@ -5,21 +5,21 @@
# SPDX-License-Identifier: GPL-3.0
#
-MACRO(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM lvbitx binfile)
- GET_FILENAME_COMPONENT(lvbitxprefix ${lvbitx} NAME_WE)
+macro(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM lvbitx binfile)
+ get_filename_component(lvbitxprefix ${lvbitx} NAME_WE)
- IF( ${binfile} STREQUAL "OFF" )
- SET( GEN_OPTIONS )
- MESSAGE( STATUS " Using ${lvbitx} for codegen" )
- ELSE( ${binfile} STREQUAL "OFF" )
- SET( GEN_OPTIONS --merge-bin=${CMAKE_SOURCE_DIR}/../binaries/${binfile} --output-lvbitx-path=${CMAKE_SOURCE_DIR}/../binaries )
- MESSAGE( STATUS " Merging ${lvbitx} with ${binfile} for codegen" )
- ENDIF( ${binfile} STREQUAL "OFF" )
+ if( ${binfile} STREQUAL "OFF" )
+ set( GEN_OPTIONS )
+ message( STATUS " Using ${lvbitx} for codegen" )
+ else( ${binfile} STREQUAL "OFF" )
+ set( GEN_OPTIONS --merge-bin=${CMAKE_SOURCE_DIR}/../binaries/${binfile} --output-lvbitx-path=${CMAKE_SOURCE_DIR}/../binaries )
+ message( STATUS " Merging ${lvbitx} with ${binfile} for codegen" )
+ endif( ${binfile} STREQUAL "OFF" )
- SET(OUTPUT_PATH_OPT --output-src-path=${CMAKE_CURRENT_BINARY_DIR})
- SET(IMAGES_PATH_OPT --uhd-images-path=${UHD_IMAGES_DIR})
+ set(OUTPUT_PATH_OPT --output-src-path=${CMAKE_CURRENT_BINARY_DIR})
+ set(IMAGES_PATH_OPT --uhd-images-path=${UHD_IMAGES_DIR})
- ADD_CUSTOM_COMMAND(
+ add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.cpp
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.hpp
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/process-lvbitx.py
@@ -33,16 +33,16 @@ MACRO(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM lvbitx binfile)
#make libuhd depend on the output file
LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.hpp)
LIBUHD_APPEND_SOURCES(${CMAKE_CURRENT_BINARY_DIR}/${lvbitxprefix}_lvbitx.cpp)
-ENDMACRO(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM)
+endmacro(LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
########################################################################
# Generation code
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Processing NI-RIO FPGA LVBITX Bitstreams...")
+message(STATUS "")
+message(STATUS "Processing NI-RIO FPGA LVBITX Bitstreams...")
# X300 Stuff
LIBUHD_LVBITX_GEN_SOURCE_AND_BITSTREAM(x300.lvbitx_base OFF)
diff --git a/host/lib/types/CMakeLists.txt b/host/lib/types/CMakeLists.txt
index 7f8c80c95..938015dca 100644
--- a/host/lib/types/CMakeLists.txt
+++ b/host/lib/types/CMakeLists.txt
@@ -24,7 +24,7 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/byte_vector.cpp
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/metadata_c.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ranges_c.cpp
@@ -33,4 +33,4 @@ IF(ENABLE_C_API)
${CMAKE_CURRENT_SOURCE_DIR}/tune_c.cpp
${CMAKE_CURRENT_SOURCE_DIR}/usrp_info_c.cpp
)
-ENDIF()
+endif()
diff --git a/host/lib/usrp/CMakeLists.txt b/host/lib/usrp/CMakeLists.txt
index 9a1818599..9998c1a4a 100644
--- a/host/lib/usrp/CMakeLists.txt
+++ b/host/lib/usrp/CMakeLists.txt
@@ -8,7 +8,7 @@
########################################################################
# This file included, use CMake directory variables
########################################################################
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/dboard_base.cpp
@@ -22,21 +22,21 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/fe_connection.cpp
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/dboard_eeprom_c.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mboard_eeprom_c.cpp
${CMAKE_CURRENT_SOURCE_DIR}/subdev_spec_c.cpp
${CMAKE_CURRENT_SOURCE_DIR}/usrp_c.cpp
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
-IF(ENABLE_GPSD)
+if(ENABLE_GPSD)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/gpsd_iface.cpp
)
LIBUHD_APPEND_LIBS(${LIBGPS_LIBRARY})
-ENDIF(ENABLE_GPSD)
+endif(ENABLE_GPSD)
INCLUDE_SUBDIRECTORY(cores)
INCLUDE_SUBDIRECTORY(dboard)
diff --git a/host/lib/usrp/b100/CMakeLists.txt b/host/lib/usrp/b100/CMakeLists.txt
index 8548b961b..6f6050c34 100644
--- a/host/lib/usrp/b100/CMakeLists.txt
+++ b/host/lib/usrp/b100/CMakeLists.txt
@@ -12,7 +12,7 @@
########################################################################
# Conditionally configure the B100 support
########################################################################
-IF(ENABLE_B100)
+if(ENABLE_B100)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/b100_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/clock_ctrl.cpp
@@ -23,4 +23,4 @@ IF(ENABLE_B100)
${CMAKE_CURRENT_SOURCE_DIR}/usb_zero_copy_wrapper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fifo_ctrl_excelsior.cpp
)
-ENDIF(ENABLE_B100)
+endif(ENABLE_B100)
diff --git a/host/lib/usrp/b200/CMakeLists.txt b/host/lib/usrp/b200/CMakeLists.txt
index 2f3ea2483..78dfe884d 100644
--- a/host/lib/usrp/b200/CMakeLists.txt
+++ b/host/lib/usrp/b200/CMakeLists.txt
@@ -12,7 +12,7 @@
########################################################################
# Conditionally configure the B200 support
########################################################################
-IF(ENABLE_B200)
+if(ENABLE_B200)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/b200_image_loader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/b200_impl.cpp
@@ -22,4 +22,4 @@ IF(ENABLE_B200)
${CMAKE_CURRENT_SOURCE_DIR}/b200_cores.cpp
${CMAKE_CURRENT_SOURCE_DIR}/b200_mb_eeprom.cpp
)
-ENDIF(ENABLE_B200)
+endif(ENABLE_B200)
diff --git a/host/lib/usrp/common/CMakeLists.txt b/host/lib/usrp/common/CMakeLists.txt
index 6490fac08..673aa7e78 100644
--- a/host/lib/usrp/common/CMakeLists.txt
+++ b/host/lib/usrp/common/CMakeLists.txt
@@ -8,22 +8,22 @@
########################################################################
# This file included, use CMake directory variables
########################################################################
-IF(ENABLE_USB)
+if(ENABLE_USB)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/fx2_ctrl.cpp
)
-ENDIF(ENABLE_USB)
+endif(ENABLE_USB)
-IF(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320)
- INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/ad9361_driver")
+if(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320)
+ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ad9361_driver")
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/ad9361_ctrl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ad936x_manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ad9361_driver/ad9361_device.cpp
)
-ENDIF(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320)
+endif(ENABLE_E300 OR ENABLE_B200 OR ENABLE_N230 OR ENABLE_E320)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/adf4001_ctrl.cpp
diff --git a/host/lib/usrp/cores/CMakeLists.txt b/host/lib/usrp/cores/CMakeLists.txt
index 95102f29d..6d3d988f0 100644
--- a/host/lib/usrp/cores/CMakeLists.txt
+++ b/host/lib/usrp/cores/CMakeLists.txt
@@ -9,7 +9,7 @@
# This file included, use CMake directory variables
########################################################################
-IF(ENABLE_B100 OR ENABLE_USRP2)
+if(ENABLE_B100 OR ENABLE_USRP2)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/gpio_core_200.cpp
${CMAKE_CURRENT_SOURCE_DIR}/i2c_core_200.cpp
@@ -18,7 +18,7 @@ IF(ENABLE_B100 OR ENABLE_USRP2)
${CMAKE_CURRENT_SOURCE_DIR}/tx_dsp_core_200.cpp
${CMAKE_CURRENT_SOURCE_DIR}/user_settings_core_200.cpp
)
-ENDIF(ENABLE_B100 OR ENABLE_USRP2)
+endif(ENABLE_B100 OR ENABLE_USRP2)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/dma_fifo_core_3000.cpp
diff --git a/host/lib/usrp/dboard/CMakeLists.txt b/host/lib/usrp/dboard/CMakeLists.txt
index 25e1bd2b9..5328fcc90 100644
--- a/host/lib/usrp/dboard/CMakeLists.txt
+++ b/host/lib/usrp/dboard/CMakeLists.txt
@@ -8,7 +8,7 @@
########################################################################
# This file included, use CMake directory variables
########################################################################
-IF(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100)
+if(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/db_basic_and_lf.cpp
${CMAKE_CURRENT_SOURCE_DIR}/db_rfx.cpp
@@ -29,31 +29,31 @@ IF(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100)
${CMAKE_CURRENT_SOURCE_DIR}/db_dbsrx2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/db_tvrx2.cpp
)
-ENDIF(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100)
+endif(ENABLE_X300 OR ENABLE_USRP1 OR ENABLE_USRP2 OR ENABLE_B100)
-IF(ENABLE_E300)
+if(ENABLE_E300)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/db_e3x0.cpp
)
-ENDIF(ENABLE_E300)
+endif(ENABLE_E300)
-IF(ENABLE_X300)
+if(ENABLE_X300)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/twinrx/twinrx_ctrl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/twinrx/twinrx_experts.cpp
${CMAKE_CURRENT_SOURCE_DIR}/twinrx/twinrx_gain_tables.cpp
${CMAKE_CURRENT_SOURCE_DIR}/db_twinrx.cpp
)
-ENDIF(ENABLE_X300)
+endif(ENABLE_X300)
-IF(ENABLE_N300)
+if(ENABLE_N300)
INCLUDE_SUBDIRECTORY(magnesium)
-ENDIF(ENABLE_N300)
-IF(ENABLE_N320)
+endif(ENABLE_N300)
+if(ENABLE_N320)
INCLUDE_SUBDIRECTORY(rhodium)
-ENDIF(ENABLE_N320)
-IF(ENABLE_MPMD AND ENABLE_EISCAT)
+endif(ENABLE_N320)
+if(ENABLE_MPMD AND ENABLE_EISCAT)
INCLUDE_SUBDIRECTORY(eiscat)
-ENDIF(ENABLE_MPMD AND ENABLE_EISCAT)
+endif(ENABLE_MPMD AND ENABLE_EISCAT)
INCLUDE_SUBDIRECTORY(neon)
diff --git a/host/lib/usrp/dboard/eiscat/CMakeLists.txt b/host/lib/usrp/dboard/eiscat/CMakeLists.txt
index 13da2d6da..650116ec1 100644
--- a/host/lib/usrp/dboard/eiscat/CMakeLists.txt
+++ b/host/lib/usrp/dboard/eiscat/CMakeLists.txt
@@ -7,7 +7,7 @@
# This file is conditionally included if ENABLE_MPMD and ENABLE_EISCAT are
# set to true.
-LIST(APPEND EISCAT_SOURCES
+list(APPEND EISCAT_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/eiscat_radio_ctrl_impl.cpp
)
LIBUHD_APPEND_SOURCES(${EISCAT_SOURCES})
diff --git a/host/lib/usrp/dboard/magnesium/CMakeLists.txt b/host/lib/usrp/dboard/magnesium/CMakeLists.txt
index 417cd4f54..9f78ce242 100644
--- a/host/lib/usrp/dboard/magnesium/CMakeLists.txt
+++ b/host/lib/usrp/dboard/magnesium/CMakeLists.txt
@@ -7,7 +7,7 @@
# This file is conditionally included if ENABLE_MPMD and ENABLE_N300 are
# set to true.
-LIST(APPEND MAGNESIUM_SOURCES
+list(APPEND MAGNESIUM_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_init.cpp
${CMAKE_CURRENT_SOURCE_DIR}/magnesium_radio_ctrl_cpld.cpp
diff --git a/host/lib/usrp/dboard/neon/CMakeLists.txt b/host/lib/usrp/dboard/neon/CMakeLists.txt
index e1ee0fba4..a2473bd0a 100644
--- a/host/lib/usrp/dboard/neon/CMakeLists.txt
+++ b/host/lib/usrp/dboard/neon/CMakeLists.txt
@@ -4,12 +4,12 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
-IF(ENABLE_E320)
- LIST(APPEND NEON_SOURCES
+if(ENABLE_E320)
+ list(APPEND NEON_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/neon_radio_ctrl_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/neon_radio_ctrl_init.cpp
${CMAKE_CURRENT_SOURCE_DIR}/neon_ad9361_iface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/neon_bands.cpp
)
LIBUHD_APPEND_SOURCES(${NEON_SOURCES})
-ENDIF(ENABLE_E320)
+endif(ENABLE_E320)
diff --git a/host/lib/usrp/dboard/rhodium/CMakeLists.txt b/host/lib/usrp/dboard/rhodium/CMakeLists.txt
index 617e4af58..2b2e9744c 100644
--- a/host/lib/usrp/dboard/rhodium/CMakeLists.txt
+++ b/host/lib/usrp/dboard/rhodium/CMakeLists.txt
@@ -4,8 +4,8 @@
# SPDX-License-Identifier: GPL-3.0-or-later
#
-IF(ENABLE_MPMD)
- LIST(APPEND RHODIUM_SOURCES
+if(ENABLE_MPMD)
+ list(APPEND RHODIUM_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/rhodium_radio_ctrl_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rhodium_radio_ctrl_init.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rhodium_radio_ctrl_cpld.cpp
@@ -14,5 +14,5 @@ IF(ENABLE_MPMD)
${CMAKE_CURRENT_SOURCE_DIR}/rhodium_cpld_ctrl.cpp
)
LIBUHD_APPEND_SOURCES(${RHODIUM_SOURCES})
-ENDIF(ENABLE_MPMD)
+endif(ENABLE_MPMD)
diff --git a/host/lib/usrp/e300/CMakeLists.txt b/host/lib/usrp/e300/CMakeLists.txt
index 9e85a6bb4..2b4e3105d 100644
--- a/host/lib/usrp/e300/CMakeLists.txt
+++ b/host/lib/usrp/e300/CMakeLists.txt
@@ -14,8 +14,8 @@
########################################################################
find_package(UDev)
-IF(ENABLE_E300)
- LIST(APPEND E300_SOURCES
+if(ENABLE_E300)
+ list(APPEND E300_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/e300_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/e300_io_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/e300_fifo_config.cpp
@@ -31,21 +31,21 @@ IF(ENABLE_E300)
${CMAKE_CURRENT_SOURCE_DIR}/e3xx_radio_ctrl_impl.cpp
)
LIBUHD_APPEND_SOURCES(${E300_SOURCES})
- IF(UDEV_FOUND AND NOT E300_FORCE_NETWORK)
- INCLUDE_DIRECTORIES(${UDEV_INCLUDE_DIR})
+ if(UDEV_FOUND AND NOT E300_FORCE_NETWORK)
+ include_directories(${UDEV_INCLUDE_DIR})
LIBUHD_APPEND_LIBS(${UDEV_LIBS})
- SET_SOURCE_FILES_PROPERTIES(
+ set_source_files_properties(
${E300_SOURCES}
PROPERTIES COMPILE_DEFINITIONS "E300_NATIVE=1"
)
- ENDIF(UDEV_FOUND AND NOT E300_FORCE_NETWORK)
+ endif(UDEV_FOUND AND NOT E300_FORCE_NETWORK)
- IF(ENABLE_GPSD)
- SET_SOURCE_FILES_PROPERTIES(
+ if(ENABLE_GPSD)
+ set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/e300_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/e300_impl.hpp
${CMAKE_CURRENT_SOURCE_DIR}/e3xx_radio_ctrl_impl.hpp
PROPERTIES COMPILE_DEFINITIONS "E300_GPSD=1"
)
- ENDIF(ENABLE_GPSD)
-ENDIF(ENABLE_E300)
+ endif(ENABLE_GPSD)
+endif(ENABLE_E300)
diff --git a/host/lib/usrp/mpmd/CMakeLists.txt b/host/lib/usrp/mpmd/CMakeLists.txt
index 4447f2dc4..774ad6593 100644
--- a/host/lib/usrp/mpmd/CMakeLists.txt
+++ b/host/lib/usrp/mpmd/CMakeLists.txt
@@ -4,11 +4,11 @@
# SPDX-License-Identifier: GPL-3.0
#
-IF(ENABLE_MPMD)
- IF(ENABLE_LIBERIO)
- MESSAGE(STATUS "Compiling MPMD with liberio support...")
- ADD_DEFINITIONS(-DHAVE_LIBERIO)
- ENDIF(ENABLE_LIBERIO)
+if(ENABLE_MPMD)
+ if(ENABLE_LIBERIO)
+ message(STATUS "Compiling MPMD with liberio support...")
+ add_definitions(-DHAVE_LIBERIO)
+ endif(ENABLE_LIBERIO)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/mpmd_find.cpp
@@ -21,10 +21,10 @@ IF(ENABLE_MPMD)
${CMAKE_CURRENT_SOURCE_DIR}/mpmd_xport_ctrl_udp.cpp
)
- IF(ENABLE_LIBERIO)
+ if(ENABLE_LIBERIO)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/mpmd_xport_ctrl_liberio.cpp
)
- ENDIF(ENABLE_LIBERIO)
+ endif(ENABLE_LIBERIO)
-ENDIF(ENABLE_MPMD)
+endif(ENABLE_MPMD)
diff --git a/host/lib/usrp/n230/CMakeLists.txt b/host/lib/usrp/n230/CMakeLists.txt
index 9d16067a0..6acb332b8 100644
--- a/host/lib/usrp/n230/CMakeLists.txt
+++ b/host/lib/usrp/n230/CMakeLists.txt
@@ -12,7 +12,7 @@
########################################################################
# Conditionally configure the N230 support
########################################################################
-IF(ENABLE_N230)
+if(ENABLE_N230)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/n230_cores.cpp
${CMAKE_CURRENT_SOURCE_DIR}/n230_impl.cpp
@@ -25,4 +25,4 @@ IF(ENABLE_N230)
${CMAKE_CURRENT_SOURCE_DIR}/n230_image_loader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/n230_fw_ctrl_iface.cpp
)
-ENDIF(ENABLE_N230)
+endif(ENABLE_N230)
diff --git a/host/lib/usrp/usrp1/CMakeLists.txt b/host/lib/usrp/usrp1/CMakeLists.txt
index 0c3c94c7b..95b6abb22 100644
--- a/host/lib/usrp/usrp1/CMakeLists.txt
+++ b/host/lib/usrp/usrp1/CMakeLists.txt
@@ -12,7 +12,7 @@
########################################################################
# Conditionally configure the USRP1 support
########################################################################
-IF(ENABLE_USRP1)
+if(ENABLE_USRP1)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/codec_ctrl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/dboard_iface.cpp
@@ -22,4 +22,4 @@ IF(ENABLE_USRP1)
${CMAKE_CURRENT_SOURCE_DIR}/usrp1_iface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/usrp1_impl.cpp
)
-ENDIF(ENABLE_USRP1)
+endif(ENABLE_USRP1)
diff --git a/host/lib/usrp/usrp2/CMakeLists.txt b/host/lib/usrp/usrp2/CMakeLists.txt
index 8e7e186bb..ab9115eca 100644
--- a/host/lib/usrp/usrp2/CMakeLists.txt
+++ b/host/lib/usrp/usrp2/CMakeLists.txt
@@ -12,7 +12,7 @@
########################################################################
# Conditionally configure the USRP2 support
########################################################################
-IF(ENABLE_USRP2)
+if(ENABLE_USRP2)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/clock_ctrl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/codec_ctrl.cpp
@@ -24,4 +24,4 @@ IF(ENABLE_USRP2)
${CMAKE_CURRENT_SOURCE_DIR}/usrp2_fifo_ctrl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/n200_image_loader.cpp
)
-ENDIF(ENABLE_USRP2)
+endif(ENABLE_USRP2)
diff --git a/host/lib/usrp/x300/CMakeLists.txt b/host/lib/usrp/x300/CMakeLists.txt
index 08dde87d2..ba1a8678c 100644
--- a/host/lib/usrp/x300/CMakeLists.txt
+++ b/host/lib/usrp/x300/CMakeLists.txt
@@ -12,7 +12,7 @@
########################################################################
# Conditionally configure the X300 support
########################################################################
-IF(ENABLE_X300)
+if(ENABLE_X300)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/x300_radio_ctrl_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/x300_impl.cpp
@@ -28,4 +28,4 @@ IF(ENABLE_X300)
${CMAKE_CURRENT_SOURCE_DIR}/x300_mb_eeprom.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cdecode.c
)
-ENDIF(ENABLE_X300)
+endif(ENABLE_X300)
diff --git a/host/lib/usrp_clock/CMakeLists.txt b/host/lib/usrp_clock/CMakeLists.txt
index 1812fcca5..ec6bc1ddc 100644
--- a/host/lib/usrp_clock/CMakeLists.txt
+++ b/host/lib/usrp_clock/CMakeLists.txt
@@ -13,10 +13,10 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/multi_usrp_clock.cpp
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/usrp_clock_c.cpp
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
INCLUDE_SUBDIRECTORY(octoclock)
diff --git a/host/lib/usrp_clock/octoclock/CMakeLists.txt b/host/lib/usrp_clock/octoclock/CMakeLists.txt
index 6a978bd2a..e42a66141 100644
--- a/host/lib/usrp_clock/octoclock/CMakeLists.txt
+++ b/host/lib/usrp_clock/octoclock/CMakeLists.txt
@@ -8,11 +8,11 @@
########################################################################
# Conditionally configure the OctoClock support
########################################################################
-IF(ENABLE_OCTOCLOCK)
+if(ENABLE_OCTOCLOCK)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/octoclock_eeprom.cpp
${CMAKE_CURRENT_SOURCE_DIR}/octoclock_image_loader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/octoclock_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/octoclock_uart.cpp
)
-ENDIF(ENABLE_OCTOCLOCK)
+endif(ENABLE_OCTOCLOCK)
diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt
index f81e0763f..1ecf6b9fe 100644
--- a/host/lib/utils/CMakeLists.txt
+++ b/host/lib/utils/CMakeLists.txt
@@ -12,9 +12,9 @@
########################################################################
# Setup defines for process scheduling
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring priority scheduling...")
-INCLUDE(CheckCXXSourceCompiles)
+message(STATUS "")
+message(STATUS "Configuring priority scheduling...")
+include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
#include <pthread.h>
@@ -26,10 +26,10 @@ CHECK_CXX_SOURCE_COMPILES("
" HAVE_PTHREAD_SETSCHEDPARAM
)
-IF(CYGWIN)
+if(CYGWIN)
#SCHED_RR non-operational on cygwin
- SET(HAVE_PTHREAD_SETSCHEDPARAM False)
-ENDIF(CYGWIN)
+ set(HAVE_PTHREAD_SETSCHEDPARAM False)
+endif(CYGWIN)
CHECK_CXX_SOURCE_COMPILES("
#include <windows.h>
@@ -43,19 +43,19 @@ CHECK_CXX_SOURCE_COMPILES("
-IF(HAVE_PTHREAD_SETSCHEDPARAM)
- MESSAGE(STATUS " Priority scheduling supported through pthread_setschedparam.")
- LIST(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETSCHEDPARAM)
+if(HAVE_PTHREAD_SETSCHEDPARAM)
+ message(STATUS " Priority scheduling supported through pthread_setschedparam.")
+ list(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETSCHEDPARAM)
LIBUHD_APPEND_LIBS(pthread)
-ELSEIF(HAVE_WIN_SETTHREADPRIORITY)
- MESSAGE(STATUS " Priority scheduling supported through windows SetThreadPriority.")
- SET(THREAD_PRIO_DEFS HAVE_WIN_SETTHREADPRIORITY)
-ELSE()
- MESSAGE(STATUS " Priority scheduling not supported.")
- SET(THREAD_PRIO_DEFS HAVE_THREAD_PRIO_DUMMY)
-ENDIF()
+elseif(HAVE_WIN_SETTHREADPRIORITY)
+ message(STATUS " Priority scheduling supported through windows SetThreadPriority.")
+ set(THREAD_PRIO_DEFS HAVE_WIN_SETTHREADPRIORITY)
+else()
+ message(STATUS " Priority scheduling not supported.")
+ set(THREAD_PRIO_DEFS HAVE_THREAD_PRIO_DUMMY)
+endif()
-SET(CMAKE_REQUIRED_LIBRARIES "pthread")
+set(CMAKE_REQUIRED_LIBRARIES "pthread")
CHECK_CXX_SOURCE_COMPILES("
#include <pthread.h>
@@ -68,22 +68,22 @@ CHECK_CXX_SOURCE_COMPILES("
" HAVE_PTHREAD_SETNAME
)
-IF(CYGWIN)
+if(CYGWIN)
#SCHED_RR non-operational on cygwin
- SET(HAVE_PTHREAD_SETNAME False)
-ENDIF(CYGWIN)
+ set(HAVE_PTHREAD_SETNAME False)
+endif(CYGWIN)
-IF(HAVE_PTHREAD_SETNAME)
- MESSAGE(STATUS " Setting thread names is supported through pthread_setname_np.")
- LIST(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETNAME)
+if(HAVE_PTHREAD_SETNAME)
+ message(STATUS " Setting thread names is supported through pthread_setname_np.")
+ list(APPEND THREAD_PRIO_DEFS HAVE_PTHREAD_SETNAME)
LIBUHD_APPEND_LIBS(pthread)
-ELSE()
- MESSAGE(STATUS " Setting thread names is not supported.")
- LIST(APPEND THREAD_PRIO_DEFS HAVE_THREAD_SETNAME_DUMMY)
-ENDIF()
+else()
+ message(STATUS " Setting thread names is not supported.")
+ list(APPEND THREAD_PRIO_DEFS HAVE_THREAD_SETNAME_DUMMY)
+endif()
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp
PROPERTIES COMPILE_DEFINITIONS "${THREAD_PRIO_DEFS}"
)
@@ -91,11 +91,11 @@ SET_SOURCE_FILES_PROPERTIES(
########################################################################
# Setup defines for high resolution timing
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring high resolution timing...")
-INCLUDE(CheckCXXSourceCompiles)
+message(STATUS "")
+message(STATUS "Configuring high resolution timing...")
+include(CheckCXXSourceCompiles)
-SET(CMAKE_REQUIRED_LIBRARIES -lrt)
+set(CMAKE_REQUIRED_LIBRARIES -lrt)
CHECK_CXX_SOURCE_COMPILES("
#include <ctime>
int main(){
@@ -104,9 +104,9 @@ CHECK_CXX_SOURCE_COMPILES("
}
" HAVE_CLOCK_GETTIME
)
-SET(CMAKE_REQUIRED_LIBRARIES)
+set(CMAKE_REQUIRED_LIBRARIES)
-INCLUDE(CheckCXXSourceCompiles)
+include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
#include <mach/mach_time.h>
int main(){
@@ -130,22 +130,22 @@ CHECK_CXX_SOURCE_COMPILES("
)
-IF(HAVE_CLOCK_GETTIME)
- MESSAGE(STATUS " High resolution timing supported through clock_gettime.")
- SET(SYSTEM_TIME_DEFS HAVE_CLOCK_GETTIME)
+if(HAVE_CLOCK_GETTIME)
+ message(STATUS " High resolution timing supported through clock_gettime.")
+ set(SYSTEM_TIME_DEFS HAVE_CLOCK_GETTIME)
LIBUHD_APPEND_LIBS("-lrt")
-ELSEIF(HAVE_MACH_ABSOLUTE_TIME)
- MESSAGE(STATUS " High resolution timing supported through mach_absolute_time.")
- SET(SYSTEM_TIME_DEFS HAVE_MACH_ABSOLUTE_TIME)
-ELSEIF(HAVE_QUERY_PERFORMANCE_COUNTER)
- MESSAGE(STATUS " High resolution timing supported through QueryPerformanceCounter.")
- SET(SYSTEM_TIME_DEFS HAVE_QUERY_PERFORMANCE_COUNTER)
-ELSE()
- MESSAGE(STATUS " High resolution timing supported though microsec_clock.")
- SET(SYSTEM_TIME_DEFS HAVE_MICROSEC_CLOCK)
-ENDIF()
-
-SET_SOURCE_FILES_PROPERTIES(
+elseif(HAVE_MACH_ABSOLUTE_TIME)
+ message(STATUS " High resolution timing supported through mach_absolute_time.")
+ set(SYSTEM_TIME_DEFS HAVE_MACH_ABSOLUTE_TIME)
+elseif(HAVE_QUERY_PERFORMANCE_COUNTER)
+ message(STATUS " High resolution timing supported through QueryPerformanceCounter.")
+ set(SYSTEM_TIME_DEFS HAVE_QUERY_PERFORMANCE_COUNTER)
+else()
+ message(STATUS " High resolution timing supported though microsec_clock.")
+ set(SYSTEM_TIME_DEFS HAVE_MICROSEC_CLOCK)
+endif()
+
+set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/system_time.cpp
PROPERTIES COMPILE_DEFINITIONS "${SYSTEM_TIME_DEFS}"
)
@@ -153,11 +153,11 @@ SET_SOURCE_FILES_PROPERTIES(
########################################################################
# Setup defines for module loading
########################################################################
-MESSAGE(STATUS "")
-MESSAGE(STATUS "Configuring module loading...")
-INCLUDE(CheckCXXSourceCompiles)
+message(STATUS "")
+message(STATUS "Configuring module loading...")
+include(CheckCXXSourceCompiles)
-SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
+set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
CHECK_CXX_SOURCE_COMPILES("
#include <dlfcn.h>
int main(){
@@ -166,7 +166,7 @@ CHECK_CXX_SOURCE_COMPILES("
}
" HAVE_DLOPEN
)
-SET(CMAKE_REQUIRED_LIBRARIES)
+set(CMAKE_REQUIRED_LIBRARIES)
CHECK_CXX_SOURCE_COMPILES("
#define WIN32_LEAN_AND_MEAN
@@ -178,19 +178,19 @@ CHECK_CXX_SOURCE_COMPILES("
" HAVE_LOAD_LIBRARY
)
-IF(HAVE_DLOPEN)
- MESSAGE(STATUS " Module loading supported through dlopen.")
- SET(LOAD_MODULES_DEFS HAVE_DLOPEN)
+if(HAVE_DLOPEN)
+ message(STATUS " Module loading supported through dlopen.")
+ set(LOAD_MODULES_DEFS HAVE_DLOPEN)
LIBUHD_APPEND_LIBS(${CMAKE_DL_LIBS})
-ELSEIF(HAVE_LOAD_LIBRARY)
- MESSAGE(STATUS " Module loading supported through LoadLibrary.")
- SET(LOAD_MODULES_DEFS HAVE_LOAD_LIBRARY)
-ELSE()
- MESSAGE(STATUS " Module loading not supported.")
- SET(LOAD_MODULES_DEFS HAVE_LOAD_MODULES_DUMMY)
-ENDIF()
-
-SET_SOURCE_FILES_PROPERTIES(
+elseif(HAVE_LOAD_LIBRARY)
+ message(STATUS " Module loading supported through LoadLibrary.")
+ set(LOAD_MODULES_DEFS HAVE_LOAD_LIBRARY)
+else()
+ message(STATUS " Module loading not supported.")
+ set(LOAD_MODULES_DEFS HAVE_LOAD_MODULES_DUMMY)
+endif()
+
+set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/load_modules.cpp
PROPERTIES COMPILE_DEFINITIONS "${LOAD_MODULES_DEFS}"
)
@@ -198,17 +198,17 @@ SET_SOURCE_FILES_PROPERTIES(
########################################################################
# Define UHD_PKG_DATA_PATH for paths.cpp
########################################################################
-FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH)
-STRING(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}")
+file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH)
+string(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}")
-STRING(REGEX MATCH ".*/.*" SLASH "${LIB_SUFFIX}")
-IF(SLASH STREQUAL "")
- SET(UHD_LIB_DIR "lib${LIB_SUFFIX}")
-ELSE()
- SET(UHD_LIB_DIR "lib")
-ENDIF(SLASH STREQUAL "")
+string(REGEX MATCH ".*/.*" SLASH "${LIB_SUFFIX}")
+if(SLASH STREQUAL "")
+ set(UHD_LIB_DIR "lib${LIB_SUFFIX}")
+else()
+ set(UHD_LIB_DIR "lib")
+endif(SLASH STREQUAL "")
-SET_SOURCE_FILES_PROPERTIES(
+set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/paths.cpp
${CMAKE_CURRENT_SOURCE_DIR}/images.cpp
PROPERTIES COMPILE_DEFINITIONS
@@ -237,9 +237,9 @@ LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp
)
-IF(ENABLE_C_API)
+if(ENABLE_C_API)
LIBUHD_APPEND_SOURCES(
${CMAKE_CURRENT_SOURCE_DIR}/log_c.cpp
${CMAKE_CURRENT_SOURCE_DIR}/thread_priority_c.cpp
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
diff --git a/host/python/CMakeLists.txt b/host/python/CMakeLists.txt
index 32a32592e..07791de55 100644
--- a/host/python/CMakeLists.txt
+++ b/host/python/CMakeLists.txt
@@ -15,66 +15,66 @@ PYTHON_CHECK_MODULE(
)
# Get include dirs
-INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
-EXECUTE_PROCESS(
+include_directories(${PYTHON_INCLUDE_DIRS})
+execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"from __future__ import print_function\ntry:\n import numpy\n import os\n inc_path = numpy.get_include()\n if os.path.exists(os.path.join(inc_path, 'numpy', 'arrayobject.h')):\n print(inc_path, end='')\nexcept:\n pass"
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR)
# Build pyuhd library
-ADD_LIBRARY(pyuhd SHARED pyuhd.cpp)
-TARGET_INCLUDE_DIRECTORIES(pyuhd PUBLIC
+add_library(pyuhd SHARED pyuhd.cpp)
+target_include_directories(pyuhd PUBLIC
${PYTHON_NUMPY_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/lib
)
-TARGET_LINK_LIBRARIES(pyuhd ${BOOST_PYTHON_LIBRARY} ${Boost_LIBRARIES} ${PYTHON_LIBRARY} uhd)
+target_link_libraries(pyuhd ${BOOST_PYTHON_LIBRARY} ${Boost_LIBRARIES} ${PYTHON_LIBRARY} uhd)
# Copy pyuhd library to the staging directory
-IF(WIN32)
- SET(PYUHD_LIBRARY_NAME libpyuhd.pyd)
-ELSE()
- SET(PYUHD_LIBRARY_NAME libpyuhd${CMAKE_SHARED_LIBRARY_SUFFIX})
-ENDIF(WIN32)
+if(WIN32)
+ set(PYUHD_LIBRARY_NAME libpyuhd.pyd)
+else()
+ set(PYUHD_LIBRARY_NAME libpyuhd${CMAKE_SHARED_LIBRARY_SUFFIX})
+endif(WIN32)
-ADD_CUSTOM_COMMAND(TARGET pyuhd
+add_custom_command(TARGET pyuhd
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pyuhd> ${CMAKE_CURRENT_BINARY_DIR}/uhd/${PYUHD_LIBRARY_NAME})
-SET(PYUHD_FILES
+set(PYUHD_FILES
${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
${CMAKE_CURRENT_SOURCE_DIR}/types.py
${CMAKE_CURRENT_SOURCE_DIR}/usrp.py
${CMAKE_CURRENT_SOURCE_DIR}/filters.py
)
-SET(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in")
-SET(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py")
-SET(TIMESTAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp")
+set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in")
+set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py")
+set(TIMESTAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp")
-CONFIGURE_FILE(${SETUP_PY_IN} ${SETUP_PY})
+configure_file(${SETUP_PY_IN} ${SETUP_PY})
-ADD_CUSTOM_COMMAND(OUTPUT ${TIMESTAMP_FILE}
+add_custom_command(OUTPUT ${TIMESTAMP_FILE}
COMMAND ${CMAKE_COMMAND} -E copy ${PYUHD_FILES} ${CMAKE_CURRENT_BINARY_DIR}/uhd
COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} -q build
COMMAND ${CMAKE_COMMAND} -E touch ${TIMESTAMP_FILE}
DEPENDS ${PYUHD_FILES})
-ADD_CUSTOM_TARGET(pyuhd_library ALL DEPENDS ${TIMESTAMP_FILE} pyuhd)
-IF(HAVE_PYTHON_VIRTUALENV)
+add_custom_target(pyuhd_library ALL DEPENDS ${TIMESTAMP_FILE} pyuhd)
+if(HAVE_PYTHON_VIRTUALENV)
# In virtualenvs, let setuptools do its thing
- INSTALL(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} -q install --force)")
-ELSE()
+ install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} -q install --force)")
+else()
# Otherwise, use distutils to determine the correct relative path for Python
# packages, and install to our prefix
- IF(NOT DEFINED UHD_PYTHON_DIR)
+ if(NOT DEFINED UHD_PYTHON_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
"from __future__ import print_function;\
from distutils import sysconfig;\
print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}'));"
OUTPUT_VARIABLE UHD_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
- ENDIF(NOT DEFINED UHD_PYTHON_DIR)
+ endif(NOT DEFINED UHD_PYTHON_DIR)
file(TO_CMAKE_PATH ${UHD_PYTHON_DIR} UHD_PYTHON_DIR)
- MESSAGE(STATUS "Utilizing the python install directory: ${UHD_PYTHON_DIR}")
- INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/uhd DESTINATION ${UHD_PYTHON_DIR} COMPONENT pythonapi)
-ENDIF(HAVE_PYTHON_VIRTUALENV)
+ message(STATUS "Utilizing the python install directory: ${UHD_PYTHON_DIR}")
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/uhd DESTINATION ${UHD_PYTHON_DIR} COMPONENT pythonapi)
+endif(HAVE_PYTHON_VIRTUALENV)
diff --git a/host/tests/CMakeLists.txt b/host/tests/CMakeLists.txt
index 0424b1b53..4b068321b 100644
--- a/host/tests/CMakeLists.txt
+++ b/host/tests/CMakeLists.txt
@@ -13,15 +13,15 @@ include(UHDUnitTest)
########################################################################
# build test common
########################################################################
-SET(test_common_SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/common)
-ADD_SUBDIRECTORY(common)
-LINK_DIRECTORIES(test_common_SOURCEDIR)
+set(test_common_SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}/common)
+add_subdirectory(common)
+link_directories(test_common_SOURCEDIR)
########################################################################
# unit test suite
########################################################################
-SET(test_sources
+set(test_sources
addr_test.cpp
buffer_test.cpp
byteswap_test.cpp
@@ -55,10 +55,10 @@ SET(test_sources
)
#turn each test cpp file into an executable with an int main() function
-ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
+add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
-IF(ENABLE_RFNOC)
- LIST(APPEND test_sources
+if(ENABLE_RFNOC)
+ list(APPEND test_sources
block_id_test.cpp
blockdef_test.cpp
device3_test.cpp
@@ -68,10 +68,10 @@ IF(ENABLE_RFNOC)
stream_sig_test.cpp
tick_node_test.cpp
)
-ENDIF(ENABLE_RFNOC)
+endif(ENABLE_RFNOC)
-IF(ENABLE_C_API)
- LIST(APPEND test_sources
+if(ENABLE_C_API)
+ list(APPEND test_sources
eeprom_c_test.c
error_c_test.cpp
ranges_c_test.c
@@ -79,54 +79,54 @@ IF(ENABLE_C_API)
string_vector_c_test.c
subdev_spec_c_test.c
)
-ENDIF(ENABLE_C_API)
+endif(ENABLE_C_API)
-INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/lib/include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/common")
+include_directories("${CMAKE_SOURCE_DIR}/lib/include")
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/common")
#for each source: build an executable, register it as a test
-FOREACH(test_source ${test_sources})
- GET_FILENAME_COMPONENT(test_name ${test_source} NAME_WE)
- ADD_EXECUTABLE(${test_name} ${test_source})
- TARGET_LINK_LIBRARIES(${test_name} uhd uhd_test ${Boost_LIBRARIES})
+foreach(test_source ${test_sources})
+ get_filename_component(test_name ${test_source} NAME_WE)
+ add_executable(${test_name} ${test_source})
+ target_link_libraries(${test_name} uhd uhd_test ${Boost_LIBRARIES})
UHD_ADD_TEST(${test_name} ${test_name})
UHD_INSTALL(TARGETS ${test_name} RUNTIME DESTINATION ${PKG_LIB_DIR}/tests COMPONENT tests)
-ENDFOREACH(test_source)
+endforeach(test_source)
# Other tests that don't directly link with libuhd: (TODO find a nicer way to do this)
-INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/lib/rfnoc/nocscript/)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/)
-ADD_EXECUTABLE(nocscript_expr_test
+include_directories(${CMAKE_BINARY_DIR}/lib/rfnoc/nocscript/)
+include_directories(${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/)
+add_executable(nocscript_expr_test
nocscript_expr_test.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/expression.cpp
)
-TARGET_LINK_LIBRARIES(nocscript_expr_test uhd ${Boost_LIBRARIES})
+target_link_libraries(nocscript_expr_test uhd ${Boost_LIBRARIES})
UHD_ADD_TEST(nocscript_expr_test nocscript_expr_test)
UHD_INSTALL(TARGETS nocscript_expr_test RUNTIME DESTINATION ${PKG_LIB_DIR}/tests COMPONENT tests)
-ADD_EXECUTABLE(nocscript_ftable_test
+add_executable(nocscript_ftable_test
nocscript_ftable_test.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/function_table.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/expression.cpp
)
-TARGET_LINK_LIBRARIES(nocscript_ftable_test uhd ${Boost_LIBRARIES})
+target_link_libraries(nocscript_ftable_test uhd ${Boost_LIBRARIES})
UHD_ADD_TEST(nocscript_ftable_test nocscript_ftable_test)
UHD_INSTALL(TARGETS nocscript_ftable_test RUNTIME DESTINATION ${PKG_LIB_DIR}/tests COMPONENT tests)
-ADD_EXECUTABLE(nocscript_parser_test
+add_executable(nocscript_parser_test
nocscript_parser_test.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/parser.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/function_table.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/nocscript/expression.cpp
)
-TARGET_LINK_LIBRARIES(nocscript_parser_test uhd ${Boost_LIBRARIES})
+target_link_libraries(nocscript_parser_test uhd ${Boost_LIBRARIES})
UHD_ADD_TEST(nocscript_parser_test nocscript_parser_test)
UHD_INSTALL(TARGETS nocscript_parser_test RUNTIME DESTINATION ${PKG_LIB_DIR}/tests COMPONENT tests)
-ADD_EXECUTABLE(config_parser_test
+add_executable(config_parser_test
config_parser_test.cpp
${CMAKE_SOURCE_DIR}/lib/utils/config_parser.cpp
)
-TARGET_LINK_LIBRARIES(config_parser_test uhd ${Boost_LIBRARIES})
+target_link_libraries(config_parser_test uhd ${Boost_LIBRARIES})
UHD_ADD_TEST(config_parser_test config_parser_test)
UHD_INSTALL(TARGETS
config_parser_test
@@ -135,21 +135,21 @@ UHD_INSTALL(TARGETS
COMPONENT tests
)
-ADD_EXECUTABLE(paths_test
+add_executable(paths_test
paths_test.cpp
${CMAKE_SOURCE_DIR}/lib/utils/pathslib.cpp
)
# Careful: This is to satisfy the out-of-library build of paths.cpp. This is
# duplicate code from lib/utils/CMakeLists.txt, and it's been simplified.
-SET(UHD_LIB_DIR "lib")
-FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH)
-STRING(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}")
-SET_SOURCE_FILES_PROPERTIES(
+set(UHD_LIB_DIR "lib")
+file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH)
+string(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}")
+set_source_files_properties(
${CMAKE_SOURCE_DIR}/lib/utils/paths.cpp
PROPERTIES COMPILE_DEFINITIONS
"UHD_PKG_PATH=\"${UHD_PKG_PATH}\";UHD_LIB_DIR=\"${UHD_LIB_DIR}\""
)
-TARGET_LINK_LIBRARIES(paths_test uhd ${Boost_LIBRARIES})
+target_link_libraries(paths_test uhd ${Boost_LIBRARIES})
UHD_ADD_TEST(paths_test paths_test)
UHD_INSTALL(TARGETS
paths_test
@@ -161,9 +161,9 @@ UHD_INSTALL(TARGETS
########################################################################
# demo of a loadable module
########################################################################
-IF(MSVC OR APPLE OR LINUX)
- ADD_LIBRARY(module_test MODULE module_test.cpp)
- TARGET_LINK_LIBRARIES(module_test uhd)
-ENDIF()
+if(MSVC OR APPLE OR LINUX)
+ add_library(module_test MODULE module_test.cpp)
+ target_link_libraries(module_test uhd)
+endif()
-ADD_SUBDIRECTORY(devtest)
+add_subdirectory(devtest)
diff --git a/host/tests/common/CMakeLists.txt b/host/tests/common/CMakeLists.txt
index 91a70dfae..e48e85c2f 100644
--- a/host/tests/common/CMakeLists.txt
+++ b/host/tests/common/CMakeLists.txt
@@ -7,8 +7,8 @@
########################################################################
# Build uhd_test static lib
########################################################################
-INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/lib/include")
-ADD_LIBRARY(uhd_test ${CMAKE_CURRENT_SOURCE_DIR}/mock_ctrl_iface_impl.cpp
+include_directories("${CMAKE_SOURCE_DIR}/lib/include")
+add_library(uhd_test ${CMAKE_CURRENT_SOURCE_DIR}/mock_ctrl_iface_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/mock_zero_copy.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/graph_impl.cpp
${CMAKE_SOURCE_DIR}/lib/rfnoc/async_msg_handler.cpp
diff --git a/host/tests/devtest/CMakeLists.txt b/host/tests/devtest/CMakeLists.txt
index 0bce8050d..69acc638f 100644
--- a/host/tests/devtest/CMakeLists.txt
+++ b/host/tests/devtest/CMakeLists.txt
@@ -6,10 +6,10 @@
#
# Formatting
-MESSAGE(STATUS "")
+message(STATUS "")
# All devtest files get installed:
-FILE(GLOB py_devtest_files "*.py")
+file(GLOB py_devtest_files "*.py")
UHD_INSTALL(PROGRAMS
${py_devtest_files}
DESTINATION ${PKG_LIB_DIR}/tests/devtest
@@ -20,9 +20,9 @@ UHD_INSTALL(PROGRAMS
# - pattern: This will be used to identify which devtest_*.py is to be executed.
# - filter: Will be used in args strings as "type=<filter>".
# - devtype: A descriptive string. Is only used for CMake output.
-MACRO(ADD_DEVTEST pattern filter devtype)
- MESSAGE(STATUS "Adding ${devtype} device test target")
- ADD_CUSTOM_TARGET("test_${pattern}"
+macro(ADD_DEVTEST pattern filter devtype)
+ message(STATUS "Adding ${devtype} device test target")
+ add_custom_target("test_${pattern}"
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/run_testsuite.py
"--src-dir" "${CMAKE_CURRENT_SOURCE_DIR}"
"--devtest-pattern" "${pattern}"
@@ -32,20 +32,20 @@ MACRO(ADD_DEVTEST pattern filter devtype)
COMMENT "Running device test on all connected ${devtype} devices:"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
-ENDMACRO(ADD_DEVTEST)
+endmacro(ADD_DEVTEST)
-IF(ENABLE_B200)
+if(ENABLE_B200)
ADD_DEVTEST("b2xx" "b200" "B2XX")
-ENDIF(ENABLE_B200)
-IF(ENABLE_X300)
+endif(ENABLE_B200)
+if(ENABLE_X300)
ADD_DEVTEST("x3x0" "x300" "X3x0")
-ENDIF(ENABLE_X300)
-IF(ENABLE_E300)
+endif(ENABLE_X300)
+if(ENABLE_E300)
ADD_DEVTEST("e3xx" "e3x0" "E3XX")
-ENDIF(ENABLE_E300)
-IF(ENABLE_MPMD)
+endif(ENABLE_E300)
+if(ENABLE_MPMD)
ADD_DEVTEST("n3x0" "n3xx" "N3XX")
ADD_DEVTEST("e320" "e3xx" "E32x")
-ENDIF(ENABLE_MPMD)
+endif(ENABLE_MPMD)
# Formatting
-MESSAGE(STATUS "")
+message(STATUS "")
diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt
index b8dd70a54..4e8d8e5f0 100644
--- a/host/utils/CMakeLists.txt
+++ b/host/utils/CMakeLists.txt
@@ -8,7 +8,7 @@
########################################################################
# Utilities that get installed into the runtime path
########################################################################
-SET(util_runtime_sources
+set(util_runtime_sources
uhd_config_info.cpp
uhd_find_devices.cpp
uhd_usrp_probe.cpp
@@ -19,89 +19,89 @@ SET(util_runtime_sources
)
find_package(UDev)
-IF(ENABLE_E300 AND NOT E300_FORCE_NETWORK)
- IF(UDEV_FOUND)
- LIST(APPEND util_runtime_sources usrp_e3x0_network_mode.cpp)
- ENDIF(UDEV_FOUND)
-ENDIF(ENABLE_E300 AND NOT E300_FORCE_NETWORK)
+if(ENABLE_E300 AND NOT E300_FORCE_NETWORK)
+ if(UDEV_FOUND)
+ list(APPEND util_runtime_sources usrp_e3x0_network_mode.cpp)
+ endif(UDEV_FOUND)
+endif(ENABLE_E300 AND NOT E300_FORCE_NETWORK)
#for each source: build an executable and install
-FOREACH(util_source ${util_runtime_sources})
- GET_FILENAME_COMPONENT(util_name ${util_source} NAME_WE)
- ADD_EXECUTABLE(${util_name} ${util_source})
- TARGET_LINK_LIBRARIES(${util_name} uhd ${Boost_LIBRARIES})
+foreach(util_source ${util_runtime_sources})
+ get_filename_component(util_name ${util_source} NAME_WE)
+ add_executable(${util_name} ${util_source})
+ target_link_libraries(${util_name} uhd ${Boost_LIBRARIES})
UHD_INSTALL(TARGETS ${util_name} RUNTIME DESTINATION ${RUNTIME_DIR} COMPONENT utilities)
-ENDFOREACH(util_source)
+endforeach(util_source)
########################################################################
# Utilities that get installed into the share path
########################################################################
-SET(util_share_sources
+set(util_share_sources
converter_benchmark.cpp
query_gpsdo_sensors.cpp
usrp_burn_db_eeprom.cpp
usrp_burn_mb_eeprom.cpp
)
-SET(util_share_sources_py
+set(util_share_sources_py
converter_benchmark.py
)
-IF(ENABLE_USB)
- LIST(APPEND util_share_sources
+if(ENABLE_USB)
+ list(APPEND util_share_sources
fx2_init_eeprom.cpp
)
- INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS})
- IF(ENABLE_B200)
- LIST(APPEND util_share_sources
+ include_directories(${LIBUSB_INCLUDE_DIRS})
+ if(ENABLE_B200)
+ list(APPEND util_share_sources
b2xx_fx3_utils.cpp
)
# Additional include directories for b2xx_fx3_utils
- INCLUDE_DIRECTORIES(
+ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../lib/include
${CMAKE_CURRENT_SOURCE_DIR}/../lib/usrp/b200
${CMAKE_CURRENT_SOURCE_DIR}/../lib/usrp/common
${CMAKE_CURRENT_SOURCE_DIR}/../lib/usrp/common/ad9361_driver
)
- ENDIF(ENABLE_B200)
-ENDIF(ENABLE_USB)
-IF(ENABLE_OCTOCLOCK)
- LIST(APPEND util_share_sources
+ endif(ENABLE_B200)
+endif(ENABLE_USB)
+if(ENABLE_OCTOCLOCK)
+ list(APPEND util_share_sources
octoclock_burn_eeprom.cpp
)
-ENDIF(ENABLE_OCTOCLOCK)
+endif(ENABLE_OCTOCLOCK)
-IF(LINUX AND ENABLE_USB)
+if(LINUX AND ENABLE_USB)
UHD_INSTALL(FILES
uhd-usrp.rules
DESTINATION ${PKG_LIB_DIR}/utils
COMPONENT utilities
)
-ENDIF(LINUX AND ENABLE_USB)
+endif(LINUX AND ENABLE_USB)
#for each source: build an executable and install
-FOREACH(util_source ${util_share_sources})
- GET_FILENAME_COMPONENT(util_name ${util_source} NAME_WE)
- ADD_EXECUTABLE(${util_name} ${util_source})
- TARGET_LINK_LIBRARIES(${util_name} uhd ${Boost_LIBRARIES})
+foreach(util_source ${util_share_sources})
+ get_filename_component(util_name ${util_source} NAME_WE)
+ add_executable(${util_name} ${util_source})
+ target_link_libraries(${util_name} uhd ${Boost_LIBRARIES})
UHD_INSTALL(TARGETS ${util_name} RUNTIME DESTINATION ${PKG_LIB_DIR}/utils COMPONENT utilities)
-ENDFOREACH(util_source)
-FOREACH(util_source ${util_share_sources_py})
+endforeach(util_source)
+foreach(util_source ${util_share_sources_py})
UHD_INSTALL(PROGRAMS
${CMAKE_CURRENT_SOURCE_DIR}/${util_source}
DESTINATION ${PKG_LIB_DIR}/utils
COMPONENT utilities
)
-ENDFOREACH(util_source)
+endforeach(util_source)
#UHD images downloader configuration
-FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/../../images/manifest.txt CMAKE_MANIFEST_CONTENTS)
-CONFIGURE_FILE(
+file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../../images/manifest.txt CMAKE_MANIFEST_CONTENTS)
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/uhd_images_downloader.py.in
${CMAKE_CURRENT_BINARY_DIR}/uhd_images_downloader.py
@ONLY)
# TODO: FIXME when know how.
# This is a hack to force cmake regenerate uhd_images_downloader.py
# whenever manifest.txt file changed.
-CONFIGURE_FILE(
+configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/../../images/manifest.txt
${CMAKE_CURRENT_SOURCE_DIR}/../../images/manifest.txt
COPYONLY)
@@ -111,26 +111,26 @@ UHD_INSTALL(PROGRAMS
DESTINATION ${PKG_LIB_DIR}/utils
COMPONENT utilities
)
-IF(LINUX)
+if(LINUX)
UHD_INSTALL(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/uhd_images_downloader.py
RENAME uhd_images_downloader
DESTINATION ${RUNTIME_DIR}
COMPONENT utilities
)
-ENDIF(LINUX)
-IF(NOT HAVE_PYTHON_MODULE_REQUESTS)
- MESSAGE(WARNING "Python module `requests' not found -- uhd_images_downloader.py will not work without it.")
- MESSAGE(WARNING "You may be able to install this by running 'pip install requests'")
-ENDIF(NOT HAVE_PYTHON_MODULE_REQUESTS)
+endif(LINUX)
+if(NOT HAVE_PYTHON_MODULE_REQUESTS)
+ message(WARNING "Python module `requests' not found -- uhd_images_downloader.py will not work without it.")
+ message(WARNING "You may be able to install this by running 'pip install requests'")
+endif(NOT HAVE_PYTHON_MODULE_REQUESTS)
-IF(ENABLE_USRP2)
- SET(burners
+if(ENABLE_USRP2)
+ set(burners
usrp2_card_burner.py
)
- IF(WIN32 AND UHD_RELEASE_MODE) #include dd.exe
- FILE(DOWNLOAD
+ if(WIN32 AND UHD_RELEASE_MODE) #include dd.exe
+ file(DOWNLOAD
"http://files.ettus.com/dd.exe"
${CMAKE_CURRENT_BINARY_DIR}/dd.exe
)
@@ -139,8 +139,8 @@ IF(ENABLE_USRP2)
DESTINATION ${PKG_LIB_DIR}/utils
COMPONENT utilities
)
- ENDIF(WIN32 AND UHD_RELEASE_MODE)
- IF(LINUX)
+ endif(WIN32 AND UHD_RELEASE_MODE)
+ if(LINUX)
UHD_INSTALL(PROGRAMS
usrp2_recovery.py
DESTINATION ${PKG_LIB_DIR}/utils
@@ -152,22 +152,22 @@ IF(ENABLE_USRP2)
DESTINATION ${RUNTIME_DIR}
COMPONENT utilities
)
- ENDIF(LINUX)
- FOREACH(burner ${burners})
+ endif(LINUX)
+ foreach(burner ${burners})
UHD_INSTALL(PROGRAMS
${burner}
DESTINATION ${PKG_LIB_DIR}/utils
COMPONENT utilities
)
- ENDFOREACH(burner ${burners})
+ endforeach(burner ${burners})
-ENDIF(ENABLE_USRP2)
+endif(ENABLE_USRP2)
########################################################################
# Other files that are not utilities or executables
########################################################################
-IF(WIN32)
- SET(windows_extra_files
+if(WIN32)
+ set(windows_extra_files
FastSendDatagramThreshold.reg
)
UHD_INSTALL(
@@ -175,6 +175,6 @@ IF(WIN32)
DESTINATION ${PKG_DATA_DIR}
COMPONENT utilities
)
-ENDIF(WIN32)
+endif(WIN32)
-ADD_SUBDIRECTORY(latency)
+add_subdirectory(latency)
diff --git a/host/utils/latency/CMakeLists.txt b/host/utils/latency/CMakeLists.txt
index 4ccfd3eba..05bacd77a 100644
--- a/host/utils/latency/CMakeLists.txt
+++ b/host/utils/latency/CMakeLists.txt
@@ -5,32 +5,32 @@
# SPDX-License-Identifier: GPL-3.0
#
-FIND_PACKAGE(Curses)
+find_package(Curses)
-IF(CURSES_FOUND)
- INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR})
- SET(latency_include_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
- INCLUDE_DIRECTORIES(${latency_include_dir})
- SET(latency_lib_path ${CMAKE_CURRENT_SOURCE_DIR}/lib/Responder.cpp)
+if(CURSES_FOUND)
+ include_directories(${CURSES_INCLUDE_DIR})
+ set(latency_include_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
+ include_directories(${latency_include_dir})
+ set(latency_lib_path ${CMAKE_CURRENT_SOURCE_DIR}/lib/Responder.cpp)
- SET(sources
+ set(sources
responder.cpp
)
- SET(latency_comp_name utilities)
- SET(latency_comp_dest ${PKG_LIB_DIR}/utils/latency)
+ set(latency_comp_name utilities)
+ set(latency_comp_dest ${PKG_LIB_DIR}/utils/latency)
#for each source: build an executable and install
- FOREACH(source ${sources})
- GET_FILENAME_COMPONENT(name ${source} NAME_WE)
- ADD_EXECUTABLE(${name} ${source} ${latency_lib_path})
+ foreach(source ${sources})
+ get_filename_component(name ${source} NAME_WE)
+ add_executable(${name} ${source} ${latency_lib_path})
LIBUHD_APPEND_SOURCES(${name})
- TARGET_LINK_LIBRARIES(${name} uhd ${Boost_LIBRARIES} ${CURSES_LIBRARIES})
+ target_link_libraries(${name} uhd ${Boost_LIBRARIES} ${CURSES_LIBRARIES})
UHD_INSTALL(TARGETS ${name} RUNTIME DESTINATION ${latency_comp_dest} COMPONENT ${latency_comp_name})
- ENDFOREACH(source)
+ endforeach(source)
UHD_INSTALL(PROGRAMS run_tests.py graph.py
DESTINATION ${latency_comp_dest}
COMPONENT ${latency_comp_name}
)
-ENDIF(CURSES_FOUND)
+endif(CURSES_FOUND)