cmake: modules: Prefer imgtool being in MCUboot directory

Changes the priority of imgtool so that the preferred version is
the one inside of the MCUboot directory

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2025-01-09 14:57:19 +00:00 committed by Benjamin Cabé
parent 09991d526a
commit 6db2c86d3a

View file

@ -61,9 +61,10 @@ find_program(OPENOCD openocd)
# bossac is an optional dependency
find_program(BOSSAC bossac)
# imgtool is an optional dependency (the build may also fall back to scripts/imgtool.py
# in the mcuboot repository if that's present in some cases)
find_program(IMGTOOL imgtool)
# imgtool is an optional dependency (prefer the version that is in the mcuboot repository, if
# present and a user has not specified a different version)
zephyr_get(IMGTOOL SYSBUILD LOCAL)
find_program(IMGTOOL imgtool.py HINTS ${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts/ NAMES imgtool NAMES_PER_DIR)
# winpty is an optional dependency
find_program(PTY_INTERFACE winpty)