CMakeLists.txt 1.6 KB

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