From a69ab0c23a0c38e3fed3e412df36538d8959d23c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 13 Nov 2018 21:53:22 -0800 Subject: 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!) --- host/lib/transport/nirio/CMakeLists.txt | 8 +++---- host/lib/transport/nirio/lvbitx/CMakeLists.txt | 32 +++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'host/lib/transport/nirio') 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) -- cgit v1.2.3