Skip to content

Commit 8f5ea83

Browse files
committed
Re-added and updated HTTP examples.
1 parent b6c2bee commit 8f5ea83

36 files changed

+76
-7615
lines changed

CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ add_subdirectory(uri)
171171
#add_subdirectory(message)
172172
add_subdirectory(logging)
173173
add_subdirectory(error)
174-
#add_subdirectory(concurrency)
175174
add_subdirectory(http)
175+
add_subdirectory(concurrency)
176176
#add_subdirectory(mime)
177-
#if(CPP-NETLIB_BUILD_EXAMPLES)
178-
# add_subdirectory(contrib/http_examples)
179-
#endif()
177+
if(CPP-NETLIB_BUILD_EXAMPLES)
178+
add_subdirectory(contrib/http_examples)
179+
endif()
180180

181181
if(CPP-NETLIB_BUILD_SINGLE_LIB)
182182
add_library(cppnetlib

Jamroot

-19
This file was deleted.

contrib/http_examples/CMakeLists.txt

+18-150
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# Copyright (c) Dean Michael Berris 2010.
1+
# Copyright (c) Dean Michael Berris 2010.
2+
# Copyright (c) Glyn Matthews 2013.
23
# Distributed under the Boost Software License, Version 1.0.
3-
# (See accompanying file LICENSE_1_0.txt or copy at
4-
# http://www.boost.org/LICENSE_1_0.txt)
4+
# (See accompanying file LICENSE_1_0.txt or copy at
5+
# http://www.boost.org/LICENSE_1_0.txt)
56

67
include_directories(
8+
${CPP-NETLIB_SOURCE_DIR}/config/src
79
${CPP-NETLIB_SOURCE_DIR}/uri/src
8-
${CPP-NETLIB_SOURCE_DIR}/message/src
910
${CPP-NETLIB_SOURCE_DIR}/logging/src
1011
${CPP-NETLIB_SOURCE_DIR}/http/src
1112
${CPP-NETLIB_SOURCE_DIR})
@@ -18,152 +19,19 @@ if( NOT CPP-NETLIB_DISABLE_LOGGING AND NOT CPP-NETLIB_BUILD_SINGLE_LIB)
1819
set( CPP-NETLIB_LOGGING_LIB cppnetlib-logging )
1920
endif()
2021

21-
add_executable(simple_wget simple_wget.cpp)
22-
add_executable(atom_reader atom/atom.cpp atom/main.cpp)
23-
add_executable(rss_reader rss/rss.cpp rss/main.cpp)
24-
#add_executable(twitter_search twitter/search.cpp)
25-
#add_executable(hello_world_server http/hello_world_server.cpp)
26-
add_executable(hello_world_client http/hello_world_client.cpp)
27-
#if (UNIX)
28-
# add_executable(fileserver http/fileserver.cpp)
29-
#endif (UNIX)
30-
set(BOOST_CLIENT_LIBS
31-
${Boost_DATE_TIME_LIBRARY}
32-
${Boost_SYSTEM_LIBRARY}
33-
${Boost_FILESYSTEM_LIBRARY}
34-
${Boost_PROGRAM_OPTIONS_LIBRARY}
35-
${Boost_REGEX_LIBRARY}
22+
set(EXAMPLES
23+
simple_wget
24+
read_headers
3625
)
37-
set(BOOST_SERVER_LIBS
38-
${Boost_DATE_TIME_LIBRARY}
39-
${Boost_SYSTEM_LIBRARY}
40-
${Boost_FILESYSTEM_LIBRARY}
41-
${Boost_PROGRAM_OPTIONS_LIBRARY}
42-
)
43-
44-
if(CPP-NETLIB_BUILD_SINGLE_LIB)
45-
set(simple_wget_linklibs cppnetlib)
46-
else()
47-
set(simple_wget_linklibs
48-
cppnetlib-uri
49-
cppnetlib-message
50-
cppnetlib-message-directives
51-
cppnetlib-message-wrappers
52-
cppnetlib-http-message-wrappers
53-
cppnetlib-http-message
54-
cppnetlib-constants
55-
cppnetlib-http-client
56-
cppnetlib-http-client-connections
57-
${CPP-NETLIB_LOGGING_LIB})
58-
endif()
59-
target_link_libraries(simple_wget
60-
${BOOST_CLIENT_LIBS}
61-
${simple_wget_linklibs}
62-
${CMAKE_THREAD_LIBS_INIT})
63-
64-
if(CPP-NETLIB_BUILD_SINGLE_LIB)
65-
set(atom_reader_linklibs cppnetlib)
66-
else()
67-
set(atom_reader_linklibs
68-
cppnetlib-uri
69-
cppnetlib-message
70-
cppnetlib-message-directives
71-
cppnetlib-message-wrappers
72-
cppnetlib-http-message
73-
cppnetlib-http-message-wrappers
74-
cppnetlib-constants
75-
cppnetlib-http-client
76-
cppnetlib-http-client-connections
77-
${CPP-NETLIB_LOGGING_LIB})
78-
endif()
79-
target_link_libraries(atom_reader
80-
${BOOST_CLIENT_LIBS}
81-
${atom_reader_linklibs}
82-
${CMAKE_THREAD_LIBS_INIT})
83-
84-
if(CPP-NETLIB_BUILD_SINGLE_LIB)
85-
set(rss_reader_linklibs cppnetlib)
86-
else()
87-
set(rss_reader_linklibs
88-
cppnetlib-uri
89-
cppnetlib-message
90-
cppnetlib-message-directives
91-
cppnetlib-message-wrappers
92-
cppnetlib-http-message
93-
cppnetlib-constants
94-
cppnetlib-http-client
95-
cppnetlib-http-client-connections
96-
${CPP-NETLIB_LOGGING_LIB})
97-
endif()
98-
target_link_libraries(rss_reader
99-
${BOOST_CLIENT_LIBS}
100-
${rss_reader_linklibs}
101-
${CMAKE_THREAD_LIBS_INIT})
102-
103-
#target_link_libraries(twitter_search
104-
# ${BOOST_CLIENT_LIBS}
105-
# ${CMAKE_THREAD_LIBS_INIT}
106-
# cppnetlib-uri
107-
# cppnetlib-message
108-
# cppnetlib-message-directives
109-
# cppnetlib-message-wrappers
110-
# cppnetlib-http-message-wrappers
111-
# cppnetlib-http-message
112-
# cppnetlib-constants
113-
# cppnetlib-http-client
114-
# cppnetlib-http-client-connections
115-
# ${CPP-NETLIB_LOGGING_LIB})
116-
117-
#target_link_libraries(hello_world_server
118-
# ${BOOST_SERVER_LIBS}
119-
# ${CMAKE_THREAD_LIBS_INIT}
120-
# cppnetlib-http-server-parsers
121-
# cppnetlib-http-server
122-
# ${CPP-NETLIB_LOGGING_LIB})
12326

124-
if(CPP-NETLIB_BUILD_SINGLE_LIB)
125-
set(hello_world_client_linklibs cppnetlib)
126-
else()
127-
set(hello_world_client_linklibs
27+
foreach(example ${EXAMPLES})
28+
add_executable(${example} ${example}.cpp)
29+
target_link_libraries(${example}
12830
cppnetlib-uri
129-
cppnetlib-message
130-
cppnetlib-message-directives
131-
cppnetlib-message-wrappers
132-
cppnetlib-http-message-wrappers
133-
cppnetlib-http-message
134-
cppnetlib-constants
135-
cppnetlib-http-client
136-
cppnetlib-http-client-connections
137-
${CPP-NETLIB_LOGGING_LIB})
138-
endif()
139-
target_link_libraries(hello_world_client
140-
${BOOST_CLIENT_LIBS}
141-
${hello_world_client_linklibs}
142-
${CMAKE_THREAD_LIBS_INIT})
143-
144-
if (OPENSSL_FOUND)
145-
target_link_libraries(simple_wget ${OPENSSL_LIBRARIES})
146-
target_link_libraries(atom_reader ${OPENSSL_LIBRARIES})
147-
target_link_libraries(rss_reader ${OPENSSL_LIBRARIES})
148-
#target_link_libraries(twitter_search ${OPENSSL_LIBRARIES})
149-
#target_link_libraries(hello_world_server ${OPENSSL_LIBRARIES})
150-
target_link_libraries(hello_world_client ${OPENSSL_LIBRARIES})
151-
endif (OPENSSL_FOUND)
152-
153-
#if (UNIX)
154-
# target_link_libraries(fileserver
155-
# ${BOOST_SERVER_LIBS}
156-
# ${Boost_FILESYSTEM_LIBRARY}
157-
# ${CMAKE_THREAD_LIBS_INIT}
158-
# cppnetlib-server-parsers)
159-
#endif (UNIX)
160-
161-
set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
162-
set_target_properties(atom_reader PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
163-
set_target_properties(rss_reader PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
164-
#set_target_properties(twitter_search PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
165-
#set_target_properties(hello_world_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
166-
set_target_properties(hello_world_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
167-
#if (UNIX)
168-
# set_target_properties(fileserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
169-
#endif (UNIX)
31+
network-http-v2-client
32+
${Boost_LIBRARIES}
33+
${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES}
34+
${CMAKE_THREAD_LIBS_INIT}
35+
)
36+
set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
37+
endforeach(example)

contrib/http_examples/Jamfile.v2

-41
This file was deleted.

contrib/http_examples/atom/atom.cpp

-94
This file was deleted.

0 commit comments

Comments
 (0)