Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleaned up build scripts.
  • Loading branch information
glynos committed Jan 31, 2016
commit 91b5bd4c88d9c73ec51b04d0c2d44f3a659df6d7
14 changes: 0 additions & 14 deletions boost/network/uri/uri.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,4 @@ inline uri from_parts(const uri::string_type &base_uri,
} // namespace network
} // namespace boost

#include <boost/filesystem/path.hpp>

namespace boost {
namespace network {
namespace uri {
inline uri from_file(const filesystem::path &path_) {
uri uri_;
builder(uri_).scheme("file").path(path_.string());
return uri_;
}
} // namespace uri
} // namespace network
} // namespace boost

#endif // BOOST_NETWORK_URI_INC__
27 changes: 0 additions & 27 deletions libs/network/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,67 +25,42 @@ add_dependencies(simple_wget cppnetlib-uri cppnetlib-client-connections)
add_dependencies(atom_reader cppnetlib-uri cppnetlib-client-connections)
add_dependencies(rss_reader cppnetlib-uri cppnetlib-client-connections)
add_dependencies(trivial_google cppnetlib-uri cppnetlib-client-connections)
set(BOOST_CLIENT_LIBS
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_CHRONO_LIBRARY})

set(BOOST_SERVER_LIBS
${Boost_THREAD_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_CHRONO_LIBRARY})

target_link_libraries(http_client
${BOOST_CLIENT_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-uri
cppnetlib-client-connections)

target_link_libraries(simple_wget
${BOOST_CLIENT_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-uri
cppnetlib-client-connections)

target_link_libraries(atom_reader
${BOOST_CLIENT_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-uri
cppnetlib-client-connections)

target_link_libraries(rss_reader
${BOOST_CLIENT_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-uri
cppnetlib-client-connections)

target_link_libraries(trivial_google
${BOOST_CLIENT_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-uri
cppnetlib-client-connections)

target_link_libraries(hello_world_server
${BOOST_SERVER_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-server-parsers)

target_link_libraries(hello_world_client
${BOOST_CLIENT_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-uri
cppnetlib-client-connections)

target_link_libraries(hello_world_async_server_with_work_queue
${BOOST_CLIENT_LIBS}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-uri
cppnetlib-client-connections
Expand Down Expand Up @@ -126,8 +101,6 @@ endif()

if (UNIX)
target_link_libraries(fileserver
${BOOST_SERVER_LIBS}
${Boost_FILESYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
cppnetlib-server-parsers)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
Expand Down
2 changes: 1 addition & 1 deletion libs/network/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (OPENSSL_FOUND)
target_link_libraries(cppnetlib-client-connections ${OPENSSL_LIBRARIES})
endif ()
if (Boost_FOUND)
target_link_libraries(cppnetlib-client-connections ${Boost_LIBRARIES})
target_link_libraries(cppnetlib-client-connections)
endif ()
install(TARGETS cppnetlib-client-connections
EXPORT cppnetlibTargets
Expand Down
5 changes: 1 addition & 4 deletions libs/network/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ if (Boost_FOUND)
endif()
add_executable(cpp-netlib-${test} ${test}.cpp)
add_dependencies(cpp-netlib-${test} cppnetlib-uri gtest_main)
target_link_libraries(cpp-netlib-${test}
${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri gtest_main)
target_link_libraries(cpp-netlib-${test} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri gtest_main)
if (OPENSSL_FOUND)
target_link_libraries(cpp-netlib-${test} ${OPENSSL_LIBRARIES})
endif()
Expand All @@ -41,4 +39,3 @@ if (Boost_FOUND)
# Also copy the server directory to the root of the build directory.
file(COPY server DESTINATION ${CPP-NETLIB_BINARY_DIR}/libs/network/test/)
endif()

8 changes: 4 additions & 4 deletions libs/network/test/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (Boost_FOUND)
add_dependencies(cpp-netlib-http-${test} gtest_main
cppnetlib-uri)
target_link_libraries(cpp-netlib-http-${test}
${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} gtest_main
${CMAKE_THREAD_LIBS_INIT} gtest_main
cppnetlib-uri)
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries(cpp-netlib-http-${test} ws2_32)
Expand All @@ -42,7 +42,7 @@ if (Boost_FOUND)
add_executable(cpp-netlib-http-${test} ${test}.cpp)
add_dependencies(cpp-netlib-http-${test} cppnetlib-uri
cppnetlib-client-connections gtest_main)
target_link_libraries(cpp-netlib-http-${test} ${Boost_LIBRARIES}
target_link_libraries(cpp-netlib-http-${test}
${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri gtest_main cppnetlib-client-connections)
if (OPENSSL_FOUND)
target_link_libraries(cpp-netlib-http-${test} ${OPENSSL_LIBRARIES})
Expand All @@ -64,7 +64,7 @@ if (Boost_FOUND)
foreach (test ${SERVER_API_TESTS})
add_executable(cpp-netlib-http-${test} ${test}.cpp)
add_dependencies(cpp-netlib-http-${test} cppnetlib-server-parsers)
target_link_libraries(cpp-netlib-http-${test} ${Boost_LIBRARIES}
target_link_libraries(cpp-netlib-http-${test}
${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers gtest_main)
if (OPENSSL_FOUND)
target_link_libraries(cpp-netlib-http-${test} ${OPENSSL_LIBRARIES})
Expand All @@ -87,7 +87,7 @@ if (Boost_FOUND)
add_dependencies(cpp-netlib-http-server_async_run_stop_concurrency
cppnetlib-server-parsers)
target_link_libraries(cpp-netlib-http-server_async_run_stop_concurrency
${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
if (OPENSSL_FOUND)
target_link_libraries(cpp-netlib-http-server_async_run_stop_concurrency
${OPENSSL_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion libs/network/test/uri/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (Boost_FOUND)
add_executable(cpp-netlib-${test} ${test}.cpp)
add_dependencies(cpp-netlib-${test} cppnetlib-uri gtest_main)
target_link_libraries(cpp-netlib-${test}
${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri
${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri
gtest_main)
if (OPENSSL_FOUND)
target_link_libraries(cpp-netlib-${test} ${OPENSSL_LIBRARIES})
Expand Down
6 changes: 0 additions & 6 deletions libs/network/test/uri/uri_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,6 @@ TEST(URITest, from_parts_4) {
uri::from_parts("http://www.example.com", "/path"));
}

TEST(URITest, from_file) {
boost::filesystem::path path("/a/path/to/a/file.txt");
EXPECT_EQ(uri::uri("file:///a/path/to/a/file.txt"),
uri::from_file(path));
}

TEST(URITest, issue_104_test) {
// https://github.com/cpp-netlib/cpp-netlib/issues/104
std::unique_ptr<uri::uri> instance(new uri::uri("http://www.example.com/"));
Expand Down