Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
David Hu | 1a2d483 | 2022-01-18 14:42:04 +0800 | [diff] [blame^] | 2 | # Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 8 | # Set to not download submodules if that option is available |
| 9 | if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") |
| 10 | cmake_policy(SET CMP0097 NEW) |
| 11 | endif() |
| 12 | |
David Hu | 3d2121f | 2021-08-23 18:00:26 +0800 | [diff] [blame] | 13 | include(FetchContent) |
| 14 | set(FETCHCONTENT_QUIET FALSE) |
| 15 | |
| 16 | set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/lib/ext CACHE STRING "" FORCE) |
| 17 | |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 18 | if ("${TFM_TEST_REPO_PATH}" STREQUAL "DOWNLOAD") |
| 19 | FetchContent_Declare(tfm_test_repo |
| 20 | GIT_REPOSITORY https://git.trustedfirmware.org/TF-M/tf-m-tests.git |
Raef Coles | 9c2ce9b | 2020-10-22 13:07:12 +0100 | [diff] [blame] | 21 | GIT_TAG ${TFM_TEST_REPO_VERSION} |
Raef Coles | 1971538 | 2020-07-10 09:50:17 +0100 | [diff] [blame] | 22 | GIT_PROGRESS TRUE |
| 23 | ) |
| 24 | |
| 25 | FetchContent_GetProperties(tfm_test_repo) |
| 26 | if(NOT tfm_test_repo_POPULATED) |
| 27 | FetchContent_Populate(tfm_test_repo) |
| 28 | set(TFM_TEST_REPO_PATH ${tfm_test_repo_SOURCE_DIR} CACHE PATH "Path to TFM-TEST repo (or DOWNLOAD to fetch automatically" FORCE) |
| 29 | endif() |
| 30 | endif() |
| 31 | |
| 32 | if ("${CMSIS_5_PATH}" STREQUAL DOWNLOAD) |
| 33 | set(CMSIS_5_PATH ${TFM_TEST_REPO_PATH}/CMSIS CACHE PATH "Path to CMSIS_5 (or DOWNLOAD to fetch automatically" FORCE) |
| 34 | endif() |
| 35 | |
| 36 | if (NOT TFM_APP_PATH) |
| 37 | set(TFM_APP_PATH ${TFM_TEST_REPO_PATH}/app CACHE PATH "Path to TFM NS app" FORCE) |
| 38 | endif() |
| 39 | |
| 40 | if (NOT TFM_TEST_PATH) |
| 41 | set(TFM_TEST_PATH ${TFM_TEST_REPO_PATH}/test CACHE PATH "Path to TFM tests" FORCE) |
| 42 | endif() |
Kevin Peng | ca4846e | 2020-10-20 17:50:20 +0800 | [diff] [blame] | 43 | |
David Hu | 1a2d483 | 2022-01-18 14:42:04 +0800 | [diff] [blame^] | 44 | if (NOT TFM_RAW_LOG_PATH) |
| 45 | set(TFM_RAW_LOG_PATH ${TFM_TEST_REPO_PATH}/log CACHE PATH "Path to TF-M raw log" FORCE) |
Kevin Peng | ca4846e | 2020-10-20 17:50:20 +0800 | [diff] [blame] | 46 | endif() |