aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/CMakeLists.txt
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/lib/transport/CMakeLists.txt
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/lib/transport/CMakeLists.txt')
-rw-r--r--host/lib/transport/CMakeLists.txt94
1 files changed, 47 insertions, 47 deletions
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()