blob: ae34c6e4c9849ae0560baac0ed2b9139f9846584 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#-------------------------------------------------------------------------------
# Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
#[===[.rst:
Add platform provided components to a build
-------------------------------------------
#]===]
#[===[.rst:
.. cmake:command:: add_platform
.. code:: cmake
add_platform(TARGET <target name>)
INPUTS:
``TARGET``
The name of an already defined target to add platform components to.
#]===]
function(add_platform)
set(options )
set(oneValueArgs TARGET)
cmake_parse_arguments(MY_PARAMS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(NOT DEFINED MY_PARAMS_TARGET)
message(FATAL_ERROR "add_platform: mandatory parameter TARGET not defined!")
endif()
set(TGT ${MY_PARAMS_TARGET} CACHE STRING "")
# Ensure file path conforms to lowercase project convention
string(TOLOWER "${TS_PLATFORM_ROOT}/${TS_PLATFORM}/platform.cmake" _platdef)
include(${_platdef})
set(CMAKE_CONFIGURE_DEPENDS ${_platdef})
unset(TGT CACHE)
endfunction()
|