blob: 80bf6fd0153730a0a673193e9731f2d6987581c9 [file] [log] [blame]
Julian Halleff4b282020-11-23 18:24:12 +01001#-------------------------------------------------------------------------------
Gyorgy Szingc31afbf2021-02-12 01:51:55 +01002# Copyright (c) 2020-2021, 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-service-test' for
10# different environments. Used for running end-to-end service-level tests
11# where test cases excerise trusted service client interfaces.
12#-------------------------------------------------------------------------------
13
14#-------------------------------------------------------------------------------
15# Use libts for locating and accessing services. An appropriate version of
16# libts will be imported for the enviroment in which service tests are
17# deployed.
18#-------------------------------------------------------------------------------
19include(${TS_ROOT}/deployments/libts/libts-import.cmake)
20target_link_libraries(ts-service-test PRIVATE libts)
21
22#-------------------------------------------------------------------------------
23# Components that are common accross all deployments
24#
25#-------------------------------------------------------------------------------
26add_components(
27 TARGET "ts-service-test"
28 BASE_DIR ${TS_ROOT}
29 COMPONENTS
30 "components/app/test-runner"
31 "components/service/crypto/test/service"
32 "components/service/crypto/client/cpp"
33 "components/service/common/serializer/protobuf"
34 "protocols/service/crypto/protobuf"
35)
36
37#-------------------------------------------------------------------------------
38# Components used from external projects
39#
40#-------------------------------------------------------------------------------
41
42# CppUTest
43include(${TS_ROOT}/external/CppUTest/CppUTest.cmake)
44target_link_libraries(ts-service-test PRIVATE CppUTest)
45
46# Nanopb
47include(${TS_ROOT}/external/nanopb/nanopb.cmake)
48target_link_libraries(ts-service-test PRIVATE nanopb::protobuf-nanopb-static)
49protobuf_generate_all(TGT "ts-service-test" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
50
51# Mbedcrypto
52include(${TS_ROOT}/external/mbed-crypto/mbedcrypto.cmake)
53target_link_libraries(ts-service-test PRIVATE mbedcrypto)
54
55#-------------------------------------------------------------------------------
56# Define install content.
57#
58#-------------------------------------------------------------------------------
59if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
60 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
61endif()
Gyorgy Szingc31afbf2021-02-12 01:51:55 +010062install(TARGETS ts-service-test RUNTIME DESTINATION ${TS_ENV}/bin)