Paul Bakker | 3e72f6e | 2013-12-30 15:25:08 +0100 | [diff] [blame] | 1 | set(THREADS_USE_PTHREADS_WIN32 true) |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 2 | find_package(Threads) |
| 3 | |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 4 | set(libs |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 5 | mbedtls |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 6 | ) |
| 7 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 8 | if(USE_PKCS11_HELPER_LIBRARY) |
| 9 | set(libs ${libs} pkcs11-helper) |
| 10 | endif(USE_PKCS11_HELPER_LIBRARY) |
| 11 | |
| 12 | if(ENABLE_ZLIB_SUPPORT) |
| 13 | set(libs ${libs} ${ZLIB_LIBRARIES}) |
| 14 | endif(ENABLE_ZLIB_SUPPORT) |
| 15 | |
| 16 | set(executables |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 17 | dtls_client |
| 18 | dtls_server |
Manuel Pégourié-Gonnard | 6f83025 | 2020-04-03 11:56:06 +0200 | [diff] [blame] | 19 | mini_client |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 20 | ssl_client1 |
| 21 | ssl_client2 |
Ronald Cron | 2773113 | 2020-06-05 11:51:28 +0200 | [diff] [blame] | 22 | ssl_context_info |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 23 | ssl_fork_server |
| 24 | ssl_mail_client |
Manuel Pégourié-Gonnard | 6f83025 | 2020-04-03 11:56:06 +0200 | [diff] [blame] | 25 | ssl_server |
Ronald Cron | 2773113 | 2020-06-05 11:51:28 +0200 | [diff] [blame] | 26 | ssl_server2 |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 27 | ) |
| 28 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 29 | foreach(exe IN LISTS executables) |
Ronald Cron | 8dc0af2 | 2020-06-05 16:00:22 +0200 | [diff] [blame^] | 30 | add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>) |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 31 | target_link_libraries(${exe} ${libs}) |
Ronald Cron | 8dc0af2 | 2020-06-05 16:00:22 +0200 | [diff] [blame^] | 32 | target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include) |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 33 | endforeach() |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 34 | |
Ronald Cron | 0b90c9d | 2020-06-05 14:02:43 +0200 | [diff] [blame] | 35 | target_sources(ssl_client2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c) |
Ronald Cron | 0b90c9d | 2020-06-05 14:02:43 +0200 | [diff] [blame] | 36 | target_sources(ssl_server2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c) |
Manuel Pégourié-Gonnard | a6fc5b2 | 2014-11-24 14:05:25 +0100 | [diff] [blame] | 37 | |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 38 | if(THREADS_FOUND) |
Ronald Cron | 8dc0af2 | 2020-06-05 16:00:22 +0200 | [diff] [blame^] | 39 | add_executable(ssl_pthread_server ssl_pthread_server.c $<TARGET_OBJECTS:mbedtls_test>) |
Paul Bakker | 3e72f6e | 2013-12-30 15:25:08 +0100 | [diff] [blame] | 40 | target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT}) |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 41 | list(APPEND executables ssl_pthread_server) |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 42 | endif(THREADS_FOUND) |
| 43 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 44 | install(TARGETS ${executables} |
Paul Bakker | 547f73d | 2011-01-05 15:07:54 +0000 | [diff] [blame] | 45 | DESTINATION "bin" |
| 46 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |