diff --git a/CMakeLists.txt b/CMakeLists.txt index 86829e2..89b2427 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,10 @@ if(APPLE) set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") endif() +add_executable(http_examples http_examples.cpp) +target_link_libraries(http_examples ${Boost_LIBRARIES}) +target_link_libraries(http_examples ${CMAKE_THREAD_LIBS_INIT}) + #TODO: add requirement for version 1.0.1g (can it be done in one line?) find_package(OpenSSL) @@ -33,13 +37,11 @@ if(OPENSSL_FOUND) target_link_libraries(https_examples ${CMAKE_THREAD_LIBS_INIT}) endif() -add_executable(http_examples http_examples.cpp) -target_link_libraries(http_examples ${Boost_LIBRARIES}) -target_link_libraries(http_examples ${CMAKE_THREAD_LIBS_INIT}) - if(MSYS) #TODO: Is MSYS true when MSVC is true? target_link_libraries(http_examples ws2_32 wsock32) - target_link_libraries(https_examples ws2_32 wsock32) + if(OPENSSL_FOUND) + target_link_libraries(https_examples ws2_32 wsock32) + endif() endif() enable_testing()