|
6 | 6 | include_directories(${CPP-NETLIB_SOURCE_DIR})
|
7 | 7 | include_directories(${OPENSSL_INCLUDE_DIR})
|
8 | 8 |
|
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 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
24 |
| - set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
25 |
| - set_target_properties(hello_world_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
26 |
| - set_target_properties(fileserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
27 |
| - set_target_properties(uri PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
| 9 | +if (OPENSSL_FOUND) |
| 10 | + add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS) |
28 | 11 | 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 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
| 56 | +set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
| 57 | +set_target_properties(hello_world_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
| 58 | +set_target_properties(fileserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
| 59 | +set_target_properties(uri PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example) |
0 commit comments