From 26a35ebceedfbef46c081b61cbf7a170d46cfd10 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 13 Nov 2016 20:24:51 +0100 Subject: [PATCH] [9XR-PRO] CMake error when Mike's bootloader is not correctly downloaded --- radio/src/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index a954a75a6..abd01cb07 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -376,7 +376,12 @@ if(NOT MSVC) set(FIRMWARE_DEPENDENCIES ${FIRMWARE_DEPENDENCIES} bootloader) else() # We fetch Mike's bootloader as it is not included inside OpenTX - file(DOWNLOAD https://github.com/MikeBland/OpenRcBootloader/releases/download/V1.9/${BOOTLOADER} ${CMAKE_CURRENT_BINARY_DIR}/bootloader.lbm) + message(STATUS "Downloading Mike's bootloader: https://github.com/MikeBland/OpenRcBootloader/releases/download/V1.9/${BOOTLOADER}") + file(DOWNLOAD https://github.com/MikeBland/OpenRcBootloader/releases/download/V1.9/${BOOTLOADER} ${CMAKE_CURRENT_BINARY_DIR}/bootloader.lbm STATUS status) + list(GET status 0 error_code) + if(error_code) + message(FATAL_ERROR "Failed to download Mike's bootloader: ${status}") + endif() endif() add_executable(firmware ${SRC} ${FIRMWARE_HEADERS})