Skip to content

Commit 4e8325f

Browse files
committed
CMake targets: remove MBED_PATH, use stadard variables
- list files included via module path - <project-name>_SOURCE_DIR for sources that are out of the current processed CMake - CMAKE_CURRENT_LIST_DIR for listfiles
1 parent 1413c42 commit 4e8325f

File tree

14 files changed

+25
-18
lines changed

14 files changed

+25
-18
lines changed

targets/TARGET_ARM_SSG/TARGET_MUSCA_B1/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/mbed_set_post_build_tfm.cmake)
4+
include(${mbed-os_SOURCE_DIR}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/mbed_set_post_build_tfm.cmake)
55

66
add_library(mbed-arm-musca-b1 INTERFACE)
77

targets/TARGET_ARM_SSG/TARGET_MUSCA_S1/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/mbed_set_post_build_tfm.cmake)
4+
include(${mbed-os_SOURCE_DIR}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/mbed_set_post_build_tfm.cmake)
55

66
add_library(mbed-arm-musca-s1 INTERFACE)
77

targets/TARGET_Cypress/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/scripts")
5+
46
add_subdirectory(TARGET_PSOC6 EXCLUDE_FROM_ALL)
57

68
add_library(mbed-cy-external-wifi-fw INTERFACE)
@@ -11,3 +13,4 @@ target_compile_definitions(mbed-cy-external-wifi-fw
1113
"CY_STORAGE_WIFI_DATA_OUTPUT=cy_xip"
1214
"CY_EXT_WIFI_FW_STORAGE=QSPIF"
1315
)
16+

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
4+
include(mbed_set_post_build_cypress)
55

66
add_library(mbed-cy8ckit064b0s2-4343w-bsp-design-modus INTERFACE)
77
target_include_directories(mbed-cy8ckit064b0s2-4343w-bsp-design-modus
@@ -86,5 +86,5 @@ mbed_post_build_psoc6_sign_image(
8686
"single_image"
8787
"1"
8888
"16"
89-
"${MBED_PATH}/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT064B0S2_4343W/device/COMPONENT_CM4/hex/psoc6_02_cm0p_secure.hex"
89+
"${CMAKE_CURRENT_SOURCE_DIR}/device/COMPONENT_CM4/hex/psoc6_02_cm0p_secure.hex"
9090
)

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYSBSYSKIT_01/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
4+
include(mbed_set_post_build_cypress)
55

66
add_library(mbed-cysbsyskit-01-bsp-design-modus INTERFACE)
77
target_include_directories(mbed-cysbsyskit-01-bsp-design-modus

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake)
4+
include(mbed_set_post_build_cypress)
55

66
add_library(mbed-cytfm-064b0s2-4343w-bsp-design-modus INTERFACE)
77
target_include_directories(mbed-cytfm-064b0s2-4343w-bsp-design-modus
@@ -79,5 +79,5 @@ mbed_post_build_psoc6_sign_image(
7979
"multi_image"
8080
"1"
8181
"16"
82-
${MBED_PATH}/targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CYTFM_064B0S2_4343W/COMPONENT_TFM_S_FW/tfm_s.hex
82+
${CMAKE_CURRENT_SOURCE_DIR}/COMPONENT_TFM_S_FW/tfm_s.hex
8383
)

targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/tools/cmake/mbed_set_post_build.cmake)
4+
include(mbed_set_post_build)
55

66
#
77
# Merge Cortex-M4 HEX and a Cortex-M0 HEX.
@@ -20,15 +20,15 @@ function(mbed_post_build_psoc6_merge_hex mbed_target_name)
2020
# Get extra argument as `cortex_m0_hex`
2121
list(GET extra_macro_args 0 cortex_m0_hex)
2222
set(post_build_command
23-
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/targets/TARGET_Cypress/scripts/PSOC6.py
23+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/PSOC6.py
2424
merge
2525
--elf ${CMAKE_BINARY_DIR}/$<TARGET_PROPERTY:mbed-post-build-bin-${mbed_target_name},application>.elf
2626
--m4hex ${CMAKE_BINARY_DIR}/$<TARGET_PROPERTY:mbed-post-build-bin-${mbed_target_name},application>.hex
2727
--m0hex ${cortex_m0_hex}
2828
)
2929
else()
3030
set(post_build_command
31-
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/targets/TARGET_Cypress/scripts/PSOC6.py
31+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/PSOC6.py
3232
merge
3333
--elf ${CMAKE_BINARY_DIR}/$<TARGET_PROPERTY:mbed-post-build-bin-${mbed_target_name},application>.elf
3434
--m4hex ${CMAKE_BINARY_DIR}/$<TARGET_PROPERTY:mbed-post-build-bin-${mbed_target_name},application>.hex
@@ -54,7 +54,7 @@ function(mbed_post_build_psoc6_sign_image
5454
find_package(Python3)
5555

5656
set(post_build_command
57-
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/targets/TARGET_Cypress/scripts/PSOC6.py
57+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/PSOC6.py
5858
sign
5959
--build-dir ${CMAKE_BINARY_DIR}
6060
--m0hex-filename ${m0hex_filename}

targets/TARGET_NXP/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/scripts")
5+
46
add_subdirectory(TARGET_LPC11XX_11CXX EXCLUDE_FROM_ALL)
57
add_subdirectory(TARGET_LPC176X EXCLUDE_FROM_ALL)
68
add_subdirectory(TARGET_MCUXpresso_MCUS EXCLUDE_FROM_ALL)
@@ -18,3 +20,5 @@ target_sources(mbed-nxp
1820
)
1921

2022
target_link_libraries(mbed-nxp INTERFACE mbed-cmsis-cortex-m)
23+
24+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/scripts")

targets/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake)
4+
include(mbed_set_post_build_nxp)
55

66
add_library(mbed-lpc11xx INTERFACE)
77

targets/TARGET_NXP/TARGET_LPC176X/TARGET_ARCH_PRO/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake)
4+
include(mbed_set_post_build_nxp)
55

66
add_library(mbed-arch-pro INTERFACE)
77

targets/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake)
4+
include(mbed_set_post_build_nxp)
55

66
add_library(mbed-mbed-lpc1768 INTERFACE)
77

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC54114/device/TARGET_LPC54114_M4/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake)
4+
include(mbed_set_post_build_nxp)
55

66
if(${MBED_TOOLCHAIN} STREQUAL "ARM")
77
set(STARTUP_FILE TOOLCHAIN_ARM_STD/startup_LPC54114_cm4.S)

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MCU_LPC546XX/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake)
4+
include(mbed_set_post_build_nxp)
55

66
add_subdirectory(TARGET_FF_LPC546XX EXCLUDE_FROM_ALL)
77
add_subdirectory(TARGET_LPCXpresso EXCLUDE_FROM_ALL)

targets/TARGET_NXP/scripts/mbed_set_post_build_nxp.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
include(${MBED_PATH}/tools/cmake/mbed_set_post_build.cmake)
4+
include(mbed_set_post_build)
55

66
#
77
# Patch an LPC target vector table in the binary file.
@@ -10,7 +10,7 @@ function(mbed_post_build_lpc_patch_vtable mbed_target_name)
1010
find_package(Python3)
1111

1212
set(post_build_command
13-
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/targets/TARGET_NXP/scripts/LPC.py
13+
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/LPC.py
1414
${CMAKE_BINARY_DIR}/$<TARGET_PROPERTY:mbed-post-build-bin-${mbed_target_name},application>.bin
1515
)
1616

0 commit comments

Comments
 (0)