1set(THREADS_USE_PTHREADS_WIN32 true) 2find_package(Threads) 3 4set(libs 5 mbedtls 6) 7 8set(targets 9 dtls_client 10 dtls_server 11 mini_client 12 ssl_client1 13 ssl_client2 14 ssl_fork_server 15 ssl_mail_client 16 ssl_server 17 ssl_server2 18) 19 20if(USE_PKCS11_HELPER_LIBRARY) 21 set(libs ${libs} pkcs11-helper) 22endif(USE_PKCS11_HELPER_LIBRARY) 23 24if(ENABLE_ZLIB_SUPPORT) 25 set(libs ${libs} ${ZLIB_LIBRARIES}) 26endif(ENABLE_ZLIB_SUPPORT) 27 28add_executable(dtls_client dtls_client.c) 29target_link_libraries(dtls_client ${libs}) 30 31add_executable(dtls_server dtls_server.c) 32target_link_libraries(dtls_server ${libs}) 33 34add_executable(mini_client mini_client.c) 35target_link_libraries(mini_client ${libs}) 36 37add_executable(ssl_client1 ssl_client1.c) 38target_link_libraries(ssl_client1 ${libs}) 39 40add_executable(ssl_client2 ssl_client2.c 41 ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c) 42target_link_libraries(ssl_client2 ${libs}) 43 44add_executable(ssl_fork_server ssl_fork_server.c) 45target_link_libraries(ssl_fork_server ${libs}) 46 47add_executable(ssl_mail_client ssl_mail_client.c) 48target_link_libraries(ssl_mail_client ${libs}) 49 50add_executable(ssl_server ssl_server.c) 51target_link_libraries(ssl_server ${libs}) 52 53add_executable(ssl_server2 ssl_server2.c 54 ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c) 55target_link_libraries(ssl_server2 ${libs}) 56 57if(THREADS_FOUND) 58 add_executable(ssl_pthread_server ssl_pthread_server.c) 59 target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT}) 60 set(targets ${targets} ssl_pthread_server) 61endif(THREADS_FOUND) 62 63install(TARGETS ${targets} 64 DESTINATION "bin" 65 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) 66