Skip to content

Commit

Permalink
Search for custom upload method config
Browse files Browse the repository at this point in the history
  • Loading branch information
lefebvresam committed Jan 22, 2024
1 parent 033058a commit 8d7b1d7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tools/cmake/app.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,18 @@ endif()
# Load upload method configuration defaults for this target.
# Loading the settings here makes sure they are set at global scope, and also makes sure that
# the user can override them by changing variable values after including app.cmake.
set(EXPECTED_MBED_UPLOAD_CFG_FILE_PATH targets/upload_method_cfg/${MBED_TARGET}.cmake)
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../../${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH})

if(EXISTS ${CMAKE_SOURCE_DIR}/${MBED_TARGET}/${MBED_TARGET}.cmake)
set(EXPECTED_MBED_UPLOAD_CFG_FILE_PATH ${CMAKE_SOURCE_DIR}/${MBED_TARGET}/${MBED_TARGET}.cmake)
set(EXPECTED_MBED_UPLOAD_CFG_SEARCH_PATH ${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH})
else()
set(EXPECTED_MBED_UPLOAD_CFG_FILE_PATH targets/upload_method_cfg/${MBED_TARGET}.cmake)
set(EXPECTED_MBED_UPLOAD_CFG_SEARCH_PATH ${CMAKE_CURRENT_LIST_DIR}/../../${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH})
endif()

if(EXISTS ${EXPECTED_MBED_UPLOAD_CFG_SEARCH_PATH})
message(STATUS "Mbed: Loading default upload method configuration from ${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH}")
include(${CMAKE_CURRENT_LIST_DIR}/../../${EXPECTED_MBED_UPLOAD_CFG_FILE_PATH})
include(${EXPECTED_MBED_UPLOAD_CFG_SEARCH_PATH})
else()
message(STATUS "Mbed: Target does not have any upload method configuration. 'make flash-' commands will not be available unless configured by the upper-level project.")
set(UPLOAD_METHOD_DEFAULT "NONE")
Expand Down

0 comments on commit 8d7b1d7

Please sign in to comment.