blob: ca2a5e1ca410120decbfc1b0e432acc5bd35ad36 [file] [log] [blame]
Gyorgy Szing49091802020-11-24 00:33:09 +01001#-------------------------------------------------------------------------------
julhal01ffa98d82021-01-20 13:51:58 +00002# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
Gyorgy Szing49091802020-11-24 00:33:09 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#[===[.rst:
9 The base deployment CMake file
10 ------------------------------
11
12 Contains common CMake definitions that are used by concrete deployments.
13 This file should be included first by a concrete deployment's CMakeLists.txt.
14#]===]
15
16# Sets TS-ROOT which is used as the reference directory for everything contained within the project
17get_filename_component(TS_ROOT "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE CACHE PATH "Trusted Services root directory.")
18
19# Replicate TS_ROOT as environment variable to allow access from child CMake contexts
20set(ENV{TS_ROOT} "${TS_ROOT}")
21
22# Common utilities used by the build system
23include(${TS_ROOT}/tools/cmake/common/Utils.cmake REQUIRED)
24include(${TS_ROOT}/tools/cmake/common/AddComponents.cmake REQUIRED)
julhal01ffa98d82021-01-20 13:51:58 +000025include(${TS_ROOT}/tools/cmake/common/AddPlatform.cmake REQUIRED)
Gyorgy Szing49091802020-11-24 00:33:09 +010026
27# Check build environment requirements are met
28ts_verify_build_env()
29
30# Project wide include directories
31set(TOP_LEVEL_INCLUDE_DIRS
32 "${TS_ROOT}"
33 "${TS_ROOT}/components"
34 )
julhal01ffa98d82021-01-20 13:51:58 +000035
36# Set platform provider root default to use if no commandline variable value has been specified.
37# The root path may be specified to allow an external project to provide platform definitions.
38if (DEFINED ENV{TS_PLATFORM_ROOT})
39 set(_default_platform_root ENV{TS_PLATFORM_ROOT})
40else()
41 set(_default_platform_root "${TS_ROOT}/platform/providers")
42endif()
43set(TS_PLATFORM_ROOT ${_default_platform_root} CACHE STRING "Platform provider path")
44
45# Set the default platform to use if no explict platform has been specified on the cmake commandline.
46if (DEFINED ENV{TS_PLATFORM})
47 set(_default_platform ENV{TS_PLATFORM})
48else()
49 set(_default_platform "ts/vanilla")
50endif()
51set(TS_PLATFORM ${_default_platform} CACHE STRING "Selected platform")
52
53# Custom property for defining platform feature dependencies based on components used in a deployment
54define_property(TARGET PROPERTY TS_PLATFORM_DRIVER_DEPENDENCIES
55 BRIEF_DOCS "List of platform driver interfaces used for a deployment."
56 FULL_DOCS "Used by the platform specific builder to specify a configuration for the built platform components."
57 )