Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable build of cpp-netlib as shared libraries#165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deanberris merged 5 commits intocpp-netlib:masterfromtorbjoernk:cmake-shared-libs
Nov 4, 2012
Merged
Show file tree
Hide file tree
Changes fromall commits
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
45 changes: 36 additions & 9 deletionsCMakeLists.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,12 +7,25 @@
cmake_minimum_required(VERSION 2.8)
project(CPP-NETLIB)

option(BUILD_SHARED_LIBS "Build cpp-netlib as shared libraries." OFF)
option(BUILD_TESTS "Build the unit tests." ON)
option(BUILD_EXAMPLES "Build the examples using cpp-netlib." ON)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package( ICU )

set(Boost_USE_STATIC_LIBS ON)
if(BUILD_SHARED_LIBS)
set(Boost_USE_STATIC_LIBS OFF)
else()
set(Boost_USE_STATIC_LIBS ON)
endif()
set(Boost_USE_MULTITHREADED ON)
find_package( Boost 1.45.0 REQUIRED unit_test_framework system regex date_time thread chrono filesystem program_options )
if(BUILD_TESTS)
set(Boost_COMPONENTS unit_test_framework system regex date_time thread chrono filesystem program_options )
else()
set(Boost_COMPONENTS system regex date_time thread chrono filesystem program_options )
endif()
find_package( Boost 1.51 REQUIRED ${Boost_COMPONENTS} )
find_package( OpenSSL )
find_package( Threads )
set(CMAKE_VERBOSE_MAKEFILE true)
Expand DownExpand Up@@ -51,13 +64,27 @@ if (Boost_FOUND)
add_definitions(-D_WIN32_WINNT=0x0501)
endif(WIN32)
include_directories(${Boost_INCLUDE_DIRS})
enable_testing()
if(BUILD_TESTS)
enable_testing()
endif()
add_subdirectory(libs/network/src)
add_subdirectory(libs/network/test)
if (NOT MSVC)
add_subdirectory(libs/mime/test)
endif(NOT MSVC)
add_subdirectory(libs/network/example)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(libs/network/test)
if (NOT MSVC)
add_subdirectory(libs/mime/test)
endif(NOT MSVC)
endif()
if(BUILD_EXAMPLES)
add_subdirectory(libs/network/example)
endif()
endif(Boost_FOUND)

enable_testing()
if(BUILD_TESTS)
enable_testing()
endif()

message(STATUS "Options selected:")
message(STATUS " BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}\t(Build cpp-netlib as shared libraries: OFF, ON)")
message(STATUS " BUILD_TESTS: ${BUILD_TESTS}\t(Build the unit tests: ON, OFF)")
message(STATUS " BUILD_EXAMPLES: ${BUILD_EXAMPLES}\t(Build the examples using cpp-netlib: ON, OFF)")
3 changes: 0 additions & 3 deletionslibs/mime/test/CMakeLists.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
include_directories(${CPP-NETLIB_SOURCE_DIR})
find_package ( Boost 1.41.0 COMPONENTS unit_test_framework )
set ( Boost_USE_STATIC_LIBS ON )
set ( Boost_USE_MULTITHREADED ON )

if ( Boost_FOUND )
add_executable ( mime-roundtrip mime-roundtrip.cpp )
Expand Down
6 changes: 3 additions & 3 deletionslibs/network/src/CMakeLists.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,7 @@ endforeach(src_file)
set(CPP-NETLIB_HTTP_MESSAGE_SRCS http/request.cpp http/response.cpp)
add_library(cppnetlib-http-message ${CPP-NETLIB_HTTP_MESSAGE_SRCS})
add_dependencies(cppnetlib-http-message
${Boost_LIBRARIES}
# ${Boost_LIBRARIES}
cppnetlib-message)
target_link_libraries(cppnetlib-http-message
${Boost_LIBRARIES}
Expand DownExpand Up@@ -99,7 +99,6 @@ set(CPP-NETLIB_HTTP_SERVER_SRCS
)
add_library(cppnetlib-http-server ${CPP-NETLIB_HTTP_SERVER_SRCS})
add_dependencies(cppnetlib-http-server
${Boost_LIBRARIES}
cppnetlib-constants
cppnetlib-uri
cppnetlib-message
Expand All@@ -108,6 +107,7 @@ add_dependencies(cppnetlib-http-server
cppnetlib-http-message
cppnetlib-http-message-wrappers
cppnetlib-http-server-parsers
cppnetlib-utils-thread_pool
)
target_link_libraries(cppnetlib-http-server
${Boost_LIBRARIES}
Expand All@@ -119,6 +119,7 @@ target_link_libraries(cppnetlib-http-server
cppnetlib-http-message
cppnetlib-http-message-wrappers
cppnetlib-http-server-parsers
cppnetlib-utils-thread_pool
)
foreach (src_file ${CPP-NETLIB_HTTP_SERVER_SRCS})
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
Expand DownExpand Up@@ -150,7 +151,6 @@ set(CPP-NETLIB_HTTP_CLIENT_SRCS
http/client.cpp)
add_library(cppnetlib-http-client ${CPP-NETLIB_HTTP_CLIENT_SRCS})
add_dependencies(cppnetlib-http-client
${Boost_LIBRARIES}
cppnetlib-constants
cppnetlib-uri
cppnetlib-message
Expand Down
4 changes: 4 additions & 0 deletionslibs/network/test/CMakeLists.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,10 @@

include_directories(${CPP-NETLIB_SOURCE_DIR}/include)

if(BUILD_SHARED_LIBS)
add_definitions(-DBUILD_SHARED_LIBS)
endif()

add_subdirectory(uri)
add_subdirectory(http)

Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/client_constructor_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP 1.0 Client Constructor Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/client_get_different_port_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Client Get Different Port Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/client_get_streaming_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP 1.1 Get Streaming Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/client_get_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP 1.0 Get Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/client_get_timeout_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Client Get Timeout Test
#include <network/include/http/client.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/request_base_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Request Storage Base Test
#include <network/protocol/http/request/request_base.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/request_linearize_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Request Linearize Test
#include <network/protocol/http/request.hpp>
#include <network/protocol/http/algorithms/linearize.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/request_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Request Test
#include <network/protocol/http/request.hpp>
#include <network/protocol/http/message/wrappers.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/response_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Client Response Test
#include <network/protocol/http/response.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
# define BOOST_TEST_NO_MAIN
#endif
#define BOOST_TEST_MODULE HTTP Asynchronous Server Tests

#include <network/include/http/server.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/http/server_constructor_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE HTTP Server Construtor Tests

#include <network/include/http/server.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/message_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE message test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/message_transform_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE message test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/uri/relative_uri_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE Relative URL Test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/uri/scheme_tests.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI Scheme Test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/uri/uri_builder_stream_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI builder stream test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/uri/uri_builder_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI builder test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/uri/uri_encoding_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI encoding test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/uri/uri_test.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,9 @@
// (See accompanying file LICENSE_1_0.txt of copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE URI Test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down
3 changes: 3 additions & 0 deletionslibs/network/test/utils_thread_pool.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,9 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifdef BUILD_SHARED_LIBS
# define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE utils thread pool test
#include <boost/config/warning_disable.hpp>
#include <boost/test/unit_test.hpp>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp