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