cmake: propagating zephyr base to west
West utilizes Zephyr base when invoked out-of-tree in order to determine west topdir. This commit ensures that zephyr base when invoking west from CMake is set to current zephyr base. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
d7862cf776
commit
39cd4c8f52
3 changed files with 10 additions and 6 deletions
|
@ -38,11 +38,12 @@ else()
|
||||||
# even after output is one line.
|
# even after output is one line.
|
||||||
message(STATUS "Found west: ${WEST} (found suitable version \"${west_version}\", minimum required is \"${MIN_WEST_VERSION}\")")
|
message(STATUS "Found west: ${WEST} (found suitable version \"${west_version}\", minimum required is \"${MIN_WEST_VERSION}\")")
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${WEST} topdir
|
COMMAND ${WEST} topdir
|
||||||
OUTPUT_VARIABLE WEST_TOPDIR
|
OUTPUT_VARIABLE WEST_TOPDIR
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
WORKING_DIRECTORY ${ZEPHYR_BASE}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# dtc is an optional dependency. Search for it on PATH and in
|
# dtc is an optional dependency. Search for it on PATH and in
|
||||||
|
|
|
@ -21,7 +21,7 @@ endif()
|
||||||
set(KCONFIG_MODULES_FILE ${CMAKE_BINARY_DIR}/Kconfig.modules)
|
set(KCONFIG_MODULES_FILE ${CMAKE_BINARY_DIR}/Kconfig.modules)
|
||||||
|
|
||||||
if(WEST)
|
if(WEST)
|
||||||
set(WEST_ARG "--west-path" ${WEST})
|
set(WEST_ARG "--west-path" ${WEST} "--zephyr-base" ${ZEPHYR_BASE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WEST OR ZEPHYR_MODULES)
|
if(WEST OR ZEPHYR_MODULES)
|
||||||
|
|
|
@ -178,10 +178,13 @@ def main():
|
||||||
help='List of extra modules to parse')
|
help='List of extra modules to parse')
|
||||||
parser.add_argument('-w', '--west-path', default='west',
|
parser.add_argument('-w', '--west-path', default='west',
|
||||||
help='Path to west executable')
|
help='Path to west executable')
|
||||||
|
parser.add_argument('-z', '--zephyr-base',
|
||||||
|
help='Path to zephyr repository')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.modules is None:
|
if args.modules is None:
|
||||||
p = subprocess.Popen([args.west_path, 'list', '--format={posixpath}'],
|
p = subprocess.Popen([args.west_path, 'list', '--format={posixpath}'],
|
||||||
|
cwd=args.zephyr_base,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue