Maulik Patel | 7cfee4a | 2022-07-19 09:39:38 +0100 | [diff] [blame^] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2022, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | include(FetchContent) |
| 9 | set(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. |
| 14 | set(TFM_EXTRAS_REPO_PATH "" CACHE PATH "Path to tf-m-extras repo (or DOWNLOAD to fetch automatically") |
| 15 | set(TFM_EXTRAS_REPO_VERSION "" CACHE STRING "The version of tf-m-extras to use") |
| 16 | |
| 17 | if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") |
| 18 | cmake_policy(SET CMP0097 NEW) |
| 19 | endif() |
| 20 | |
| 21 | if ("${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() |
| 34 | endif() |