Skip to content

Commit 6db2c86

Browse files
nordicjmkartben
authored andcommitted
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>
1 parent 09991d5 commit 6db2c86

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmake/modules/FindHostTools.cmake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ find_program(OPENOCD openocd)
6161
# bossac is an optional dependency
6262
find_program(BOSSAC bossac)
6363

64-
# imgtool is an optional dependency (the build may also fall back to scripts/imgtool.py
65-
# in the mcuboot repository if that's present in some cases)
66-
find_program(IMGTOOL imgtool)
64+
# imgtool is an optional dependency (prefer the version that is in the mcuboot repository, if
65+
# present and a user has not specified a different version)
66+
zephyr_get(IMGTOOL SYSBUILD LOCAL)
67+
find_program(IMGTOOL imgtool.py HINTS ${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts/ NAMES imgtool NAMES_PER_DIR)
6768

6869
# winpty is an optional dependency
6970
find_program(PTY_INTERFACE winpty)

0 commit comments

Comments
 (0)