aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake/Modules/UHDConfig.cmake.in
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/cmake/Modules/UHDConfig.cmake.in
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/cmake/Modules/UHDConfig.cmake.in')
-rw-r--r--host/cmake/Modules/UHDConfig.cmake.in96
1 files changed, 48 insertions, 48 deletions
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()