mirror of https://github.com/ARMmbed/mbed-os.git
CMake: greentea: Remove dependency on global MBED_PATH
The mbed_greentea_add_test macro required a greentea test to set an MBED_PATH variable to the path of the mbed-os root directory, which it attempts to add as a 'subdirectory' of the test project. We can instead use CMake's built in CMAKE_CURRENT_LIST_DIR variable to deduce the path to mbed-os relative to the current list file directory, removing the need for greentea tests to set MBED_PATH.pull/14876/head
parent
d5a4ad1fe9
commit
dfb4e087e3
|
@ -1,9 +1,9 @@
|
||||||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
|
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/app.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/app.cmake)
|
||||||
|
set(MBED_ROOT ${CMAKE_CURRENT_LIST_DIR}/../.. CACHE INTERNAL "")
|
||||||
|
|
||||||
# CMake Macro for generalizing CMake configuration across the greentea test suite with configurable parameters
|
# CMake Macro for generalizing CMake configuration across the greentea test suite with configurable parameters
|
||||||
# Macro args:
|
# Macro args:
|
||||||
|
@ -34,8 +34,7 @@ macro(mbed_greentea_add_test)
|
||||||
"${multipleValueArgs}"
|
"${multipleValueArgs}"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
add_subdirectory(${MBED_ROOT} build)
|
||||||
add_subdirectory(${MBED_PATH} build)
|
|
||||||
|
|
||||||
add_executable(${MBED_GREENTEA_TEST_NAME})
|
add_executable(${MBED_GREENTEA_TEST_NAME})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue