Skip to content

Commit c76a1fc

Browse files
committed
Cleaned up example build file so that it can build on MSVC.
1 parent 21015f7 commit c76a1fc

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

boost/network/protocol/http/message/async_message.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <boost/thread/future.hpp>
1313
#include <boost/cstdint.hpp>
14+
#include <boost/optional.hpp>
1415

1516
//FIXME move this out to a trait
1617
#include <set>

libs/network/example/CMakeLists.txt

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,35 @@
66
include_directories(${CPP-NETLIB_SOURCE_DIR})
77
find_package( Boost 1.41.0 COMPONENTS program_options system regex date_time thread filesystem )
88
find_package( OpenSSL )
9-
include_directories(${OPENSSL_INCLUDE_DIR})
109
find_package( Threads )
11-
set(Boost_USE_STATIC_LIBS ON)
12-
set(Boost_USE_MULTITHREADED ON)
1310

1411
if (Boost_FOUND)
15-
add_executable(http_client http_client.cpp)
16-
add_executable(simple_wget simple_wget.cpp)
17-
add_executable(hello_world_server http/hello_world_server.cpp)
18-
add_executable(fileserver http/fileserver.cpp)
19-
add_executable(uri uri.cpp)
20-
add_executable(uri_builder uri_builder.cpp)
21-
add_dependencies(http_client cppnetlib-uri-parsers cppnetlib-client-connections)
22-
add_dependencies(simple_wget cppnetlib-uri-parsers cppnetlib-client-connections)
23-
add_dependencies(uri cppnetlib-uri-parsers)
24-
target_link_libraries(http_client ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} cppnetlib-uri-parsers cppnetlib-client-connections)
25-
target_link_libraries(simple_wget ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} cppnetlib-uri-parsers cppnetlib-client-connections)
26-
target_link_libraries(hello_world_server ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} )
27-
target_link_libraries(fileserver ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
28-
target_link_libraries(uri cppnetlib-uri-parsers)
29-
target_link_libraries(uri_builder cppnetlib-uri-parsers)
30-
set_target_properties(http_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
31-
set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
32-
set_target_properties(hello_world_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
33-
set_target_properties(fileserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
34-
set_target_properties(uri PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
35-
set_target_properties(uri_builder PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
36-
endif()
12+
set(Boost_USE_STATIC_LIBS ON)
13+
set(Boost_USE_MULTITHREADED ON)
14+
endif (Boost_FOUND)
15+
16+
if (OPENSSL_FOUND)
17+
include_directories(${OPENSSL_INCLUDE_DIR})
18+
endif (OPENSSL_FOUND)
19+
20+
add_executable(http_client http_client.cpp)
21+
add_executable(simple_wget simple_wget.cpp)
22+
add_executable(hello_world_server http/hello_world_server.cpp)
23+
add_executable(fileserver http/fileserver.cpp)
24+
add_executable(uri uri.cpp)
25+
add_executable(uri_builder uri_builder.cpp)
26+
add_dependencies(http_client cppnetlib-uri-parsers)
27+
add_dependencies(simple_wget cppnetlib-uri-parsers)
28+
add_dependencies(uri cppnetlib-uri-parsers)
29+
target_link_libraries(http_client ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri-parsers)
30+
target_link_libraries(simple_wget ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri-parsers)
31+
target_link_libraries(hello_world_server ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
32+
target_link_libraries(fileserver ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
33+
target_link_libraries(uri cppnetlib-uri-parsers)
34+
target_link_libraries(uri_builder cppnetlib-uri-parsers)
35+
set_target_properties(http_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
36+
set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
37+
set_target_properties(hello_world_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
38+
set_target_properties(fileserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
39+
set_target_properties(uri PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
40+
set_target_properties(uri_builder PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)

0 commit comments

Comments
 (0)