Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 1 | set(executables |
Manuel Pégourié-Gonnard | 6fdc9e8 | 2022-01-31 13:27:39 +0100 | [diff] [blame] | 2 | aead_demo |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 3 | crypto_examples |
Manuel Pégourié-Gonnard | 69bb3f5 | 2022-01-31 13:09:47 +0100 | [diff] [blame] | 4 | hmac_demo |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 5 | key_ladder_demo |
| 6 | psa_constant_names |
| 7 | ) |
itayzafrir | a3ff8a6 | 2018-07-10 10:10:21 +0300 | [diff] [blame] | 8 | |
David Horstmann | a8d1406 | 2021-10-20 17:14:23 +0100 | [diff] [blame] | 9 | if(GEN_FILES) |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 10 | add_custom_command( |
| 11 | OUTPUT |
| 12 | ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c |
| 13 | COMMAND |
David Horstmann | 3e30ad9 | 2021-10-20 16:53:58 +0100 | [diff] [blame] | 14 | ${MBEDTLS_PYTHON_EXECUTABLE} |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 15 | ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py |
| 16 | ${CMAKE_CURRENT_BINARY_DIR} |
| 17 | WORKING_DIRECTORY |
| 18 | ${CMAKE_CURRENT_SOURCE_DIR}/../.. |
| 19 | DEPENDS |
Manuel Pégourié-Gonnard | 15a42c3 | 2021-05-14 10:33:32 +0200 | [diff] [blame] | 20 | ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 21 | ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_values.h |
| 22 | ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_extra.h |
| 23 | ) |
| 24 | else() |
| 25 | link_to_source(psa_constant_names_generated.c) |
| 26 | endif() |
Manuel Pégourié-Gonnard | 15a42c3 | 2021-05-14 10:33:32 +0200 | [diff] [blame] | 27 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 28 | foreach(exe IN LISTS executables) |
Ronald Cron | 8dc0af2 | 2020-06-05 16:00:22 +0200 | [diff] [blame] | 29 | add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>) |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 30 | target_link_libraries(${exe} ${mbedcrypto_target}) |
Ronald Cron | 8dc0af2 | 2020-06-05 16:00:22 +0200 | [diff] [blame] | 31 | target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include) |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 32 | endforeach() |
Gilles Peskine | f31dbb7 | 2019-01-02 17:28:46 +0100 | [diff] [blame] | 33 | |
Hugues de Valon | 235c72d | 2020-05-28 08:42:01 +0100 | [diff] [blame] | 34 | target_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |
David Horstmann | a8d1406 | 2021-10-20 17:14:23 +0100 | [diff] [blame] | 35 | if(GEN_FILES) |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame] | 36 | add_custom_target(generate_psa_constant_names_generated_c |
| 37 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c) |
| 38 | add_dependencies(psa_constant_names generate_psa_constant_names_generated_c) |
| 39 | endif() |
Gilles Peskine | 6a78573 | 2019-01-02 17:29:04 +0100 | [diff] [blame] | 40 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 41 | install(TARGETS ${executables} |
itayzafrir | a3ff8a6 | 2018-07-10 10:10:21 +0300 | [diff] [blame] | 42 | DESTINATION "bin" |
| 43 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
| 44 | |
Gilles Peskine | f31dbb7 | 2019-01-02 17:28:46 +0100 | [diff] [blame] | 45 | install(PROGRAMS |
| 46 | key_ladder_demo.sh |
| 47 | DESTINATION "bin") |