Skip to content

Commit e2c257f

Browse files
committed
Fixed CMake scripts for MSVC 10.0
1 parent 0ab08fc commit e2c257f

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

libs/network/example/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@ endif (OPENSSL_FOUND)
1111
add_executable(http_client http_client.cpp)
1212
add_executable(simple_wget simple_wget.cpp)
1313
add_executable(hello_world_server http/hello_world_server.cpp)
14-
add_executable(fileserver http/fileserver.cpp)
14+
if (UNIX)
15+
add_executable(fileserver http/fileserver.cpp)
16+
endif (UNIX)
1517
add_executable(uri uri.cpp)
1618
add_dependencies(http_client cppnetlib-uri cppnetlib-client-connections)
1719
add_dependencies(simple_wget cppnetlib-uri cppnetlib-client-connections)
1820
add_dependencies(uri cppnetlib-uri)
1921
set(BOOST_CLIENT_LIBS
2022
${Boost_PROGRAM_OPTIONS_LIBRARY}
2123
${Boost_THREAD_LIBRARY}
24+
${Boost_DATE_TIME_LIBRARY}
25+
${Boost_REGEX_LIBRARY}
2226
${Boost_SYSTEM_LIBRARY})
2327

2428
set(BOOST_SERVER_LIBS
2529
${Boost_THREAD_LIBRARY}
2630
${Boost_SYSTEM_LIBRARY}
31+
${Boost_DATE_TIME_LIBRARY}
2732
${Boost_PROGRAM_OPTIONS_LIBRARY})
2833

2934
target_link_libraries(http_client
@@ -48,15 +53,19 @@ if (OPENSSL_FOUND)
4853
target_link_libraries(hello_world_server ${OPENSSL_LIBRARIES})
4954
endif (OPENSSL_FOUND)
5055

51-
target_link_libraries(fileserver
56+
if (UNIX)
57+
target_link_libraries(fileserver
5258
${BOOST_SERVER_LIBS}
5359
${Boost_FILESYSTEM_LIBRARY}
5460
${CMAKE_THREAD_LIBS_INIT}
5561
cppnetlib-server-parsers)
62+
endif (UNIX)
5663

5764
target_link_libraries(uri cppnetlib-uri)
5865
set_target_properties(http_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
5966
set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
6067
set_target_properties(hello_world_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
61-
set_target_properties(fileserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
68+
if (UNIX)
69+
set_target_properties(fileserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
70+
endif (UNIX)
6271
set_target_properties(uri PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)

libs/network/test/http/CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ if (OPENSSL_FOUND)
1313
endif()
1414

1515
if (Boost_FOUND)
16-
set ( BOOST_LIBS
17-
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
18-
${Boost_THREAD_LIBRARY}
19-
${Boost_SYSTEM_LIBRARY})
2016
set ( TESTS
2117
client_constructor_test
2218
client_get_test
@@ -34,7 +30,7 @@ if (Boost_FOUND)
3430
cppnetlib-uri
3531
cppnetlib-client-connections)
3632
target_link_libraries(cpp-netlib-http-${test}
37-
${BOOST_LIBS} ${CMAKE_THREAD_LIBS_INIT}
33+
${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
3834
cppnetlib-uri
3935
cppnetlib-client-connections)
4036
if (OPENSSL_FOUND)
@@ -57,7 +53,7 @@ if (Boost_FOUND)
5753
endif()
5854
add_executable(cpp-netlib-http-${test} ${test}.cpp)
5955
add_dependencies(cpp-netlib-http-${test} cppnetlib-server-parsers)
60-
target_link_libraries(cpp-netlib-http-${test} ${BOOST_LIBS} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
56+
target_link_libraries(cpp-netlib-http-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
6157
set_target_properties(cpp-netlib-http-${test}
6258
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests)
6359
add_test(cpp-netlib-http-${test}
@@ -78,7 +74,7 @@ if (Boost_FOUND)
7874
# endif()
7975
# add_executable(cpp-netlib-http-${test} ${test}.cpp)
8076
# add_dependencies(cpp-netlib-http-${test} cppnetlib-server-parsers)
81-
# target_link_libraries(cpp-netlib-http-${test} ${BOOST_LIBS} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
77+
# target_link_libraries(cpp-netlib-http-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
8278
# set_target_properties(cpp-netlib-http-${test}
8379
# PROPERTIES RUNTIME_OUTPUT_DIRECTORY
8480
# ${CPP-NETLIB_BINARY_DIR}/tests)

0 commit comments

Comments
 (0)