1a8e1175bSopenharmony_ciset(executables 2a8e1175bSopenharmony_ci aead_demo 3a8e1175bSopenharmony_ci crypto_examples 4a8e1175bSopenharmony_ci hmac_demo 5a8e1175bSopenharmony_ci key_ladder_demo 6a8e1175bSopenharmony_ci psa_constant_names 7a8e1175bSopenharmony_ci psa_hash 8a8e1175bSopenharmony_ci) 9a8e1175bSopenharmony_ci 10a8e1175bSopenharmony_ciif(GEN_FILES) 11a8e1175bSopenharmony_ci add_custom_command( 12a8e1175bSopenharmony_ci OUTPUT 13a8e1175bSopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c 14a8e1175bSopenharmony_ci COMMAND 15a8e1175bSopenharmony_ci ${MBEDTLS_PYTHON_EXECUTABLE} 16a8e1175bSopenharmony_ci ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py 17a8e1175bSopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR} 18a8e1175bSopenharmony_ci WORKING_DIRECTORY 19a8e1175bSopenharmony_ci ${CMAKE_CURRENT_SOURCE_DIR}/../.. 20a8e1175bSopenharmony_ci DEPENDS 21a8e1175bSopenharmony_ci ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py 22a8e1175bSopenharmony_ci ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_values.h 23a8e1175bSopenharmony_ci ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_extra.h 24a8e1175bSopenharmony_ci ) 25a8e1175bSopenharmony_cielse() 26a8e1175bSopenharmony_ci link_to_source(psa_constant_names_generated.c) 27a8e1175bSopenharmony_ciendif() 28a8e1175bSopenharmony_ci 29a8e1175bSopenharmony_ciforeach(exe IN LISTS executables) 30a8e1175bSopenharmony_ci add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>) 31a8e1175bSopenharmony_ci target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT}) 32a8e1175bSopenharmony_ci target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include) 33a8e1175bSopenharmony_ciendforeach() 34a8e1175bSopenharmony_ci 35a8e1175bSopenharmony_citarget_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) 36a8e1175bSopenharmony_ciif(GEN_FILES) 37a8e1175bSopenharmony_ci add_custom_target(generate_psa_constant_names_generated_c 38a8e1175bSopenharmony_ci DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c) 39a8e1175bSopenharmony_ci add_dependencies(psa_constant_names generate_psa_constant_names_generated_c) 40a8e1175bSopenharmony_ciendif() 41a8e1175bSopenharmony_ci 42a8e1175bSopenharmony_ciinstall(TARGETS ${executables} 43a8e1175bSopenharmony_ci DESTINATION "bin" 44a8e1175bSopenharmony_ci PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) 45a8e1175bSopenharmony_ci 46a8e1175bSopenharmony_ciinstall(PROGRAMS 47a8e1175bSopenharmony_ci key_ladder_demo.sh 48a8e1175bSopenharmony_ci DESTINATION "bin") 49