blob: 0769df9ba569dd167485a1737151466c3bff1a74 [file] [log] [blame]
Julian Halleff4b282020-11-23 18:24:12 +01001#-------------------------------------------------------------------------------
Balint Dobszayff8e0cd2022-08-11 15:07:52 +02002# Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
Julian Halleff4b282020-11-23 18:24:12 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#-------------------------------------------------------------------------------
9# The base build file shared between deployments of 'ts-demo' for
10# different environments. Demonstrates use of trusted services by a
11# client application.
12#-------------------------------------------------------------------------------
13
14#-------------------------------------------------------------------------------
15# Use libts for locating and accessing services. An appropriate version of
Gyorgy Szingec62ea72022-07-20 12:36:52 +000016# libts will be imported for the environment in which service tests are
Julian Halleff4b282020-11-23 18:24:12 +010017# deployed.
18#-------------------------------------------------------------------------------
19include(${TS_ROOT}/deployments/libts/libts-import.cmake)
Gyorgy Szingec62ea72022-07-20 12:36:52 +000020target_link_libraries(ts-demo PRIVATE libts::ts)
Julian Halleff4b282020-11-23 18:24:12 +010021
22#-------------------------------------------------------------------------------
23# Common main for all deployments
24#
25#-------------------------------------------------------------------------------
26target_sources(ts-demo PRIVATE
27 "${CMAKE_CURRENT_LIST_DIR}/ts-demo.cpp"
28)
29
30#-------------------------------------------------------------------------------
Gyorgy Szingec62ea72022-07-20 12:36:52 +000031# Components that are common across all deployments
Julian Halleff4b282020-11-23 18:24:12 +010032#
33#-------------------------------------------------------------------------------
34add_components(
35 TARGET "ts-demo"
36 BASE_DIR ${TS_ROOT}
37 COMPONENTS
38 "components/app/ts-demo"
julhal01734dbad2020-12-21 10:27:41 +000039 "components/common/tlv"
Julian Hall99a57e32021-07-28 14:18:50 +010040 "components/service/common/include"
41 "components/service/common/client"
Julian Halleff4b282020-11-23 18:24:12 +010042 "components/service/crypto/client/cpp"
Julian Hall7a703402021-08-04 09:20:43 +010043 "components/service/crypto/client/cpp/protocol/packed-c"
julhal01734dbad2020-12-21 10:27:41 +000044 "protocols/service/crypto/packed-c"
Julian Halleff4b282020-11-23 18:24:12 +010045)
46
47#-------------------------------------------------------------------------------
48# Components used from external projects
49#
50#-------------------------------------------------------------------------------
51
Julian Halla5443172022-05-30 11:52:11 +010052# MbedTLS provides libmbedcrypto
53set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_posix.h"
54 CACHE STRING "Configuration file for mbedcrypto")
Balint Dobszay3c52ce62021-05-10 16:27:18 +020055include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
Balint Dobszayff8e0cd2022-08-11 15:07:52 +020056target_link_libraries(ts-demo PRIVATE MbedTLS::mbedcrypto)
Julian Halleff4b282020-11-23 18:24:12 +010057
58#-------------------------------------------------------------------------------
59# Define install content.
60#
61#-------------------------------------------------------------------------------
62if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
63 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
64endif()
Gyorgy Szingc31afbf2021-02-12 01:51:55 +010065install(TARGETS ts-demo RUNTIME DESTINATION ${TS_ENV}/bin)