Commit Graph

4 Commits

Author SHA1 Message Date
Daniel Leung
9eebe6a45e cmake: add WEST to cached variable
Commit 79b1f89f7d causes the WEST
variable to no longer cached in the CMakeCache. However,
the Eclipse plugin needs this WEST variable so that it can
invoke west properly. So tell CMake to put it in the cache.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-03 17:32:48 -04:00
Martí Bolívar
79b1f89f7d cmake: west detection fixes and improvements
Starting with west 0.8, we will have a stable way to run west as a
python module. In west 0.7, we have an undocumented way.

Handle these two cases to override the WEST variable used by the build
system to run west inside the same python interpreter as the rest of
the build system. This makes it intuitive to shell out to west from
elsewhere in the build, without making people reimplement existing
commands in the west API when it is not necessary.

Do so for the 'west topdir' invocation in west.cmake as an example.

The check that looks for whether PYTHON_EXECUTABLE and WEST_PYTHON
match is also not working properly when symbolic links are in use.
Fix it by using REALPATH instead of ABSOLUTE in the
get_filename_component() calls.

Finally, print the error on a failed import that we expect to work.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
Torsten Rasmussen
9ca3f61947 cmake: convert WEST_PYTHON path to be correct CMake style
The `WEST_PYTHON` reported by west (python) may use a different path
style (casing and separator) than the path style in CMake
find_package(Python3).

This may result in following additional error text when west version is
not meeting the minimum required version:

    The Python version used by west is:  c:\python37\python.exe
    The Python version used by CMake is: C:/Python37/python.exe
    This might be correct, but please verify your installation.

Using `get_filename_component` will return the path in same style as
CMake find_package(Python3).

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-06 13:49:08 +02:00
Torsten Rasmussen
25d57ba5af modules: adding support for ROOTs definitions in zephyr/module.yml
Fixes: #25215

This commit introduces the possibility of defining ROOTs in a Zephyr
module and have it automatically appended to list of other ROOTs.
Supported with this commit:
- BOARD_ROOT
- SOC_ROOT
- DTS_ROOT
- ARCH_ROOT

In order to support this in Zephyr module files, the detection of west
has been moved to dedicated west.cmake file and included immediately
after python.cmake.

Also the inclusion of zephyr_modules.cmake has moved before first use
of BOARD_ROOT.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-08-05 08:06:07 -04:00