Raef Coles | a1f504c | 2020-07-10 09:58:55 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Kevin Peng | a2b6802 | 2023-01-13 13:54:05 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2023, Arm Limited. All rights reserved. |
BohdanHunko | f871df0 | 2023-02-03 14:36:41 +0200 | [diff] [blame] | 3 | # Copyright (c) 2022-2023 Cypress Semiconductor Corporation (an Infineon company) |
Chris Brand | cae2026 | 2022-06-23 12:05:33 -0700 | [diff] [blame] | 4 | # or an affiliate of Cypress Semiconductor Corporation. All rights reserved. |
Raef Coles | a1f504c | 2020-07-10 09:58:55 +0100 | [diff] [blame] | 5 | # |
| 6 | # SPDX-License-Identifier: BSD-3-Clause |
| 7 | # |
| 8 | #------------------------------------------------------------------------------- |
| 9 | |
Raef Coles | a1f504c | 2020-07-10 09:58:55 +0100 | [diff] [blame] | 10 | install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 11 | DESTINATION bin |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 12 | ) |
| 13 | |
David Hu | b24aead | 2020-10-17 19:46:19 +0800 | [diff] [blame] | 14 | # export veneer lib |
Chris Brand | ca81902 | 2022-07-19 09:25:15 -0700 | [diff] [blame] | 15 | if (CONFIG_TFM_USE_TRUSTZONE) |
Raef Coles | 25fc175 | 2020-11-24 12:04:42 +0000 | [diff] [blame] | 16 | install(FILES ${CMAKE_BINARY_DIR}/secure_fw/s_veneers.o |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 17 | DESTINATION ${INSTALL_INTERFACE_LIB_DIR}) |
David Hu | b24aead | 2020-10-17 19:46:19 +0800 | [diff] [blame] | 18 | endif() |
| 19 | |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 20 | ####################### export headers ######################################### |
| 21 | |
| 22 | install(FILES ${INTERFACE_INC_DIR}/psa/client.h |
| 23 | ${INTERFACE_INC_DIR}/psa/error.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 24 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 25 | |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 26 | install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/psa_manifest/sid.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 27 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa_manifest) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 28 | |
Kevin Peng | 0e340ea | 2023-08-15 17:51:44 +0800 | [diff] [blame] | 29 | install(FILES ${INTERFACE_INC_DIR}/tfm_veneers.h |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 30 | ${INTERFACE_INC_DIR}/tfm_ns_interface.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 31 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 32 | |
Sherry Zhnag | 482b88b | 2021-08-19 17:51:47 +0800 | [diff] [blame] | 33 | install(FILES ${INTERFACE_INC_DIR}/tfm_ns_client_ext.h |
| 34 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 35 | |
David Hu | 895cdc3 | 2023-01-16 19:19:25 +0800 | [diff] [blame] | 36 | install(FILES ${CMAKE_SOURCE_DIR}/secure_fw/include/config_tfm.h |
| 37 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
David Hu | 6d1a9b6 | 2023-02-22 16:54:04 +0800 | [diff] [blame] | 38 | install(FILES ${CMAKE_SOURCE_DIR}/config/config_base.h |
| 39 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
David Hu | 895cdc3 | 2023-01-16 19:19:25 +0800 | [diff] [blame] | 40 | |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 41 | install(FILES ${INTERFACE_INC_DIR}/tfm_psa_call_pack.h |
| 42 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 43 | install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/psa/framework_feature.h |
| 44 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
Xinyu Zhang | 93899d0 | 2021-05-11 10:48:52 +0800 | [diff] [blame] | 45 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 46 | if (TFM_PARTITION_NS_AGENT_MAILBOX) |
David Hu | 04969a4 | 2020-06-14 21:25:35 +0800 | [diff] [blame] | 47 | install(FILES ${INTERFACE_INC_DIR}/multi_core/tfm_multi_core_api.h |
| 48 | ${INTERFACE_INC_DIR}/multi_core/tfm_ns_mailbox.h |
| 49 | ${INTERFACE_INC_DIR}/multi_core/tfm_mailbox.h |
David Hu | cb91581 | 2021-12-27 14:22:04 +0800 | [diff] [blame] | 50 | ${INTERFACE_INC_DIR}/multi_core/tfm_ns_mailbox_test.h |
David Hu | 186a129 | 2021-09-13 09:05:52 +0800 | [diff] [blame] | 51 | ${CMAKE_BINARY_DIR}/generated/interface/include/tfm_mailbox_config.h |
David Hu | 71f6dcc | 2023-10-18 11:52:21 +0800 | [diff] [blame^] | 52 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/multi_core) |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 53 | endif() |
| 54 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 55 | if (TFM_PARTITION_PROTECTED_STORAGE) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 56 | install(FILES ${INTERFACE_INC_DIR}/psa/protected_storage.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 57 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 58 | install(FILES ${INTERFACE_INC_DIR}/tfm_ps_defs.h |
| 59 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 60 | endif() |
| 61 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 62 | if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 63 | install(FILES ${INTERFACE_INC_DIR}/psa/internal_trusted_storage.h |
| 64 | ${INTERFACE_INC_DIR}/psa/storage_common.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 65 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 66 | install(FILES ${INTERFACE_INC_DIR}/tfm_its_defs.h |
| 67 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 68 | endif() |
| 69 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 70 | if (TFM_PARTITION_CRYPTO) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 71 | install(FILES ${INTERFACE_INC_DIR}/psa/crypto_extra.h |
| 72 | ${INTERFACE_INC_DIR}/psa/crypto_compat.h |
| 73 | ${INTERFACE_INC_DIR}/psa/crypto.h |
| 74 | ${INTERFACE_INC_DIR}/psa/crypto_client_struct.h |
Xinyu Zhang | fce2037 | 2023-04-10 14:43:47 +0800 | [diff] [blame] | 75 | ${INTERFACE_INC_DIR}/psa/crypto_platform.h |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 76 | ${INTERFACE_INC_DIR}/psa/crypto_sizes.h |
| 77 | ${INTERFACE_INC_DIR}/psa/crypto_struct.h |
| 78 | ${INTERFACE_INC_DIR}/psa/crypto_types.h |
| 79 | ${INTERFACE_INC_DIR}/psa/crypto_values.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 80 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 81 | install(FILES ${INTERFACE_INC_DIR}/tfm_crypto_defs.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 82 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 83 | endif() |
| 84 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 85 | if (TFM_PARTITION_INITIAL_ATTESTATION) |
David Hu | 9191b61 | 2023-06-08 12:02:39 +0800 | [diff] [blame] | 86 | install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/psa/initial_attestation.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 87 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 88 | install(FILES ${INTERFACE_INC_DIR}/tfm_attest_defs.h |
David Hu | 32bd615 | 2022-09-27 13:10:36 +0800 | [diff] [blame] | 89 | ${INTERFACE_INC_DIR}/tfm_attest_iat_defs.h |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 90 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 91 | endif() |
| 92 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 93 | if(TFM_PARTITION_PLATFORM) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 94 | install(FILES ${INTERFACE_INC_DIR}/tfm_platform_api.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 95 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 96 | endif() |
| 97 | |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 98 | if(TFM_PARTITION_FIRMWARE_UPDATE) |
| 99 | install(FILES ${INTERFACE_INC_DIR}/psa/update.h |
Sherry Zhang | 73126e5 | 2022-02-15 14:27:49 +0800 | [diff] [blame] | 100 | ${CMAKE_BINARY_DIR}/generated/interface/include/psa/fwu_config.h |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 101 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
| 102 | install(FILES ${INTERFACE_INC_DIR}/tfm_fwu_defs.h |
| 103 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 104 | endif() |
| 105 | |
David Hu | 32bd615 | 2022-09-27 13:10:36 +0800 | [diff] [blame] | 106 | if(PLATFORM_DEFAULT_CRYPTO_KEYS) |
| 107 | install(DIRECTORY ${INTERFACE_INC_DIR}/crypto_keys |
| 108 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 109 | endif() |
| 110 | |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 111 | ####################### export sources ######################################### |
| 112 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 113 | if (TFM_PARTITION_NS_AGENT_MAILBOX) |
David Hu | 04969a4 | 2020-06-14 21:25:35 +0800 | [diff] [blame] | 114 | install(FILES ${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox.c |
| 115 | ${INTERFACE_SRC_DIR}/multi_core/tfm_multi_core_ns_api.c |
| 116 | ${INTERFACE_SRC_DIR}/multi_core/tfm_multi_core_psa_ns_api.c |
David Hu | d597345 | 2020-11-26 16:47:46 +0800 | [diff] [blame] | 117 | ${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox_thread.c |
David Hu | 32bd615 | 2022-09-27 13:10:36 +0800 | [diff] [blame] | 118 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}/multi_core) |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 119 | endif() |
David Hu | f07f3f1 | 2021-04-06 18:03:33 +0800 | [diff] [blame] | 120 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 121 | if (TFM_PARTITION_NS_AGENT_TZ) |
| 122 | install(FILES ${INTERFACE_SRC_DIR}/tfm_psa_ns_api.c |
| 123 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
| 124 | endif() |
| 125 | |
BohdanHunko | f871df0 | 2023-02-03 14:36:41 +0200 | [diff] [blame] | 126 | install(DIRECTORY ${INTERFACE_INC_DIR}/os_wrapper |
| 127 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 128 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 129 | if (CONFIG_TFM_USE_TRUSTZONE) |
BohdanHunko | f871df0 | 2023-02-03 14:36:41 +0200 | [diff] [blame] | 130 | install(DIRECTORY ${INTERFACE_SRC_DIR}/os_wrapper |
David Hu | f07f3f1 | 2021-04-06 18:03:33 +0800 | [diff] [blame] | 131 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 132 | endif() |
| 133 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 134 | if (TFM_PARTITION_PROTECTED_STORAGE) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 135 | install(FILES ${INTERFACE_SRC_DIR}/tfm_ps_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 136 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 137 | endif() |
| 138 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 139 | if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 140 | install(FILES ${INTERFACE_SRC_DIR}/tfm_its_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 141 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 142 | endif() |
| 143 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 144 | if (TFM_PARTITION_CRYPTO) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 145 | install(FILES ${INTERFACE_SRC_DIR}/tfm_crypto_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 146 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 147 | endif() |
| 148 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 149 | if (TFM_PARTITION_INITIAL_ATTESTATION) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 150 | install(FILES ${INTERFACE_SRC_DIR}/tfm_attest_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 151 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 152 | endif() |
| 153 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 154 | if(TFM_PARTITION_PLATFORM) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 155 | install(FILES ${INTERFACE_SRC_DIR}/tfm_platform_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 156 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 157 | endif() |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 158 | |
| 159 | |
| 160 | ##################### Export image signing information ######################### |
| 161 | |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 162 | if(BL2) |
| 163 | install(DIRECTORY bl2/ext/mcuboot/scripts |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 164 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR} |
| 165 | PATTERN "scripts/*.py" |
| 166 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ |
| 167 | GROUP_EXECUTE GROUP_READ |
| 168 | PATTERN "scripts/wrapper/*.py" |
| 169 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ |
| 170 | GROUP_EXECUTE GROUP_READ) |
| 171 | |
| 172 | install(DIRECTORY ${MCUBOOT_PATH}/scripts/imgtool |
| 173 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/scripts) |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 174 | |
| 175 | if (MCUBOOT_ENC_IMAGES) |
| 176 | install(FILES ${MCUBOOT_KEY_ENC} |
Alamy Liu | 2c13c03 | 2021-01-20 09:55:50 -0800 | [diff] [blame] | 177 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/keys) |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 178 | endif() |
| 179 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 180 | # unconditionally install all necessary files for optional signing |
| 181 | install(FILES $<TARGET_OBJECTS:signing_layout_s> |
| 182 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/layout_files) |
| 183 | |
| 184 | if(MCUBOOT_IMAGE_NUMBER GREATER 1) |
| 185 | install(FILES $<TARGET_OBJECTS:signing_layout_ns> |
| 186 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/layout_files) |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 187 | endif() |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 188 | |
| 189 | install(FILES ${MCUBOOT_KEY_NS} ${MCUBOOT_KEY_S} |
| 190 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/keys) |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 191 | endif() |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 192 | |
| 193 | if(TFM_PARTITION_FIRMWARE_UPDATE) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 194 | install(FILES ${INTERFACE_SRC_DIR}/tfm_fwu_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 195 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 196 | endif() |
Chris Brand | 9edf081 | 2022-07-05 14:18:42 -0700 | [diff] [blame] | 197 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 198 | ###################### Install NS platform sources ############################# |
David Hu | 895cdc3 | 2023-01-16 19:19:25 +0800 | [diff] [blame] | 199 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 200 | install(CODE "MESSAGE(\"----- Installing platform NS -----\")") |
| 201 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 202 | install(DIRECTORY ${PLATFORM_DIR}/ext/cmsis |
| 203 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}) |
| 204 | |
David Hu | 71f6dcc | 2023-10-18 11:52:21 +0800 | [diff] [blame^] | 205 | install(DIRECTORY ${PLATFORM_DIR}/include |
| 206 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}) |
| 207 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 208 | install(FILES ${CMAKE_SOURCE_DIR}/cmake/spe-CMakeLists.cmake |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 209 | DESTINATION ${CMAKE_INSTALL_PREFIX} |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 210 | RENAME CMakeLists.txt) |
| 211 | |
David Hu | c28b9b2 | 2023-10-14 15:33:16 +0800 | [diff] [blame] | 212 | install(FILES ${PLATFORM_DIR}/ns/toolchain_ns_GNUARM.cmake |
| 213 | ${PLATFORM_DIR}/ns/toolchain_ns_ARMCLANG.cmake |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 214 | DESTINATION ${INSTALL_CMAKE_DIR}) |
| 215 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 216 | install(FILES |
| 217 | ${CMAKE_SOURCE_DIR}/lib/fih/inc/fih.h |
| 218 | ${PLATFORM_DIR}/include/tfm_plat_ns.h |
| 219 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}/include) |
| 220 | |
| 221 | if (TARGET psa_crypto_config) |
| 222 | # FIXIT: This is a temporal patch to reduce the change scope and simplify review. |
| 223 | # In the future we shall decouple this target from tfm_config becuase |
| 224 | # "psa_crypto_config" target exists not in all configurations. |
| 225 | # Functionally "psa_crypto_config" provides only include path for Crypto accelerator. |
| 226 | install(TARGETS tfm_config psa_crypto_config psa_interface |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 227 | DESTINATION ${CMAKE_INSTALL_PREFIX} |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 228 | EXPORT tfm-config |
| 229 | ) |
| 230 | else() |
| 231 | install(TARGETS tfm_config psa_interface |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 232 | DESTINATION ${CMAKE_INSTALL_PREFIX} |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 233 | EXPORT tfm-config |
| 234 | ) |
| 235 | endif() |
| 236 | |
| 237 | target_include_directories(psa_interface |
| 238 | INTERFACE |
| 239 | $<INSTALL_INTERFACE:interface/include> |
| 240 | ) |
| 241 | |
| 242 | install(EXPORT tfm-config |
| 243 | FILE spe_export.cmake |
| 244 | DESTINATION ${INSTALL_CMAKE_DIR}) |
| 245 | |
| 246 | configure_file(${CMAKE_SOURCE_DIR}/config/spe_config.cmake.in |
| 247 | ${INSTALL_CMAKE_DIR}/spe_config.cmake @ONLY) |