CMakeLists.txt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_sources(ssl_client2 PUBLIC query_config.c)
  30. target_link_libraries(ssl_client2 ${libs})
  31. add_executable(ssl_server ssl_server.c)
  32. target_link_libraries(ssl_server ${libs})
  33. add_executable(ssl_server2 ssl_server2.c)
  34. target_sources(ssl_server2 PUBLIC query_config.c)
  35. target_link_libraries(ssl_server2 ${libs})
  36. add_executable(ssl_fork_server ssl_fork_server.c)
  37. target_link_libraries(ssl_fork_server ${libs})
  38. add_executable(ssl_mail_client ssl_mail_client.c)
  39. target_link_libraries(ssl_mail_client ${libs})
  40. add_executable(mini_client mini_client.c)
  41. target_link_libraries(mini_client ${libs})
  42. if(THREADS_FOUND)
  43. add_executable(ssl_pthread_server ssl_pthread_server.c)
  44. target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT})
  45. set(targets ${targets} ssl_pthread_server)
  46. endif(THREADS_FOUND)
  47. install(TARGETS ${targets}
  48. DESTINATION "bin"
  49. PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)