blob: 47bce1320608b472774fcb6ebf48b9509f524268 [file] [log] [blame]
Raef Coles19715382020-07-10 09:50:17 +01001#-------------------------------------------------------------------------------
David Hu3d2121f2021-08-23 18:00:26 +08002# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
Raef Coles19715382020-07-10 09:50:17 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
Raef Coles19715382020-07-10 09:50:17 +01008# Set to not download submodules if that option is available
9if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
10 cmake_policy(SET CMP0097 NEW)
11endif()
12
David Hu3d2121f2021-08-23 18:00:26 +080013include(FetchContent)
14set(FETCHCONTENT_QUIET FALSE)
15
16set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/lib/ext CACHE STRING "" FORCE)
17
Raef Coles19715382020-07-10 09:50:17 +010018if ("${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 Coles9c2ce9b2020-10-22 13:07:12 +010021 GIT_TAG ${TFM_TEST_REPO_VERSION}
Raef Coles19715382020-07-10 09:50:17 +010022 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()
30endif()
31
32if ("${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)
34endif()
35
36if (NOT TFM_APP_PATH)
37 set(TFM_APP_PATH ${TFM_TEST_REPO_PATH}/app CACHE PATH "Path to TFM NS app" FORCE)
38endif()
39
40if (NOT TFM_TEST_PATH)
41 set(TFM_TEST_PATH ${TFM_TEST_REPO_PATH}/test CACHE PATH "Path to TFM tests" FORCE)
42endif()
Kevin Pengca4846e2020-10-20 17:50:20 +080043
44if (NOT TFM_NS_LOG_PATH)
45 set(TFM_NS_LOG_PATH ${TFM_TEST_REPO_PATH}/log CACHE PATH "Path to NS log" FORCE)
46endif()