1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-14 13:54:57 +00:00

make cmakelint happy

This commit is contained in:
Marc Majoral 2024-07-24 16:35:19 +02:00
parent 2df08c48fa
commit dadbbdf5d4
No known key found for this signature in database
GPG Key ID: 4CC7BE8C367C596C

View File

@ -3356,19 +3356,19 @@ endif()
# Check signal sources related to FPGA only. # Check signal sources related to FPGA only.
##################################################################### #####################################################################
if(ENABLE_MAX2771 AND NOT ENABLE_FPGA) if(ENABLE_MAX2771 AND NOT ENABLE_FPGA)
message(STATUS "The SPIdev driver is enabled, but the FPGA is not enabled. The FPGA is required when using the SPIdev driver.") message(STATUS "The SPIdev driver is enabled, but the FPGA is not enabled. The FPGA is required when using the SPIdev driver.")
if(ENABLE_PACKAGING) if(ENABLE_PACKAGING)
set(ENABLE_MAX2771 OFF) set(ENABLE_MAX2771 OFF)
else() else()
message(FATAL_ERROR "ENABLE_MAX2771 can only be set when ENABLE_FPGA is also set.") message(FATAL_ERROR "ENABLE_MAX2771 can only be set when ENABLE_FPGA is also set.")
endif() endif()
endif() endif()
if(ENABLE_DMA_PROXY AND NOT ENABLE_FPGA) if(ENABLE_DMA_PROXY AND NOT ENABLE_FPGA)
message(STATUS "The DMA Proxy driver is enabled, but the FPGA is not enabled. The FPGA is required when using the DMA Proxy driver.") message(STATUS "The DMA Proxy driver is enabled, but the FPGA is not enabled. The FPGA is required when using the DMA Proxy driver.")
if(ENABLE_PACKAGING) if(ENABLE_PACKAGING)
set(ENABLE_DMA_PROXY OFF) set(ENABLE_DMA_PROXY OFF)
else() else()
message(FATAL_ERROR "ENABLE_DMA_PROXY can only be set when ENABLE_FPGA is also set.") message(FATAL_ERROR "ENABLE_DMA_PROXY can only be set when ENABLE_FPGA is also set.")
endif() endif()
endif() endif()
@ -3380,13 +3380,13 @@ endif()
# Peripheral Interface) # Peripheral Interface)
##################################################################### #####################################################################
if(ENABLE_MAX2771) if(ENABLE_MAX2771)
if(DEFINED ENV{SDKTARGETSYSROOT}) if(DEFINED ENV{SDKTARGETSYSROOT})
set(TARGET_ROOTFS_PATH $ENV{SDKTARGETSYSROOT}) set(TARGET_ROOTFS_PATH $ENV{SDKTARGETSYSROOT})
else() else()
set(TARGET_ROOTFS_PATH "") set(TARGET_ROOTFS_PATH "")
endif() endif()
find_program(STRINGS_EXECUTABLE strings) find_program(STRINGS_EXECUTABLE strings)
if (NOT STRINGS_EXECUTABLE) if(NOT STRINGS_EXECUTABLE)
message(STATUS "The 'strings' command could not be found. See https://www.gnu.org/software/binutils/") message(STATUS "The 'strings' command could not be found. See https://www.gnu.org/software/binutils/")
message(STATUS " You can try to install it by typing:") message(STATUS " You can try to install it by typing:")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU")
@ -3399,31 +3399,31 @@ if(ENABLE_MAX2771)
endif() endif()
endif() endif()
message(FATAL_ERROR "Binutils are required to build GNSS-SDR for SoC FPGA devices using the MAX2771 option.") message(FATAL_ERROR "Binutils are required to build GNSS-SDR for SoC FPGA devices using the MAX2771 option.")
endif() endif()
set(DTB_FILE "${TARGET_ROOTFS_PATH}/boot/devicetree/system-top.dtb") set(DTB_FILE "${TARGET_ROOTFS_PATH}/boot/devicetree/system-top.dtb")
if (EXISTS "${DTB_FILE}") if(EXISTS "${DTB_FILE}")
message(STATUS "Found DTB file: ${DTB_FILE}") message(STATUS "Found DTB file: ${DTB_FILE}")
# Run the strings command and grep for "spidev" # Run the strings command and grep for "spidev"
execute_process( execute_process(
COMMAND ${STRINGS_EXECUTABLE} ${DTB_FILE} COMMAND ${STRINGS_EXECUTABLE} ${DTB_FILE}
COMMAND grep "spidev" COMMAND grep "spidev"
OUTPUT_VARIABLE GREP_OUTPUT OUTPUT_VARIABLE GREP_OUTPUT
RESULT_VARIABLE GREP_RESULT RESULT_VARIABLE GREP_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
if (GREP_RESULT EQUAL 0) if(GREP_RESULT EQUAL 0)
message(STATUS "Found spidev-compatible peripheral in ${DTB_FILE}.") message(STATUS "Found spidev-compatible peripheral in ${DTB_FILE}.")
else() else()
message(STATUS "SPIdev driver not found, its installation is required.") message(STATUS "SPIdev driver not found, its installation is required.")
if(ENABLE_PACKAGING) if(ENABLE_PACKAGING)
set(ENABLE_MAX2771 OFF) set(ENABLE_MAX2771 OFF)
else() else()
message(FATAL_ERROR "SPIdev driver is required for building gnss-sdr with -DENABLE_MAX2271=ON.") message(FATAL_ERROR "SPIdev driver is required for building gnss-sdr with -DENABLE_MAX2271=ON.")
endif() endif()
endif() endif()
else() else()
message(FATAL_ERROR "The device tree (DTB) file ${DTB_FILE} cannot be found.") message(FATAL_ERROR "The device tree (DTB) file ${DTB_FILE} cannot be found.")
endif() endif()
endif() endif()
@ -3434,21 +3434,21 @@ endif()
# to leverage DMA capabilities for Xilinx FPGA and SoC systems # to leverage DMA capabilities for Xilinx FPGA and SoC systems
##################################################################### #####################################################################
if(ENABLE_DMA_PROXY) if(ENABLE_DMA_PROXY)
if(DEFINED ENV{SDKTARGETSYSROOT}) if(DEFINED ENV{SDKTARGETSYSROOT})
set(TARGET_ROOTFS_PATH $ENV{SDKTARGETSYSROOT}) set(TARGET_ROOTFS_PATH $ENV{SDKTARGETSYSROOT})
else() else()
set(TARGET_ROOTFS_PATH "") set(TARGET_ROOTFS_PATH "")
endif() endif()
set(DMA_PROXY_FILE "${TARGET_ROOTFS_PATH}/lib/modules/5.10.0-xilinx-v2021.2/extra/dma-proxy.ko") set(DMA_PROXY_FILE "${TARGET_ROOTFS_PATH}/lib/modules/5.10.0-xilinx-v2021.2/extra/dma-proxy.ko")
if (EXISTS "${DMA_PROXY_FILE}") if(EXISTS "${DMA_PROXY_FILE}")
message(STATUS "Found dma-proxy.ko file: ${DMA_PROXY_FILE}") message(STATUS "Found dma-proxy.ko file: ${DMA_PROXY_FILE}")
else() else()
if(ENABLE_PACKAGING) if(ENABLE_PACKAGING)
set(ENABLE_DMA_PROXY OFF) set(ENABLE_DMA_PROXY OFF)
else() else()
message(FATAL_ERROR "DMA Proxy driver is required for building gnss-sdr with -DENABLE_DMA_PROXY=ON.") message(FATAL_ERROR "DMA Proxy driver is required for building gnss-sdr with -DENABLE_DMA_PROXY=ON.")
endif() endif()
endif() endif()
endif() endif()