Skip to content

Commit 80ce06f

Browse files
authored
Merge pull request #14876 from rwalton-arm/mbed_path_greentea
CMake: greentea: Remove dependency on global MBED_PATH
2 parents 428b746 + dfb4e08 commit 80ce06f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

tools/cmake/mbed_greentea.cmake

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
3-
43
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
54

65
include(${CMAKE_CURRENT_LIST_DIR}/app.cmake)
6+
set(MBED_ROOT ${CMAKE_CURRENT_LIST_DIR}/../.. CACHE INTERNAL "")
77

88
# CMake Macro for generalizing CMake configuration across the greentea test suite with configurable parameters
99
# Macro args:
1010
# TEST_NAME - Test suite name
1111
# TEST_INCLUDE_DIRS - Test suite include directories for the test
1212
# TEST_SOURCES - Test suite sources
1313
# TEST_REQUIRED_LIBS - Test suite required libraries
14-
#
14+
#
1515
# calling the macro:
1616
# mbed_greentea_add_test(
1717
# TEST_NAME mbed-platform-system-reset
@@ -34,16 +34,13 @@ macro(mbed_greentea_add_test)
3434
"${multipleValueArgs}"
3535
${ARGN}
3636
)
37-
38-
add_subdirectory(${MBED_PATH} build)
37+
add_subdirectory(${MBED_ROOT} build)
3938

4039
add_executable(${MBED_GREENTEA_TEST_NAME})
4140

4241
# Explicitly enable BUILD_TESTING until CTest is added to the Greentea client
4342
set(BUILD_TESTING ON)
4443

45-
mbed_configure_app_target(${MBED_GREENTEA_TEST_NAME})
46-
4744
target_include_directories(${MBED_GREENTEA_TEST_NAME}
4845
PRIVATE
4946
.
@@ -59,7 +56,7 @@ macro(mbed_greentea_add_test)
5956
# For example:
6057
# - To select mbed-os library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-os
6158
# - To select baremetal library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-baremetal
62-
# - To select baremetal with extra external error logging library to the test, use cmake with
59+
# - To select baremetal with extra external error logging library to the test, use cmake with
6360
# -D "MBED_TEST_LINK_LIBRARIES=mbed-baremetal ext-errorlogging"
6461
if (DEFINED MBED_TEST_LINK_LIBRARIES)
6562
separate_arguments(MBED_TEST_LINK_LIBRARIES)

0 commit comments

Comments
 (0)