This commit introduces ZEPHYR_BASE as a cached variable, ensures that
once ZEPHYR_BASE has been set in a project, it is sticky.
Using cached variable also allows users to reconfigure ZEPHYR_BASE if
they so wish.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit adds the possibility of using a Zephyr repository package
base even when it has not been exported to CMake package registry.
It also introduces the possibility of locating and using Zephyr
CMake config package correctly when invoking CMake on an out-of-tree
project.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
When ZephyrConfig package is being version checked, then
ZephyrConfigVersion.cmake loads version.cmake.
This causes a print message, such as the following to happen:
-- Zephyr version: 2.2.0
Now, in case a user has multiple Zephyr installations, this could
result in something similar to:
-- Zephyr version: 2.2.0
-- Zephyr version: 2.x.0
-- Zephyr version: 3.x.0
being printed.
This commit add the possibility to disable version printing.
With new Zephyr base find_package, printing of ZEPHYR_BASE is added
after the version, in order to make it easy for users to see which
Zephyr is used.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
suggested change: print ZEPHYR_BASE
Adding ZephyrConfig.cmake and ZephyrConfigVersion.cmake allows projects
to use find_package to locate Zephyr.
This means that it will be possible to allow users to run CMake without
the need to source zephyr-env.sh or run zephyr-env.cmd.
This is especially useful for IDEs such as Eclipse or SES, where it will
no longer be required to source the above files before launching the
IDE.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>