Skip to content

Commit 676bb3f

Browse files
committed
CMake tools: use CMAKE_CURRENT_LIST_DIR instead of MBED_PATH
Excluding greentea tests, they will be fixed separately (more work needed).
1 parent 489c867 commit 676bb3f

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ function(mbed_generate_map_file target)
216216
TARGET
217217
${target}
218218
POST_BUILD
219-
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map
219+
COMMAND ${Python3_EXECUTABLE} ${mbed-os_SOURCE_DIR}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map
220220
WORKING_DIRECTORY
221221
${CMAKE_CURRENT_BINARY_DIR}
222222
COMMENT

tools/cmake/app.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ include(${MBED_CONFIG_PATH}/mbed_config.cmake)
1212
# Load toolchain file
1313
if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED)
1414
set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")
15-
include(${MBED_PATH}/tools/cmake/toolchain.cmake)
15+
include(${mbed-os_SOURCE_DIR}/tools/cmake/toolchain.cmake)
1616
endif()
1717

1818
# Specify available build profiles and add options for the selected build profile
19-
include(${MBED_PATH}/tools/cmake/profile.cmake)
19+
include(${mbed-os_SOURCE_DIR}/tools/cmake/profile.cmake)
2020

2121
enable_language(C CXX ASM)
2222

tools/cmake/mbed_greentea.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
set(MBED_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "")
55

6-
include(${MBED_PATH}/tools/cmake/app.cmake)
6+
include(${CMAKE_CURRENT_LIST_DIR}/app.cmake)
77

88
# CMake Macro for generalizing CMake configuration across the greentea test suite with configurable parameters
99
# Macro args:

tools/cmake/profile.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ else()
2929
endif()
3030
endif()
3131

32-
include(${MBED_PATH}/tools/cmake/profiles/${LOWERCASE_CMAKE_BUILD_TYPE}.cmake)
32+
include(${CMAKE_CURRENT_LIST_DIR}/profiles/${LOWERCASE_CMAKE_BUILD_TYPE}.cmake)

tools/cmake/toolchain.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ set(link_options "")
100100
set(common_options "")
101101
set(c_cxx_compile_options "") # compile options only for C/CXX
102102
set(asm_compile_options "") # compile options only for ASM
103-
include(${MBED_PATH}/tools/cmake/toolchains/${MBED_TOOLCHAIN}.cmake)
104-
include(${MBED_PATH}/tools/cmake/cores/${MBED_CPU_CORE}.cmake)
103+
include(${CMAKE_CURRENT_LIST_DIR}/toolchains/${MBED_TOOLCHAIN}.cmake)
104+
include(${CMAKE_CURRENT_LIST_DIR}/cores/${MBED_CPU_CORE}.cmake)
105105

106106
#converts a list into a string with each of its elements seperated by a space
107107
macro(list_to_space_separated OUTPUT_VAR)# 2nd arg: LIST...

0 commit comments

Comments
 (0)