cmake: Use path-corrected version of ZEPHYR_BASE

Instead of accessing the environment variable ZEPHYR_BASE every time we
require accessing the source code root, use an intermediate variable
that has OS path separators correctly set to '/' to avoid issues on
Windows.

Note: This removes the ZEPHYR_SOURCE_DIR CMake variable. External
applications using that will need to change to use the new ZEPHYR_BASE
variable.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2018-01-11 15:46:44 +01:00 committed by Anas Nashif
parent e09646ab12
commit 7d764b35f3
75 changed files with 118 additions and 115 deletions

View file

@ -279,7 +279,7 @@ else()
set(LINKER_SCRIPT ${BOARD_DIR}/linker.ld) set(LINKER_SCRIPT ${BOARD_DIR}/linker.ld)
if(NOT EXISTS ${LINKER_SCRIPT}) if(NOT EXISTS ${LINKER_SCRIPT})
# If not available, try an SoC specific linker file # If not available, try an SoC specific linker file
set(LINKER_SCRIPT $ENV{ZEPHYR_BASE}/arch/${ARCH}/soc/${SOC_PATH}/linker.ld) set(LINKER_SCRIPT ${ZEPHYR_BASE}/arch/${ARCH}/soc/${SOC_PATH}/linker.ld)
endif() endif()
endif() endif()
@ -348,7 +348,7 @@ add_custom_command(OUTPUT include/generated/syscall_dispatch.c ${syscall_list_h}
# Generate offsets.c.obj from offsets.c # Generate offsets.c.obj from offsets.c
# Generate offsets.h from offsets.c.obj # Generate offsets.h from offsets.c.obj
set(OFFSETS_C_PATH $ENV{ZEPHYR_BASE}/arch/${ARCH}/core/offsets/offsets.c) set(OFFSETS_C_PATH ${ZEPHYR_BASE}/arch/${ARCH}/core/offsets/offsets.c)
set(OFFSETS_O_PATH ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/offsets.dir/arch/${ARCH}/core/offsets/offsets.c.obj) set(OFFSETS_O_PATH ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/offsets.dir/arch/${ARCH}/core/offsets/offsets.c.obj)
set(OFFSETS_H_PATH ${PROJECT_BINARY_DIR}/include/generated/offsets.h) set(OFFSETS_H_PATH ${PROJECT_BINARY_DIR}/include/generated/offsets.h)
@ -361,7 +361,7 @@ add_dependencies( offsets
add_custom_command( add_custom_command(
OUTPUT ${OFFSETS_H_PATH} OUTPUT ${OFFSETS_H_PATH}
COMMAND ${PYTHON_EXECUTABLE} $ENV{ZEPHYR_BASE}/scripts/gen_offset_header.py COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/gen_offset_header.py
-i ${OFFSETS_O_PATH} -i ${OFFSETS_O_PATH}
-o ${OFFSETS_H_PATH} -o ${OFFSETS_H_PATH}
DEPENDS offsets DEPENDS offsets
@ -612,7 +612,7 @@ if(CONFIG_GEN_ISR_TABLES)
$<TARGET_FILE:zephyr_prebuilt> $<TARGET_FILE:zephyr_prebuilt>
isrList.bin isrList.bin
COMMAND ${PYTHON_EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE}
$ENV{ZEPHYR_BASE}/arch/common/gen_isr_tables.py ${ZEPHYR_BASE}/arch/common/gen_isr_tables.py
--output-source isr_tables.c --output-source isr_tables.c
--intlist isrList.bin --intlist isrList.bin
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--debug> $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--debug>
@ -624,8 +624,8 @@ if(CONFIG_GEN_ISR_TABLES)
endif() endif()
if(CONFIG_USERSPACE) if(CONFIG_USERSPACE)
set(GEN_KOBJ_LIST $ENV{ZEPHYR_BASE}/scripts/gen_kobject_list.py) set(GEN_KOBJ_LIST ${ZEPHYR_BASE}/scripts/gen_kobject_list.py)
set(PROCESS_GPERF $ENV{ZEPHYR_BASE}/scripts/process_gperf.py) set(PROCESS_GPERF ${ZEPHYR_BASE}/scripts/process_gperf.py)
set(OBJ_LIST kobject_hash.gperf) set(OBJ_LIST kobject_hash.gperf)
set(OUTPUT_SRC_PRE kobject_hash_preprocessed.c) set(OUTPUT_SRC_PRE kobject_hash_preprocessed.c)
@ -792,7 +792,7 @@ set(post_build_commands "")
list_append_ifdef(CONFIG_CHECK_LINK_MAP list_append_ifdef(CONFIG_CHECK_LINK_MAP
post_build_commands post_build_commands
COMMAND ${PYTHON_EXECUTABLE} $ENV{ZEPHYR_BASE}/scripts/check_link_map.py ${KERNEL_MAP_NAME} COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/check_link_map.py ${KERNEL_MAP_NAME}
) )
list_append_ifdef( list_append_ifdef(
@ -863,7 +863,7 @@ if(CONFIG_OUTPUT_PRINT_MEMORY_USAGE)
endif() endif()
if(EMU_PLATFORM) if(EMU_PLATFORM)
include($ENV{ZEPHYR_BASE}/cmake/emu/${EMU_PLATFORM}.cmake) include(${ZEPHYR_BASE}/cmake/emu/${EMU_PLATFORM}.cmake)
else() else()
add_custom_target(run add_custom_target(run
COMMAND COMMAND

View file

@ -1,3 +1,3 @@
zephyr_include_directories($ENV{ZEPHYR_BASE}/drivers) zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_sources(soc.c) zephyr_sources(soc.c)
zephyr_sources_ifdef(CONFIG_GPIO soc_gpio.c) zephyr_sources_ifdef(CONFIG_GPIO soc_gpio.c)

View file

@ -1,4 +1,4 @@
zephyr_include_directories($ENV{ZEPHYR_BASE}/drivers) zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_sources( zephyr_sources(
soc.c soc.c
) )

View file

@ -1,4 +1,4 @@
zephyr_include_directories($ENV{ZEPHYR_BASE}/drivers) zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_sources( zephyr_sources(
soc.c soc.c
) )

View file

@ -1,4 +1,4 @@
zephyr_include_directories($ENV{ZEPHYR_BASE}/drivers) zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_sources( zephyr_sources(
soc.c soc.c
) )

View file

@ -1,4 +1,4 @@
zephyr_include_directories($ENV{ZEPHYR_BASE}/drivers) zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_sources( zephyr_sources(
soc.c soc.c
) )

View file

@ -10,5 +10,5 @@ board_runner_args(dfu-util "--pid=8087:0aba" "--alt=sensor_core")
set(PRE_LOAD targets 1) set(PRE_LOAD targets 1)
board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"" "--gdb-port=3334") board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"" "--gdb-port=3334")
include($ENV{ZEPHYR_BASE}/boards/common/dfu-util.board.cmake) include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1,3 +1,3 @@
set(PRE_LOAD targets 1) set(PRE_LOAD targets 1)
board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"") board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"")
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1,3 +1,3 @@
board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse") board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
include($ENV{ZEPHYR_BASE}/boards/common/dfu-util.board.cmake) include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)

View file

@ -1,2 +1,2 @@
board_runner_args(pyocd "--target=nrf52") board_runner_args(pyocd "--target=nrf52")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -1,2 +1,2 @@
board_runner_args(dfu-util "--pid=8087:0aba" "--alt=ble_core") board_runner_args(dfu-util "--pid=8087:0aba" "--alt=ble_core")
include($ENV{ZEPHYR_BASE}/boards/common/dfu-util.board.cmake) include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/bossac.board.cmake) include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)

View file

@ -1,4 +1,4 @@
# Copyright (c) 2017 Google LLC. # Copyright (c) 2017 Google LLC.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1,2 +1,2 @@
board_runner_args(pyocd "--target=nrf51") board_runner_args(pyocd "--target=nrf51")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -10,6 +10,6 @@ endif()
board_runner_args(jlink "--device=MK64FN1M0xxx12") board_runner_args(jlink "--device=MK64FN1M0xxx12")
board_runner_args(pyocd "--target=k64f") board_runner_args(pyocd "--target=k64f")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -10,5 +10,5 @@ endif()
board_runner_args(jlink "--device=MKL25Z128xxx4") board_runner_args(jlink "--device=MKL25Z128xxx4")
board_runner_args(pyocd "--target=kl25z") board_runner_args(pyocd "--target=kl25z")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -10,5 +10,5 @@ endif()
board_runner_args(jlink "--device=MKW41Z512xxx4") board_runner_args(jlink "--device=MKW41Z512xxx4")
board_runner_args(pyocd "--target=kw41z4") board_runner_args(pyocd "--target=kw41z4")
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -10,5 +10,5 @@ endif()
board_runner_args(pyocd "--target=k64f") board_runner_args(pyocd "--target=k64f")
board_runner_args(jlink "--device=MK64FN1M0xxx12") board_runner_args(jlink "--device=MK64FN1M0xxx12")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -10,5 +10,5 @@ endif()
board_runner_args(jlink "--device=MKW40Z160xxx4") board_runner_args(jlink "--device=MKW40Z160xxx4")
board_runner_args(pyocd "--target=kw40z4") board_runner_args(pyocd "--target=kw40z4")
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -5,4 +5,4 @@
# #
board_runner_args(jlink "--device=Cortex-M7") board_runner_args(jlink "--device=Cortex-M7")
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -1,2 +1,2 @@
board_runner_args(pyocd "--target=nrf51") board_runner_args(pyocd "--target=nrf51")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -1,4 +1,4 @@
board_runner_args(nrfjprog "--nrf-family=NRF51") board_runner_args(nrfjprog "--nrf-family=NRF51")
board_runner_args(jlink "--device=nrf51" "--speed=4000") board_runner_args(jlink "--device=nrf51" "--speed=4000")
include($ENV{ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -1,2 +1,2 @@
board_runner_args(pyocd "--target=nrf51") board_runner_args(pyocd "--target=nrf51")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -1,4 +1,4 @@
board_runner_args(nrfjprog "--nrf-family=NRF52") board_runner_args(nrfjprog "--nrf-family=NRF52")
board_runner_args(jlink "--device=nrf52" "--speed=4000") board_runner_args(jlink "--device=nrf52" "--speed=4000")
include($ENV{ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -1,2 +1,2 @@
board_runner_args(pyocd "--target=nrf52") board_runner_args(pyocd "--target=nrf52")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -1,4 +1,4 @@
board_runner_args(nrfjprog "--nrf-family=NRF52") board_runner_args(nrfjprog "--nrf-family=NRF52")
board_runner_args(jlink "--device=nrf52" "--speed=4000") board_runner_args(jlink "--device=nrf52" "--speed=4000")
include($ENV{ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -1,2 +1,2 @@
board_runner_args(pyocd "--target=nrf52") board_runner_args(pyocd "--target=nrf52")
include($ENV{ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1,3 +1,3 @@
set(POST_VERIFY atsamv gpnvm set 1) set(POST_VERIFY atsamv gpnvm set 1)
board_runner_args(openocd "--cmd-post-verify=\"${POST_VERIFY}\"") board_runner_args(openocd "--cmd-post-verify=\"${POST_VERIFY}\"")
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1,3 +1,3 @@
board_runner_args(jlink "--device=MKW24D512xxx5") board_runner_args(jlink "--device=MKW24D512xxx5")
include($ENV{ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -3,5 +3,5 @@ set_ifndef(BOARD_DEBUG_RUNNER nios2)
board_finalize_runner_args(nios2 board_finalize_runner_args(nios2
# TODO: merge this script into nios2.py # TODO: merge this script into nios2.py
"--quartus-flash=$ENV{ZEPHYR_BASE}/scripts/support/quartus-flash.py" "--quartus-flash=${ZEPHYR_BASE}/scripts/support/quartus-flash.py"
) )

View file

@ -1,2 +1,2 @@
board_runner_args(nios2 "--cpu-sof=$ENV{ZEPHYR_BASE}/arch/nios2/soc/nios2f-zephyr/cpu/ghrd_10m50da.sof") board_runner_args(nios2 "--cpu-sof=${ZEPHYR_BASE}/arch/nios2/soc/nios2f-zephyr/cpu/ghrd_10m50da.sof")
include($ENV{ZEPHYR_BASE}/boards/common/nios2.board.cmake) include(${ZEPHYR_BASE}/boards/common/nios2.board.cmake)

View file

@ -8,5 +8,5 @@ board_runner_args(dfu-util "--pid=8087:0aba" "--alt=x86_app")
set(PRE_LOAD targets 1) set(PRE_LOAD targets 1)
board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"") board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"")
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/dfu-util.board.cmake) include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -1,3 +1,3 @@
set(PRE_LOAD targets 1) set(PRE_LOAD targets 1)
board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"") board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"")
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

View file

@ -8,5 +8,5 @@ board_runner_args(dfu-util "--pid=8087:0aba" "--alt=x86_app")
set(PRE_LOAD targets 1) set(PRE_LOAD targets 1)
board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"") board_runner_args(openocd "--cmd-pre-load=\"${PRE_LOAD}\"")
include($ENV{ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include($ENV{ZEPHYR_BASE}/boards/common/dfu-util.board.cmake) include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)

View file

@ -1 +1 @@
include($ENV{ZEPHYR_BASE}/boards/common/esp32.board.cmake) include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake)

View file

@ -74,14 +74,17 @@ set(__build_dir ${CMAKE_CURRENT_BINARY_DIR}/zephyr)
set(PROJECT_BINARY_DIR ${__build_dir}) set(PROJECT_BINARY_DIR ${__build_dir})
set(PROJECT_SOURCE_DIR $ENV{ZEPHYR_BASE}) set(PROJECT_SOURCE_DIR $ENV{ZEPHYR_BASE})
# Convert path to use the '/' separator
string(REPLACE "\\" "/" PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(ZEPHYR_BINARY_DIR ${PROJECT_BINARY_DIR}) set(ZEPHYR_BINARY_DIR ${PROJECT_BINARY_DIR})
set(ZEPHYR_SOURCE_DIR ${PROJECT_SOURCE_DIR}) set(ZEPHYR_BASE ${PROJECT_SOURCE_DIR})
set(AUTOCONF_H ${__build_dir}/include/generated/autoconf.h) set(AUTOCONF_H ${__build_dir}/include/generated/autoconf.h)
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes # Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${AUTOCONF_H}) set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${AUTOCONF_H})
include($ENV{ZEPHYR_BASE}/cmake/extensions.cmake) include(${ZEPHYR_BASE}/cmake/extensions.cmake)
find_package(PythonInterp 3.4) find_package(PythonInterp 3.4)
@ -101,7 +104,7 @@ endif()
add_custom_target( add_custom_target(
pristine pristine
COMMAND ${CMAKE_COMMAND} -P $ENV{ZEPHYR_BASE}/cmake/pristine.cmake COMMAND ${CMAKE_COMMAND} -P ${ZEPHYR_BASE}/cmake/pristine.cmake
# Equivalent to rm -rf build/* # Equivalent to rm -rf build/*
) )
@ -109,7 +112,7 @@ add_custom_target(
if(MSYS) if(MSYS)
execute_process( execute_process(
COMMAND COMMAND
${PYTHON_EXECUTABLE} $ENV{ZEPHYR_BASE}/scripts/check_host_is_ok.py ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/check_host_is_ok.py
RESULT_VARIABLE ret RESULT_VARIABLE ret
) )
if(NOT "${ret}" STREQUAL "0") if(NOT "${ret}" STREQUAL "0")
@ -185,7 +188,7 @@ set(CACHED_BOARD ${BOARD} CACHE STRING "Selected board")
# Use BOARD to search zephyr/boards/** for a _defconfig file, # Use BOARD to search zephyr/boards/** for a _defconfig file,
# e.g. zephyr/boards/arm/96b_carbon_nrf51/96b_carbon_nrf51_defconfig. When # e.g. zephyr/boards/arm/96b_carbon_nrf51/96b_carbon_nrf51_defconfig. When
# found, use that path to infer the ARCH we are building for. # found, use that path to infer the ARCH we are building for.
find_path(BOARD_DIR NAMES "${BOARD}_defconfig" PATHS $ENV{ZEPHYR_BASE}/boards/*/* NO_DEFAULT_PATH) find_path(BOARD_DIR NAMES "${BOARD}_defconfig" PATHS ${ZEPHYR_BASE}/boards/*/* NO_DEFAULT_PATH)
assert_with_usage(BOARD_DIR "No board named '${BOARD}' found") assert_with_usage(BOARD_DIR "No board named '${BOARD}' found")
@ -219,17 +222,17 @@ Multiple files may be listed, e.g. CONF_FILE=\"prj1.conf prj2.conf\"")
set(CMAKE_C_COMPILER_FORCED 1) set(CMAKE_C_COMPILER_FORCED 1)
set(CMAKE_CXX_COMPILER_FORCED 1) set(CMAKE_CXX_COMPILER_FORCED 1)
include($ENV{ZEPHYR_BASE}/cmake/version.cmake) include(${ZEPHYR_BASE}/cmake/version.cmake)
include($ENV{ZEPHYR_BASE}/cmake/host-tools.cmake) include(${ZEPHYR_BASE}/cmake/host-tools.cmake)
include($ENV{ZEPHYR_BASE}/cmake/kconfig.cmake) include(${ZEPHYR_BASE}/cmake/kconfig.cmake)
include($ENV{ZEPHYR_BASE}/cmake/toolchain.cmake) include(${ZEPHYR_BASE}/cmake/toolchain.cmake)
# DTS should be run directly after kconfig because CONFIG_ variables # DTS should be run directly after kconfig because CONFIG_ variables
# from kconfig and dts should be available at the same time. But # from kconfig and dts should be available at the same time. But
# running DTS involves running the preprocessor, so we put it behind # running DTS involves running the preprocessor, so we put it behind
# toolchain. Meaning toolchain.cmake is the only component where # toolchain. Meaning toolchain.cmake is the only component where
# kconfig and dts variables aren't available at the same time. # kconfig and dts variables aren't available at the same time.
include($ENV{ZEPHYR_BASE}/dts/dts.cmake) include(${ZEPHYR_BASE}/dts/dts.cmake)
set(KERNEL_NAME ${CONFIG_KERNEL_BIN_NAME}) set(KERNEL_NAME ${CONFIG_KERNEL_BIN_NAME})
@ -247,13 +250,13 @@ include(${BOARD_DIR}/board.cmake OPTIONAL)
zephyr_library_named(app) zephyr_library_named(app)
add_subdirectory($ENV{ZEPHYR_BASE} ${__build_dir}) add_subdirectory(${ZEPHYR_BASE} ${__build_dir})
# Link 'app' with the Zephyr interface libraries. # Link 'app' with the Zephyr interface libraries.
# #
# NB: This must be done in boilerplate.cmake because 'app' can only be # NB: This must be done in boilerplate.cmake because 'app' can only be
# modified in the CMakeLists.txt file that created it. And it must be # modified in the CMakeLists.txt file that created it. And it must be
# done after 'add_subdirectory($ENV{ZEPHYR_BASE} ${__build_dir})' # done after 'add_subdirectory(${ZEPHYR_BASE} ${__build_dir})'
# because interface libraries are defined while processing that # because interface libraries are defined while processing that
# subdirectory. # subdirectory.
get_property(ZEPHYR_INTERFACE_LIBS_PROPERTY GLOBAL PROPERTY ZEPHYR_INTERFACE_LIBS) get_property(ZEPHYR_INTERFACE_LIBS_PROPERTY GLOBAL PROPERTY ZEPHYR_INTERFACE_LIBS)

View file

@ -142,7 +142,7 @@ if(QEMU_NET_STACK)
# NET_TOOLS has been set to the net-tools repo path # NET_TOOLS has been set to the net-tools repo path
# net-tools/monitor_15_4 has been built beforehand # net-tools/monitor_15_4 has been built beforehand
set_ifndef(NET_TOOLS $ENV{ZEPHYR_BASE}/../net-tools) # Default if not set set_ifndef(NET_TOOLS ${ZEPHYR_BASE}/../net-tools) # Default if not set
list(APPEND PRE_QEMU_COMMANDS_FOR_server list(APPEND PRE_QEMU_COMMANDS_FOR_server
COMMAND ${NET_TOOLS}/monitor_15_4 COMMAND ${NET_TOOLS}/monitor_15_4
@ -159,7 +159,7 @@ if(CONFIG_X86_IAMCU)
list(APPEND PRE_QEMU_COMMANDS list(APPEND PRE_QEMU_COMMANDS
COMMAND COMMAND
${PYTHON_EXECUTABLE} ${PYTHON_EXECUTABLE}
$ENV{ZEPHYR_BASE}/scripts/qemu-machine-hack.py ${ZEPHYR_BASE}/scripts/qemu-machine-hack.py
$<TARGET_FILE:${logical_target_for_zephyr_elf}> $<TARGET_FILE:${logical_target_for_zephyr_elf}>
) )
endif() endif()

View file

@ -318,7 +318,7 @@ function(generate_inc_file
OUTPUT ${generated_file} OUTPUT ${generated_file}
COMMAND COMMAND
${PYTHON_EXECUTABLE} ${PYTHON_EXECUTABLE}
$ENV{ZEPHYR_BASE}/scripts/file2hex.py ${ZEPHYR_BASE}/scripts/file2hex.py
${ARGN} # Extra arguments are passed to file2hex.py ${ARGN} # Extra arguments are passed to file2hex.py
--file ${source_file} --file ${source_file}
> ${generated_file} # Does pipe redirection work on Windows? > ${generated_file} # Does pipe redirection work on Windows?
@ -393,7 +393,7 @@ endmacro()
# it to the argument "lib_name" # it to the argument "lib_name"
macro(zephyr_library_get_current_dir_lib_name lib_name) macro(zephyr_library_get_current_dir_lib_name lib_name)
# Remove the prefix (/home/sebo/zephyr/driver/serial/CMakeLists.txt => driver/serial/CMakeLists.txt) # Remove the prefix (/home/sebo/zephyr/driver/serial/CMakeLists.txt => driver/serial/CMakeLists.txt)
file(RELATIVE_PATH name $ENV{ZEPHYR_BASE} ${CMAKE_CURRENT_LIST_FILE}) file(RELATIVE_PATH name ${ZEPHYR_BASE} ${CMAKE_CURRENT_LIST_FILE})
# Remove the filename (driver/serial/CMakeLists.txt => driver/serial) # Remove the filename (driver/serial/CMakeLists.txt => driver/serial)
get_filename_component(name ${name} DIRECTORY) get_filename_component(name ${name} DIRECTORY)
@ -976,7 +976,7 @@ macro(assert_with_usage test comment)
message("see usage:") message("see usage:")
execute_process( execute_process(
COMMAND COMMAND
${CMAKE_COMMAND} -P $ENV{ZEPHYR_BASE}/cmake/usage/usage.cmake ${CMAKE_COMMAND} -P ${ZEPHYR_BASE}/cmake/usage/usage.cmake
) )
message(FATAL_ERROR "Invalid usage") message(FATAL_ERROR "Invalid usage")
endif() endif()

View file

@ -48,7 +48,7 @@ foreach(target flash debug debugserver)
set(cmd set(cmd
${CMAKE_COMMAND} -E env ${CMAKE_COMMAND} -E env
${PYTHON_EXECUTABLE} ${PYTHON_EXECUTABLE}
$ENV{ZEPHYR_BASE}/scripts/support/zephyr_flash_debug.py ${ZEPHYR_BASE}/scripts/support/zephyr_flash_debug.py
${RUNNER_VERBOSE} ${RUNNER_VERBOSE}
${runner} ${runner}
${target} ${target}

View file

@ -1,4 +1,4 @@
include($ENV{ZEPHYR_BASE}/cmake/host-tools-zephyr.cmake) include(${ZEPHYR_BASE}/cmake/host-tools-zephyr.cmake)
# Search for the must-have program dtc on PATH and in # Search for the must-have program dtc on PATH and in
# TOOLCHAIN_HOME. Usually DTC will be provided by an SDK, but for # TOOLCHAIN_HOME. Usually DTC will be provided by an SDK, but for

View file

@ -5,7 +5,7 @@ foreach(report ram_report rom_report)
add_custom_target( add_custom_target(
${report} ${report}
${PYTHON_EXECUTABLE} ${PYTHON_EXECUTABLE}
$ENV{ZEPHYR_BASE}/scripts/footprint/size_report ${ZEPHYR_BASE}/scripts/footprint/size_report
${flag_for_${report}} ${flag_for_${report}}
--objdump ${CMAKE_OBJDUMP} --objdump ${CMAKE_OBJDUMP}
--nm ${CMAKE_NM} --nm ${CMAKE_NM}

View file

@ -50,7 +50,7 @@ foreach(file_name include include-fixed)
list(APPEND NOSTDINC ${_OUTPUT}) list(APPEND NOSTDINC ${_OUTPUT})
endforeach() endforeach()
include($ENV{ZEPHYR_BASE}/cmake/gcc-m-cpu.cmake) include(${ZEPHYR_BASE}/cmake/gcc-m-cpu.cmake)
if("${ARCH}" STREQUAL "arm") if("${ARCH}" STREQUAL "arm")
list(APPEND TOOLCHAIN_C_FLAGS list(APPEND TOOLCHAIN_C_FLAGS
@ -58,7 +58,7 @@ if("${ARCH}" STREQUAL "arm")
-mcpu=${GCC_M_CPU} -mcpu=${GCC_M_CPU}
) )
include($ENV{ZEPHYR_BASE}/cmake/fpu-for-gcc-m-cpu.cmake) include(${ZEPHYR_BASE}/cmake/fpu-for-gcc-m-cpu.cmake)
if(CONFIG_FLOAT) if(CONFIG_FLOAT)
list(APPEND TOOLCHAIN_C_FLAGS -mfpu=${FPU_FOR_${GCC_M_CPU}}) list(APPEND TOOLCHAIN_C_FLAGS -mfpu=${FPU_FOR_${GCC_M_CPU}})

View file

@ -12,9 +12,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
if(ZEPHYR_GCC_VARIANT STREQUAL "host" OR CONFIG_ARCH_POSIX) if(ZEPHYR_GCC_VARIANT STREQUAL "host" OR CONFIG_ARCH_POSIX)
set(COMPILER host-gcc) set(COMPILER host-gcc)
else() else()
include($ENV{ZEPHYR_BASE}/cmake/toolchain-${ZEPHYR_GCC_VARIANT}.cmake) include(${ZEPHYR_BASE}/cmake/toolchain-${ZEPHYR_GCC_VARIANT}.cmake)
endif() endif()
# Configure the toolchain based on what toolchain technology is used # Configure the toolchain based on what toolchain technology is used
# (gcc clang etc.) # (gcc clang etc.)
include($ENV{ZEPHYR_BASE}/cmake/toolchain-${COMPILER}.cmake OPTIONAL) include(${ZEPHYR_BASE}/cmake/toolchain-${COMPILER}.cmake OPTIONAL)

View file

@ -12,7 +12,7 @@ set(arch_list
xtensa xtensa
) )
set(board_dir $ENV{ZEPHYR_BASE}/boards) set(board_dir ${ZEPHYR_BASE}/boards)
foreach(arch ${arch_list}) foreach(arch ${arch_list})
set(board_arch_dir ${board_dir}/${arch}) set(board_arch_dir ${board_dir}/${arch})

View file

@ -1,5 +1,5 @@
include($ENV{ZEPHYR_BASE}/cmake/hex.cmake) include(${ZEPHYR_BASE}/cmake/hex.cmake)
file(READ $ENV{ZEPHYR_BASE}/VERSION ver) file(READ ${ZEPHYR_BASE}/VERSION ver)
string(REGEX MATCH "VERSION_MAJOR = ([0-9]*)" _ ${ver}) string(REGEX MATCH "VERSION_MAJOR = ([0-9]*)" _ ${ver})
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1}) set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})

View file

@ -1,3 +1,3 @@
zephyr_include_directories($ENV{ZEPHYR_BASE}/subsys/bluetooth) zephyr_include_directories(${ZEPHYR_BASE}/subsys/bluetooth)
add_subdirectory(hci) add_subdirectory(hci)
zephyr_sources_ifdef(CONFIG_BT_NRF51_PM nrf51_pm.c) zephyr_sources_ifdef(CONFIG_BT_NRF51_PM nrf51_pm.c)

View file

@ -31,4 +31,4 @@ zephyr_sources_ifdef(CONFIG_SOC_FLASH_STM32
) )
endif() endif()
zephyr_include_directories_ifdef(CONFIG_SOC_FLASH_NRF5_RADIO_SYNC $ENV{ZEPHYR_BASE}/subsys/bluetooth) zephyr_include_directories_ifdef(CONFIG_SOC_FLASH_NRF5_RADIO_SYNC ${ZEPHYR_BASE}/subsys/bluetooth)

View file

@ -60,7 +60,7 @@ if(CONFIG_HAS_DTS)
-I${PROJECT_SOURCE_DIR}/drivers -I${PROJECT_SOURCE_DIR}/drivers
-undef -D__DTS__ -undef -D__DTS__
-P -P
-E $ENV{ZEPHYR_BASE}/misc/empty_file.c -E ${ZEPHYR_BASE}/misc/empty_file.c
-o ${BOARD_FAMILY}.dts.pre.tmp -o ${BOARD_FAMILY}.dts.pre.tmp
WORKING_DIRECTORY ${PROJECT_BINARY_DIR} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
RESULT_VARIABLE ret RESULT_VARIABLE ret

View file

@ -7,6 +7,6 @@ zephyr_library_sources_ifdef(CONFIG_DNS_RESOLVER resolve.c)
if(CONFIG_MDNS_RESPONDER) if(CONFIG_MDNS_RESPONDER)
zephyr_library_sources(mdns_responder.c) zephyr_library_sources(mdns_responder.c)
zephyr_library_include_directories($ENV{ZEPHYR_BASE}/subsys/net/ip) zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/net/ip)
endif() endif()

View file

@ -1,5 +1,5 @@
zephyr_include_directories_ifdef(CONFIG_CONSOLE_SHELL zephyr_include_directories_ifdef(CONFIG_CONSOLE_SHELL
$ENV{ZEPHYR_BASE}/include/drivers ${ZEPHYR_BASE}/include/drivers
) )
zephyr_sources( zephyr_sources(

View file

@ -2,13 +2,13 @@ zephyr_library()
zephyr_library_include_directories( zephyr_library_include_directories(
# USB headers # USB headers
$ENV{ZEPHYR_BASE}/include/drivers/usb ${ZEPHYR_BASE}/include/drivers/usb
$ENV{ZEPHYR_BASE}/include/usb/ ${ZEPHYR_BASE}/include/usb/
$ENV{ZEPHYR_BASE}/usb/include/ ${ZEPHYR_BASE}/usb/include/
.. ..
# IP headers # IP headers
$ENV{ZEPHYR_BASE}/subsys/net/ip ${ZEPHYR_BASE}/subsys/net/ip
) )
zephyr_library_sources( zephyr_library_sources(