Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 1 | set(libs |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 2 | mbedtls |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 3 | ) |
| 4 | |
| 5 | if(USE_PKCS11_HELPER_LIBRARY) |
| 6 | set(libs ${libs} pkcs11-helper) |
| 7 | endif(USE_PKCS11_HELPER_LIBRARY) |
| 8 | |
Paul Bakker | 92eeea4 | 2012-07-03 15:10:33 +0000 | [diff] [blame] | 9 | if(ENABLE_ZLIB_SUPPORT) |
| 10 | set(libs ${libs} ${ZLIB_LIBRARIES}) |
| 11 | endif(ENABLE_ZLIB_SUPPORT) |
| 12 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 13 | set(executables_libs |
| 14 | selftest |
| 15 | udp_proxy |
| 16 | ) |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 17 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 18 | set(executables_mbedcrypto |
| 19 | benchmark |
| 20 | query_compile_time_config |
| 21 | zeroize |
| 22 | ) |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 23 | |
Andrzej Kurek | 0211c32 | 2018-03-15 05:16:24 -0400 | [diff] [blame] | 24 | if(TEST_CPP) |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 25 | list(APPEND executables_mbedcrypto cpp_dummy_build) |
Andrzej Kurek | 0211c32 | 2018-03-15 05:16:24 -0400 | [diff] [blame] | 26 | endif() |
| 27 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 28 | foreach(exe IN LISTS executables_libs executables_mbedcrypto) |
| 29 | add_executable(${exe} ${exe}.c) |
Manuel Pégourié-Gonnard | cb4137b | 2014-09-04 14:55:28 +0200 | [diff] [blame] | 30 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 31 | # This emulates "if ( ... IN_LIST ... )" which becomes available in CMake 3.3 |
| 32 | list(FIND executables_libs ${exe} exe_index) |
| 33 | if (${exe_index} GREATER -1) |
| 34 | target_link_libraries(${exe} ${libs}) |
| 35 | else() |
| 36 | target_link_libraries(${exe} mbedcrypto) |
| 37 | endif() |
| 38 | endforeach() |
Andres Amaya Garcia | 5ab74a1 | 2017-10-24 21:10:45 +0100 | [diff] [blame] | 39 | |
Ronald Cron | 0b90c9d | 2020-06-05 14:02:43 +0200 | [diff] [blame] | 40 | target_sources(query_compile_time_config PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c) |
Andres AG | 509ba69 | 2018-10-26 18:41:08 +0100 | [diff] [blame] | 41 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 42 | install(TARGETS ${executables_libs} ${executables_mbedcrypto} |
Paul Bakker | 547f73d | 2011-01-05 15:07:54 +0000 | [diff] [blame] | 43 | DESTINATION "bin" |
| 44 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |