File tree 12 files changed +22
-5
lines changed
12 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ install:
23
23
- sudo apt-get install libboost-system1.53-dev
24
24
- sudo apt-get install libboost-regex1.53-dev
25
25
- sudo apt-get install libboost-filesystem1.53-dev
26
+ - wget -qO- http://www.cmake.org/files/v3.3/cmake-3.3.2-Linux-x86_64.tar.gz | tar xvz && sudo cp -fR cmake-3.3.2-Linux-x86_64/* /usr
26
27
27
28
before_script :
28
29
# update compilers
Original file line number Diff line number Diff line change 5
5
# (See accompanying file LICENSE_1_0.txt or copy at
6
6
# http://www.boost.org/LICENSE_1_0.txt)
7
7
8
- cmake_minimum_required (VERSION 2.8 )
8
+ cmake_minimum_required (VERSION 3.0 )
9
9
project (CPP-NETLIB)
10
10
11
11
option ( CPP-NETLIB_BUILD_SHARED_LIBS "Build cpp-netlib as shared libraries." OFF )
@@ -84,7 +84,6 @@ endif(MSVC)
84
84
if (WIN32 )
85
85
add_definitions (-D_WIN32_WINNT=0x0501)
86
86
endif (WIN32 )
87
- include_directories (${Boost_INCLUDE_DIRS} )
88
87
89
88
message (STATUS "CPP-NETLIB options selected:" )
90
89
message (STATUS " CPP-NETLIB_BUILD_SHARED_LIBS: ${CPP-NETLIB_BUILD_SHARED_LIBS}\t (Build cpp-netlib as shared libraries: OFF, ON)" )
@@ -157,7 +156,7 @@ if (DOXYGEN_FOUND)
157
156
endif (DOXYGEN_FOUND)
158
157
159
158
if (CPP-NETLIB_BUILD_SINGLE_LIB)
160
- include_directories (
159
+ set ( all_include_dirs
161
160
${CMAKE_CURRENT_SOURCE_DIR} /config/src
162
161
${CMAKE_CURRENT_SOURCE_DIR} /concurrency/src
163
162
${CMAKE_CURRENT_SOURCE_DIR} /http/src
@@ -194,4 +193,5 @@ if(CPP-NETLIB_BUILD_SINGLE_LIB)
194
193
${CPP-NETLIB_CONCURRENCY_SRCS}
195
194
)
196
195
target_link_libraries (cppnetlib ${Boost_LIBRARIES} )
196
+ target_include_directories (cppnetlib PUBLIC ${all_include_dirs} ${Boost_INCLUDE_DIRS} )
197
197
endif ()
Original file line number Diff line number Diff line change @@ -53,13 +53,13 @@ Building with CMake
53
53
~~~~~~~~~~~~~~~~~~~
54
54
55
55
To build the libraries and run the tests with CMake, you will need to
56
- have CMake version 2.8.10 or higher installed appropriately in your
56
+ have CMake version 3.0 or higher installed appropriately in your
57
57
system.
58
58
59
59
::
60
60
61
61
$ cmake --version
62
- cmake version 2.8.10
62
+ cmake version 3.2.2
63
63
64
64
Inside the cpp-netlib directory, you can issue the following statements to
65
65
configure and generate the Makefiles, and build the tests::
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ set(CPP-NETLIB_CONCURRENCY_SRCS
10
10
11
11
if (NOT CPP-NETLIB_BUILD_SINGLE_LIB)
12
12
add_library (network-concurrency ${CPP-NETLIB_CONCURRENCY_SRCS})
13
+ target_include_directories (network-concurrency PUBLIC ${Boost_INCLUDE_DIRS} )
13
14
endif ()
14
15
15
16
# prepend current directory to make paths absolute
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ if (CPP-NETLIB_BUILD_TESTS)
14
14
${Boost_LIBRARIES}
15
15
${GTEST_BOTH_LIBRARIES}
16
16
${CMAKE_THREAD_LIBS_INIT} )
17
+ target_include_directories (cpp-netlib-thread_pool_test PUBLIC ${Boost_INCLUDE_DIRS} )
17
18
set_target_properties (cpp-netlib-thread_pool_test PROPERTIES
18
19
RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
19
20
add_test (cpp-netlib-thread_pool_test
Original file line number Diff line number Diff line change @@ -33,5 +33,6 @@ foreach(example ${EXAMPLES})
33
33
${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES}
34
34
${CMAKE_THREAD_LIBS_INIT}
35
35
)
36
+ target_include_directories (${example} PUBLIC ${Boost_INCLUDE_DIRS} )
36
37
set_target_properties (${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/example)
37
38
endforeach (example)
Original file line number Diff line number Diff line change @@ -28,20 +28,23 @@ if(NOT CPP-NETLIB_BUILD_SINGLE_LIB)
28
28
target_link_libraries (network-http-message
29
29
${Boost_LIBRARIES}
30
30
network-message)
31
+ target_include_directories (network-http-message PUBLIC ${Boost_INCLUDE_DIRS} )
31
32
endif ()
32
33
33
34
set (CPP-NETLIB_HTTP_MESSAGE_WRAPPERS_SRCS
34
35
http/message/wrappers.cpp)
35
36
36
37
if (NOT CPP-NETLIB_BUILD_SINGLE_LIB)
37
38
add_library (network-http-message-wrappers ${CPP-NETLIB_HTTP_MESSAGE_WRAPPERS_SRCS})
39
+ target_include_directories (network-http-message-wrappers PUBLIC ${Boost_INCLUDE_DIRS} )
38
40
endif ()
39
41
40
42
set (CPP-NETLIB_CONSTANTS_SRCS
41
43
constants.cpp)
42
44
43
45
if (NOT CPP-NETLIB_BUILD_SINGLE_LIB)
44
46
add_library (network-constants ${CPP-NETLIB_CONSTANTS_SRCS})
47
+ target_include_directories (network-constants PUBLIC ${Boost_INCLUDE_DIRS} )
45
48
endif ()
46
49
47
50
# Server implementation files.
@@ -52,6 +55,7 @@ set(CPP-NETLIB_HTTP_SERVER_SRCS
52
55
53
56
if (NOT CPP-NETLIB_BUILD_SINGLE_LIB)
54
57
add_library (network-http-server ${CPP-NETLIB_HTTP_SERVER_SRCS})
58
+ target_include_directories (network-http-server PUBLIC ${Boost_INCLUDE_DIRS} )
55
59
endif ()
56
60
57
61
# HTTP client
@@ -64,6 +68,7 @@ target_link_libraries(network-http-v2-client
64
68
${Boost_LIBRARIES}
65
69
network-uri
66
70
)
71
+ target_include_directories (network-http-v2-client PUBLIC ${Boost_INCLUDE_DIRS} )
67
72
if (OPENSSL_FOUND)
68
73
target_link_libraries (network-http-v2-client ${OPENSSL_LIBRARIES} )
69
74
endif ()
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ if (CPP-NETLIB_BUILD_TESTS)
58
58
${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES}
59
59
${CMAKE_THREAD_LIBS_INIT}
60
60
${CPPNETLIB_LIBRARIES} )
61
+ target_include_directories (cpp-netlib-http-${test} PUBLIC ${Boost_INCLUDE_DIRS} )
61
62
set_target_properties (cpp-netlib-http-${test}
62
63
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
63
64
add_test (cpp-netlib-http-${test}
@@ -91,6 +92,7 @@ if (CPP-NETLIB_BUILD_TESTS)
91
92
${GTEST_BOTH_LIBRARIES}
92
93
${CMAKE_THREAD_LIBS_INIT}
93
94
${CPPNETLIB_SERVER_LIBRARIES} )
95
+ target_include_directories (cpp-netlib-http-${test} PUBLIC ${Boost_INCLUDE_DIRS} )
94
96
set_target_properties (cpp-netlib-http-${test} PROPERTIES
95
97
RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
96
98
add_test (cpp-netlib-http-${test}
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ foreach(test ${CPP-NETLIB_CLIENT_TESTS})
27
27
${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES}
28
28
${CMAKE_THREAD_LIBS_INIT}
29
29
)
30
+ target_include_directories (cpp-netlib-http-v2-${test} PUBLIC ${Boost_INCLUDE_DIRS} )
30
31
set_target_properties (cpp-netlib-http-v2-${test}
31
32
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
32
33
add_test (cpp-netlib-http-v2-${test}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ foreach(test ${CPP-NETLIB_CLIENT_TESTS})
29
29
${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES}
30
30
${CMAKE_THREAD_LIBS_INIT}
31
31
)
32
+ target_include_directories (cpp-netlib-http-v2-${test} PUBLIC ${Boost_INCLUDE_DIRS} )
32
33
set_target_properties (cpp-netlib-http-v2-${test}
33
34
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
34
35
add_test (cpp-netlib-http-v2-${test}
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ if (CPP-NETLIB_BUILD_TESTS)
28
28
add_executable (cpp-netlib-${test} ${test} .cpp)
29
29
target_link_libraries (cpp-netlib-${test}
30
30
${Boost_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${link_cppnetlib_lib} )
31
+ target_include_directories (cpp-netlib-${test} PUBLIC ${Boost_INCLUDE_DIRS} )
31
32
set_target_properties (cpp-netlib-${test}
32
33
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
33
34
add_test (cpp-netlib-${test}
Original file line number Diff line number Diff line change @@ -11,17 +11,20 @@ set(CPP-NETLIB_MESSAGE_SRCS
11
11
message .cpp)
12
12
13
13
add_library (network-message ${CPP-NETLIB_MESSAGE_SRCS})
14
+ target_include_directories (network-message PUBLIC ${Boost_INCLUDE_DIRS} )
14
15
target_link_libraries (network-message network-uri)
15
16
16
17
set (CPP-NETLIB_MESSAGE_DIRECTIVES_SRCS
17
18
directives.cpp)
18
19
19
20
add_library (network-message-directives ${CPP-NETLIB_MESSAGE_DIRECTIVES_SRCS})
21
+ target_include_directories (network-message-directives PUBLIC ${Boost_INCLUDE_DIRS} )
20
22
21
23
set (CPP-NETLIB_MESSAGE_WRAPPERS_SRCS
22
24
wrappers.cpp)
23
25
24
26
add_library (network-message-wrappers ${CPP-NETLIB_MESSAGE_WRAPPERS_SRCS})
27
+ target_include_directories (network-message-wrappers PUBLIC ${Boost_INCLUDE_DIRS} )
25
28
26
29
# prepend current directory to make paths absolute
27
30
prependToElements( "${CMAKE_CURRENT_SOURCE_DIR} /"
You can’t perform that action at this time.
0 commit comments