Skip to content

Commit 447841f

Browse files
committed
Fixing CMake configuration for more cross-platform support; MSVS 2010 tested.
1 parent 944ba1b commit 447841f

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

libs/network/test/CMakeLists.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR})
77
find_package( Boost 1.41.0 COMPONENTS unit_test_framework system regex date_time thread filesystem )
8+
find_package( OpenSSL )
9+
include_directories(${OPENSSL_INCLUDE_DIR})
10+
find_package( Threads )
811
set(Boost_USE_STATIC_LIBS ON)
912
set(Boost_USE_MULTITHREADED ON)
1013

@@ -18,15 +21,15 @@ if (Boost_FOUND)
1821
add_executable(cpp-netlib-http_message_test http_message_test.cpp)
1922
add_executable(cpp-netlib-message_transform_test message_transform_test.cpp)
2023
add_executable(cpp-netlib-url_test url_test.cpp)
21-
target_link_libraries(cpp-netlib-hello_world ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_THREAD_LIBRARY} pthread)
22-
target_link_libraries(cpp-netlib-http_1_0_test ${Boost_LIBRARIES} pthread ssl crypto)
23-
target_link_libraries(cpp-netlib-http_1_1_test ${Boost_LIBRARIES} pthread ssl crypto)
24-
target_link_libraries(cpp-netlib-http_message_test ${Boost_LIBRARIES} pthread ssl crypto)
25-
target_link_libraries(cpp-netlib-message_test ${Boost_LIBRARIES} pthread ssl crypto)
26-
target_link_libraries(cpp-netlib-message_transform_test ${Boost_LIBRARIES} pthread ssl crypto)
27-
target_link_libraries(cpp-netlib-http_localhost_tests ${Boost_LIBRARIES} pthread ssl crypto)
28-
target_link_libraries(cpp-netlib-https_localhost_tests ${Boost_LIBRARIES} pthread ssl crypto)
29-
target_link_libraries(cpp-netlib-url_test ${Boost_LIBRARIES} pthread ssl crypto)
24+
target_link_libraries(cpp-netlib-hello_world ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_THREAD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} )
25+
target_link_libraries(cpp-netlib-http_1_0_test ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
26+
target_link_libraries(cpp-netlib-http_1_1_test ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
27+
target_link_libraries(cpp-netlib-http_message_test ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
28+
target_link_libraries(cpp-netlib-message_test ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
29+
target_link_libraries(cpp-netlib-message_transform_test ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
30+
target_link_libraries(cpp-netlib-http_localhost_tests ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
31+
target_link_libraries(cpp-netlib-https_localhost_tests ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
32+
target_link_libraries(cpp-netlib-url_test ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES})
3033
set_target_properties(cpp-netlib-hello_world cpp-netlib-http_1_0_test cpp-netlib-http_1_1_test cpp-netlib-message_test cpp-netlib-http_message_test cpp-netlib-message_transform_test cpp-netlib-http_localhost_tests cpp-netlib-https_localhost_tests cpp-netlib-url_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../../../build/tests)
3134
add_test(cpp-netlib-hello_world python httplib_acceptance.py ../../../build/tests/cpp-netlib-hello_world ../../../build/tests/cpp-netlib-hello_world.passed)
3235
add_test(cpp-netlib-http_1_0_test ../../../build/tests/cpp-netlib-http_1_0_test)

0 commit comments

Comments
 (0)