Minor cleanup of CMakeLists.txt

This commit is contained in:
eidheim 2016-11-23 14:06:58 +01:00
commit 6138e95d08

View file

@ -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()