1set(THREADS_USE_PTHREADS_WIN32 true) 2find_package(Threads) 3 4set(libs 5 ${mbedtls_target} 6) 7 8if(USE_PKCS11_HELPER_LIBRARY) 9 set(libs ${libs} pkcs11-helper) 10endif(USE_PKCS11_HELPER_LIBRARY) 11 12if(ENABLE_ZLIB_SUPPORT) 13 set(libs ${libs} ${ZLIB_LIBRARIES}) 14endif(ENABLE_ZLIB_SUPPORT) 15 16set(executables 17 dtls_client 18 dtls_server 19 mini_client 20 ssl_client1 21 ssl_client2 22 ssl_context_info 23 ssl_fork_server 24 ssl_mail_client 25 ssl_server 26 ssl_server2 27) 28 29foreach(exe IN LISTS executables) 30 set(extra_sources "") 31 if(exe STREQUAL "ssl_client2" OR exe STREQUAL "ssl_server2") 32 list(APPEND extra_sources 33 ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c) 34 endif() 35 add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test> 36 ${extra_sources}) 37 target_link_libraries(${exe} ${libs}) 38 target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include) 39endforeach() 40 41set_property(TARGET ssl_client2 APPEND PROPERTY SOURCES 42 ssl_test_lib.c ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c) 43set_property(TARGET ssl_server2 APPEND PROPERTY SOURCES 44 ssl_test_lib.c ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c) 45 46if(THREADS_FOUND) 47 add_executable(ssl_pthread_server ssl_pthread_server.c $<TARGET_OBJECTS:mbedtls_test>) 48 target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT}) 49 list(APPEND executables ssl_pthread_server) 50endif(THREADS_FOUND) 51 52install(TARGETS ${executables} 53 DESTINATION "bin" 54 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) 55