Skip to content

Commit c118020

Browse files
committed
Adding the http_client example into the CMake build.
1 parent 6565e06 commit c118020

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ endif()
1414
enable_testing()
1515
add_subdirectory(libs/network/test)
1616
add_subdirectory(libs/mime/test)
17-
17+
add_subdirectory(libs/network/example)

libs/network/example/CMakeLists.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (c) Dean Michael Berris 2010.
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
include_directories(${CPP-NETLIB_SOURCE_DIR})
7+
find_package( Boost 1.41.0 COMPONENTS unit_test_framework system regex date_time thread filesystem )
8+
find_package( OpenSSL )
9+
include_directories(${OPENSSL_INCLUDE_DIR})
10+
find_package( Threads )
11+
set(Boost_USE_STATIC_LIBS ON)
12+
set(Boost_USE_MULTITHREADED ON)
13+
14+
if (Boost_FOUND)
15+
add_executable(http_client http_client.cpp)
16+
target_link_libraries(http_client ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_THREAD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES} )
17+
set_target_properties(http_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ../../../build/example)
18+
endif()

0 commit comments

Comments
 (0)