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