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

Commit2d39520

Browse files
committed
More CMakeLists fudging around.
1 parent9dacc03 commit2d39520

File tree

4 files changed

+72
-32
lines changed

4 files changed

+72
-32
lines changed

‎CMakeLists.txt‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 2.6)
77
project(CPP-NETLIB)
88
set(Boost_USE_STATIC_LIBSON)
99
set(Boost_USE_MULTI_THREADEDON)
10-
find_package( Boost 1.45.0 REQUIRED unit_test_frameworksystemregex date_time thread filesystem program_options)
10+
find_package( Boost 1.45.0 REQUIRED unit_test_frameworksystemregex date_time thread filesystem program_options)
1111
find_package( OpenSSL )
1212
find_package( Threads )
1313
set(CMAKE_VERBOSE_MAKEFILEtrue)
@@ -16,16 +16,17 @@ if (CMAKE_BUILD_TYPE MATCHES Debug)
1616
add_definitions(-DBOOST_NETWORK_DEBUG)
1717
endif()
1818

19+
if (OpenSSL_FOUND)
20+
add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS)
21+
endif()
22+
1923
if (Boost_FOUND)
2024
include_directories(${Boost_INCLUDE_DIRS})
25+
enable_testing()
26+
add_subdirectory(libs/network/src)
27+
add_subdirectory(libs/network/test)
28+
add_subdirectory(libs/mime/test)
29+
add_subdirectory(libs/network/example)
2130
endif()
2231

23-
if (OpenSSL_FOUND)
24-
add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS)
25-
endif()
2632

27-
enable_testing()
28-
add_subdirectory(libs/network/src)
29-
add_subdirectory(libs/network/test)
30-
add_subdirectory(libs/mime/test)
31-
add_subdirectory(libs/network/example)

‎libs/network/example/CMakeLists.txt‎

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,54 @@
66
include_directories(${CPP-NETLIB_SOURCE_DIR})
77
include_directories(${OPENSSL_INCLUDE_DIR})
88

9-
if (Boost_FOUND)
10-
add_executable(http_client http_client.cpp)
11-
add_executable(simple_wget simple_wget.cpp)
12-
add_executable(hello_world_server http/hello_world_server.cpp)
13-
add_executable(fileserver http/fileserver.cpp)
14-
add_executable(uri uri.cpp)
15-
add_dependencies(http_client cppnetlib-uri-parsers)
16-
add_dependencies(simple_wget cppnetlib-uri-parsers)
17-
add_dependencies(uri cppnetlib-uri-parsers)
18-
target_link_libraries(http_client${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT}${OPENSSL_LIBRARIES} cppnetlib-uri-parsers)
19-
target_link_libraries(simple_wget${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT}${OPENSSL_LIBRARIES} cppnetlib-uri-parsers)
20-
target_link_libraries(hello_world_server${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT}${OPENSSL_LIBRARIES} )
21-
target_link_libraries(fileserver${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
22-
target_link_libraries(uri cppnetlib-uri-parsers)
23-
set_target_properties(http_client PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
24-
set_target_properties(simple_wget PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
25-
set_target_properties(hello_world_server PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
26-
set_target_properties(fileserver PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
27-
set_target_properties(uri PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
9+
if (OPENSSL_FOUND)
10+
add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS)
2811
endif()
12+
13+
add_executable(http_client http_client.cpp)
14+
add_executable(simple_wget simple_wget.cpp)
15+
add_executable(hello_world_server http/hello_world_server.cpp)
16+
add_executable(fileserver http/fileserver.cpp)
17+
add_executable(uri uri.cpp)
18+
add_dependencies(http_client cppnetlib-uri-parsers)
19+
add_dependencies(simple_wget cppnetlib-uri-parsers)
20+
add_dependencies(uri cppnetlib-uri-parsers)
21+
set(BOOST_CLIENT_LIBS
22+
${Boost_PROGRAM_OPTIONS_LIBRARY}
23+
${Boost_THREAD_LIBRARY}
24+
${Boost_SYSTEM_LIBRARY})
25+
26+
set(BOOST_SERVER_LIBS
27+
${Boost_THREAD_LIBRARY}
28+
${Boost_SYSTEM_LIBRARY}
29+
${Boost_PROGRAM_OPTIONS_LIBRARY})
30+
31+
target_link_libraries(http_client
32+
${BOOST_CLIENT_LIBS}
33+
${CMAKE_THREAD_LIBS_INIT}
34+
${OPENSSL_LIBRARIES}
35+
cppnetlib-uri-parsers)
36+
37+
target_link_libraries(simple_wget
38+
${BOOST_CLIENT_LIBS}
39+
${CMAKE_THREAD_LIBS_INIT}
40+
${OPENSSL_LIBRARIES}
41+
cppnetlib-uri-parsers)
42+
43+
target_link_libraries(hello_world_server
44+
${BOOST_SERVER_LIBS}
45+
${CMAKE_THREAD_LIBS_INIT}
46+
${OPENSSL_LIBRARIES})
47+
48+
target_link_libraries(fileserver
49+
${BOOST_SERVER_LIBS}
50+
${Boost_FILESYSTEM_LIBRARY}
51+
${CMAKE_THREAD_LIBS_INIT}
52+
cppnetlib-server-parsers)
53+
54+
target_link_libraries(uri cppnetlib-uri-parsers)
55+
set_target_properties(http_client PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
56+
set_target_properties(simple_wget PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
57+
set_target_properties(hello_world_server PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
58+
set_target_properties(fileserver PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
59+
set_target_properties(uri PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)

‎libs/network/src/CMakeLists.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
# boost_network_uri
88
include_directories(${CPP-NETLIB_SOURCE_DIR})
99

10+
if (OPENSSL_FOUND)
11+
add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS)
12+
endif()
13+
1014
set(CPP-NETLIB_URI_SRCS uri/parse.cpp)
1115
add_library(cppnetlib-uri-parsers ${CPP-NETLIB_URI_SRCS})
1216

‎libs/network/test/http/CMakeLists.txt‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ if (OPENSSL_FOUND)
1212
endif()
1313

1414
if (Boost_FOUND)
15+
set ( BOOST_LIBS
16+
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
17+
${Boost_THREAD_LIBRARY}
18+
${Boost_SYSTEM_LIBRARY})
1519
set ( TESTS
1620
client_constructor_test
1721
client_get_test
@@ -32,7 +36,7 @@ if (Boost_FOUND)
3236
endif()
3337
add_executable(cpp-netlib-http-${test}${test}.cpp)
3438
add_dependencies(cpp-netlib-http-${test} cppnetlib-uri-parsers)
35-
target_link_libraries(cpp-netlib-http-${test}${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri-parsers)
39+
target_link_libraries(cpp-netlib-http-${test}${BOOST_LIBS}${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri-parsers)
3640
if (OPENSSL_FOUND)
3741
target_link_libraries(cpp-netlib-http-${test}${OPENSSL_LIBRARIES})
3842
endif()
@@ -53,7 +57,7 @@ if (Boost_FOUND)
5357
endif()
5458
add_executable(cpp-netlib-http-${test}${test}.cpp)
5559
add_dependencies(cpp-netlib-http-${test} cppnetlib-server-parsers)
56-
target_link_libraries(cpp-netlib-http-${test}${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
60+
target_link_libraries(cpp-netlib-http-${test}${BOOST_LIBS}${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
5761
set_target_properties(cpp-netlib-http-${test}
5862
PROPERTIESRUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests)
5963
add_test(cpp-netlib-http-${test}
@@ -73,7 +77,7 @@ if (Boost_FOUND)
7377
endif()
7478
add_executable(cpp-netlib-http-${test}${test}.cpp)
7579
add_dependencies(cpp-netlib-http-${test} cppnetlib-server-parsers)
76-
target_link_libraries(cpp-netlib-http-${test}${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
80+
target_link_libraries(cpp-netlib-http-${test}${BOOST_LIBS}${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
7781
set_target_properties(cpp-netlib-http-${test}
7882
PROPERTIESRUNTIME_OUTPUT_DIRECTORY
7983
${CPP-NETLIB_BINARY_DIR}/tests)
@@ -96,7 +100,7 @@ if (Boost_FOUND)
96100
PROPERTIESCOMPILE_FLAGS"-Wall")
97101
endif()
98102
add_executable(cpp-netlib-http-inlined-${test}${test}.cpp)
99-
target_link_libraries(cpp-netlib-http-inlined-${test}${Boost_LIBRARIES}${CMAKE_THREAD_LIBS_INIT})
103+
target_link_libraries(cpp-netlib-http-inlined-${test}${BOOST_LIBS}${CMAKE_THREAD_LIBS_INIT})
100104
if (OPENSSL_FOUND)
101105
target_link_libraries(cpp-netlib-http-inlined-${test}${OPENSSL_LIBRARIES})
102106
endif()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp