Build: Support out-of-tree platforms
Allows -DTFM_PLATFORM to be set to paths outside the TFM tree.
e.g.
cmake ... -DTFM_PLATFORM=../../../../tfm_platforms/my_platform
Note: TFM_PLATFORM currently only accepts paths relative from
platform/ext/target
Change-Id: I99d194fdee43ffa29da67b22eb79ef5e450c1559
Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt
index b03c88e..915307c 100755
--- a/platform/CMakeLists.txt
+++ b/platform/CMakeLists.txt
@@ -23,7 +23,7 @@
set(PLATFORM_DIR ${CMAKE_CURRENT_LIST_DIR})
-add_subdirectory(ext/target/${TFM_PLATFORM})
+add_subdirectory(ext/target/${TFM_PLATFORM} target)
#========================= Platform Secure ====================================#
diff --git a/platform/ext/target/musca_b1/sse_200/CMakeLists.txt b/platform/ext/target/musca_b1/sse_200/CMakeLists.txt
index 8fac077..d65748f 100644
--- a/platform/ext/target/musca_b1/sse_200/CMakeLists.txt
+++ b/platform/ext/target/musca_b1/sse_200/CMakeLists.txt
@@ -187,7 +187,7 @@
Device/Config
Native_Driver
${MCUBOOT_PATH}/boot/bootutil/include # for fault_injection_hardening.h only
- ${CMAKE_CURRENT_BINARY_DIR}/../../../../../bl2/ext/mcuboot # for mcuboot_config.h only
+ ${CMAKE_BINARY_DIR}/bl2/ext/mcuboot # for mcuboot_config.h only
${CMAKE_MUSCA_B1_COMMON_DIR}/Native_Driver
${CMAKE_MUSCA_B1_COMMON_DIR}/Libraries
)
diff --git a/platform/ext/target/musca_s1/CMakeLists.txt b/platform/ext/target/musca_s1/CMakeLists.txt
index 536b12a..6180be2 100644
--- a/platform/ext/target/musca_s1/CMakeLists.txt
+++ b/platform/ext/target/musca_s1/CMakeLists.txt
@@ -148,6 +148,6 @@
Device/Config
Native_Driver
${MCUBOOT_PATH}/boot/bootutil/include # for fault_injection_hardening.h only
- ${CMAKE_CURRENT_BINARY_DIR}/../../../../bl2/ext/mcuboot # for mcuboot_config.h only
+ ${CMAKE_BINARY_DIR}/bl2/ext/mcuboot # for mcuboot_config.h only
)
endif()