Skip to content

Commit 5805b15

Browse files
author
Dean Michael Berris
committed
Adding the simple_wget and uri examples in the CMake build.
1 parent e6a751f commit 5805b15

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

libs/network/example/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# http://www.boost.org/LICENSE_1_0.txt)
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR})
7-
find_package( Boost 1.41.0 COMPONENTS unit_test_framework system regex date_time thread filesystem )
7+
find_package( Boost 1.41.0 COMPONENTS program_options system regex date_time thread filesystem )
88
find_package( OpenSSL )
99
include_directories(${OPENSSL_INCLUDE_DIR})
1010
find_package( Threads )
@@ -13,6 +13,11 @@ set(Boost_USE_MULTITHREADED ON)
1313

1414
if (Boost_FOUND)
1515
add_executable(http_client http_client.cpp)
16-
target_link_libraries(http_client ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_THREAD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} )
16+
add_executable(simple_wget simple_wget.cpp)
17+
add_executable(uri uri.cpp)
18+
target_link_libraries(http_client ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} )
19+
target_link_libraries(simple_wget ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} )
1720
set_target_properties(http_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../../../build/example)
21+
set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../../../build/example)
22+
set_target_properties(uri PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../../../build/example)
1823
endif()

libs/network/example/simple_wget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ main(int argc, char *argv[]) {
5353
std::string filename = get_filename(uri);
5454
std::cout << "Saving to: " << filename << std::endl;
5555
std::ofstream ofs(filename.c_str());
56-
ofs << boost::network::body(response) << std::endl;
56+
ofs << static_cast<std::string>(boost::network::body(response)) << std::endl;
5757
}
5858
catch (std::exception &e) {
5959
std::cerr << e.what() << std::endl;

0 commit comments

Comments
 (0)