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 | |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 8 | set(targets |
Manuel Pégourié-Gonnard | 216a183 | 2015-06-25 09:20:03 +0200 | [diff] [blame] | 9 | dtls_client |
| 10 | dtls_server |
| 11 | ssl_client1 |
| 12 | ssl_client2 |
| 13 | ssl_server |
| 14 | ssl_fork_server |
| 15 | ssl_mail_client |
| 16 | mini_client |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 17 | ) |
| 18 | |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 19 | if(USE_PKCS11_HELPER_LIBRARY) |
| 20 | set(libs ${libs} pkcs11-helper) |
| 21 | endif(USE_PKCS11_HELPER_LIBRARY) |
| 22 | |
Paul Bakker | 92eeea4 | 2012-07-03 15:10:33 +0000 | [diff] [blame] | 23 | if(ENABLE_ZLIB_SUPPORT) |
| 24 | set(libs ${libs} ${ZLIB_LIBRARIES}) |
| 25 | endif(ENABLE_ZLIB_SUPPORT) |
| 26 | |
Manuel Pégourié-Gonnard | e63582a | 2014-10-14 11:47:21 +0200 | [diff] [blame] | 27 | add_executable(dtls_client dtls_client.c) |
| 28 | target_link_libraries(dtls_client ${libs}) |
| 29 | |
| 30 | add_executable(dtls_server dtls_server.c) |
| 31 | target_link_libraries(dtls_server ${libs}) |
| 32 | |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 33 | add_executable(ssl_client1 ssl_client1.c) |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 34 | target_link_libraries(ssl_client1 ${libs}) |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 35 | |
Andres Amaya Garcia | cb6b6dc | 2018-10-30 21:21:08 +0000 | [diff] [blame] | 36 | add_executable(ssl_client2 ssl_client2.c) |
| 37 | target_sources(ssl_client2 PUBLIC query_config.c) |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 38 | target_link_libraries(ssl_client2 ${libs}) |
Paul Bakker | 367dae4 | 2009-06-28 21:50:27 +0000 | [diff] [blame] | 39 | |
| 40 | add_executable(ssl_server ssl_server.c) |
Paul Bakker | b06819b | 2011-01-18 16:18:38 +0000 | [diff] [blame] | 41 | target_link_libraries(ssl_server ${libs}) |
Paul Bakker | 547f73d | 2011-01-05 15:07:54 +0000 | [diff] [blame] | 42 | |
Andres Amaya Garcia | cb6b6dc | 2018-10-30 21:21:08 +0000 | [diff] [blame] | 43 | add_executable(ssl_server2 ssl_server2.c) |
| 44 | target_sources(ssl_server2 PUBLIC query_config.c) |
Paul Bakker | b60b95f | 2012-09-25 09:05:17 +0000 | [diff] [blame] | 45 | target_link_libraries(ssl_server2 ${libs}) |
| 46 | |
Paul Bakker | 896ac22 | 2011-05-20 12:33:05 +0000 | [diff] [blame] | 47 | add_executable(ssl_fork_server ssl_fork_server.c) |
| 48 | target_link_libraries(ssl_fork_server ${libs}) |
| 49 | |
Paul Bakker | 1496d38 | 2011-05-23 12:07:29 +0000 | [diff] [blame] | 50 | add_executable(ssl_mail_client ssl_mail_client.c) |
| 51 | target_link_libraries(ssl_mail_client ${libs}) |
| 52 | |
Manuel Pégourié-Gonnard | a6fc5b2 | 2014-11-24 14:05:25 +0100 | [diff] [blame] | 53 | add_executable(mini_client mini_client.c) |
| 54 | target_link_libraries(mini_client ${libs}) |
| 55 | |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 56 | if(THREADS_FOUND) |
| 57 | add_executable(ssl_pthread_server ssl_pthread_server.c) |
Paul Bakker | 3e72f6e | 2013-12-30 15:25:08 +0100 | [diff] [blame] | 58 | target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT}) |
Paul Bakker | f9c4953 | 2013-12-19 15:40:58 +0100 | [diff] [blame] | 59 | set(targets ${targets} ssl_pthread_server) |
| 60 | endif(THREADS_FOUND) |
| 61 | |
| 62 | install(TARGETS ${targets} |
Paul Bakker | 547f73d | 2011-01-05 15:07:54 +0000 | [diff] [blame] | 63 | DESTINATION "bin" |
| 64 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |