zephyr/cmake
Torsten Rasmussen f96ee77c7c cmake: function to update Zephyr_DIR when loading old Zephyr packages
Fixes: #43094

This commit introduces a function which updates Zephyr_DIR to point to
the directory of the Zephyr package being loaded.

For Zephyr 3.0 and earlier, the Zephyr_DIR might in some cases be
`Zephyr_DIR-NOTFOUND` or pointing to the Zephyr package including the
boilerplate code instead of the Zephyr package of the included
boilerplate code.

This code ensures that when a package is loaded then Zephyr_DIR will
point correctly.
This ensures that when Zephyr releases <=3.0 is loaded, then Zephyr_DIR
will point correctly, see more in #43094.

Old style Zephyr package will in some cases load boilerplate.cmake
directly so to ensure proper behavior, restrict boilerplate uses of
`find_package(Zephyr)` to not use default search path, but allow only
the current Zephyr.

Of the same reason, only print warning if Zephyr_DIR is not defined as
this indicates old style inclusion.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-03-07 16:35:54 +01:00
..
app cmake: function to update Zephyr_DIR when loading old Zephyr packages 2022-03-07 16:35:54 +01:00
bintools cmake: support ELF image adjustment 2022-01-22 16:57:31 -05:00
compiler cmake: Add xcc-clang toolchain 2022-02-25 11:17:06 -05:00
emu soc: mips: add Qemu Malta support 2022-01-19 13:48:21 -05:00
flash cmake: support multiple entries in board.cmake 2021-11-12 21:33:42 -05:00
ide license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
linker kernel/init.c: allow for memset/memcpy alternatives during early boot 2022-02-21 21:00:12 -05:00
linker_script cmake: linker: Automatically generates memory regions 2022-02-21 22:02:04 -05:00
makefile_exports cmake: using zephyr_get_compile_options_for_lang_as_string for export 2020-12-15 08:37:54 -05:00
modules cmake: move ZEPHYR_TOOLCHAIN_VARIANT export to common settings 2022-03-04 09:07:43 -06:00
reports build: reports: publish all reports 2021-07-21 14:54:30 +03:00
toolchain cmake: Add xcc-clang toolchain 2022-02-25 11:17:06 -05:00
usage cmake: boards and shields cmake files repurposed 2022-02-22 10:02:39 -08:00
util license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
cfb.cmake cmake: using ${ZEPHYR_BASE} instead of $ENV{ZEPHYR_BASE} 2020-03-27 16:23:46 +01:00
extra_flags.cmake cmake: extra_flags: fix EXTRA_CPPFLAGS being applied as macros 2019-12-13 13:23:40 -05:00
gcc-m-cpu.cmake cmake: add the gcc -mcpu parameter value for the Cortex-A9 CPU 2021-10-28 15:26:50 +02:00
gen_version_h.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
hex.cmake license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
kobj.cmake cmake: improved handling of output and byproducts in CMake 2021-02-14 18:09:24 -05:00
mcuboot.cmake module: mcuboot: Add config option to support unsigned binary generation 2021-12-18 07:20:38 -05:00
package_helper.cmake cmake: package_helper CMake script 2022-02-23 11:34:22 -08:00
pristine.cmake cmake: pristine.cmake requires SOURCE_DIR and BINARY_DIR as arguments 2021-01-23 08:31:13 -05:00
target_toolchain_flags.cmake cmake: CMake compile features support 2021-10-01 14:40:33 -04:00