mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
avoid calling find_package for pico-sdk-tools over and over again (#1403)
This commit is contained in:
parent
5d47872cb4
commit
8188adf98b
1 changed files with 14 additions and 9 deletions
|
|
@ -1,11 +1,14 @@
|
||||||
function(_pico_init_pioasm)
|
function(_pico_init_pioasm)
|
||||||
# Assemble the version string from components instead of using PICO_SDK_VERSION_STRING, because the version string
|
|
||||||
# potentially has a PRE_RELEASE_ID suffix, which will trip up the find_package call.
|
|
||||||
find_package(pico-sdk-tools "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}" QUIET CONFIG CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
if (NOT Pioasm_FOUND)
|
if (NOT Pioasm_FOUND)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PICO_SDK_PATH}/tools)
|
# Assemble the version string from components instead of using PICO_SDK_VERSION_STRING, because the version string
|
||||||
# todo CMAKE_CURRENT_FUNCTION_LIST_DIR ... what version?
|
# potentially has a PRE_RELEASE_ID suffix, which will trip up the find_package call.
|
||||||
find_package(Pioasm REQUIRED)
|
find_package(pico-sdk-tools "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}" QUIET CONFIG CMAKE_FIND_ROOT_PATH_BOTH)
|
||||||
|
|
||||||
|
if (NOT Pioasm_FOUND)
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PICO_SDK_PATH}/tools)
|
||||||
|
# todo CMAKE_CURRENT_FUNCTION_LIST_DIR ... what version?
|
||||||
|
find_package(Pioasm REQUIRED)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
@ -58,10 +61,12 @@ function(pico_add_uf2_output TARGET)
|
||||||
else()
|
else()
|
||||||
set(output_path "")
|
set(output_path "")
|
||||||
endif()
|
endif()
|
||||||
find_package(pico-sdk-tools "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}" QUIET CONFIG CMAKE_FIND_ROOT_PATH_BOTH)
|
|
||||||
if (NOT ELF2UF2_FOUND)
|
if (NOT ELF2UF2_FOUND)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PICO_SDK_PATH}/tools)
|
find_package(pico-sdk-tools "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}" QUIET CONFIG CMAKE_FIND_ROOT_PATH_BOTH)
|
||||||
find_package(ELF2UF2)
|
if (NOT ELF2UF2_FOUND)
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PICO_SDK_PATH}/tools)
|
||||||
|
find_package(ELF2UF2)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if (ELF2UF2_FOUND)
|
if (ELF2UF2_FOUND)
|
||||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue