blob: d00db83bb0c70dcdc2172c7f81343b83cbbbcc2d [file] [log] [blame]
Maulik Patel7cfee4a2022-07-19 09:39:38 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2022, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8include(FetchContent)
9set(FETCHCONTENT_QUIET FALSE)
10
11# If tf-m-extras partitions are required, please set TFM_EXTRAS_REPO_PATH to
12# DOWNLOAD and TFM_EXTRAS_REPO_VERSION to appropriate commit-id in the platform
13# specific config. By default, they are not fetched.
14set(TFM_EXTRAS_REPO_PATH "" CACHE PATH "Path to tf-m-extras repo (or DOWNLOAD to fetch automatically")
15set(TFM_EXTRAS_REPO_VERSION "" CACHE STRING "The version of tf-m-extras to use")
16
17if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
18 cmake_policy(SET CMP0097 NEW)
19endif()
20
21if ("${TFM_EXTRAS_REPO_PATH}" STREQUAL "DOWNLOAD")
22 FetchContent_Declare(tf-m-extras
23 GIT_REPOSITORY https://git.trustedfirmware.org/TF-M/tf-m-extras.git
24 GIT_TAG ${TFM_EXTRAS_REPO_VERSION}
25 GIT_SHALLOW FALSE
26 GIT_PROGRESS TRUE
27 )
28
29 FetchContent_GetProperties(tf-m-extras)
30 if(NOT tfm_extras_repo_POPULATED)
31 FetchContent_Populate(tf-m-extras)
32 set(TFM_EXTRAS_REPO_PATH "${CMAKE_CURRENT_BINARY_DIR}-src" CACHE PATH "Path to TFM-EXTRAS repo (or DOWNLOAD to fetch automatically" FORCE)
33 endif()
34endif()