Skip to content

Commit 8d459d4

Browse files
committed
Update readme to include basic CMake usage
1 parent f15e613 commit 8d459d4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,31 @@ For other platforms, install options, how to build from source, and more, take a
2424

2525
Once you have the library, look at our [tutorial](https://github.com/Microsoft/cpprestsdk/wiki/Getting-Started-Tutorial) to use the http_client. It walks through how to setup a project to use the C++ Rest SDK and make a basic Http request.
2626

27+
To use from CMake:
28+
```cmake
29+
cmake_minimum_required(VERSION 3.7)
30+
project(main)
31+
32+
find_library(CPPREST_LIB cpprest)
33+
find_package(Boost REQUIRED COMPONENTS random system thread filesystem chrono atomic date_time regex)
34+
find_package(OpenSSL 1.0.0 REQUIRED)
35+
36+
add_executable(main main.cpp)
37+
target_link_libraries(main
38+
${CPPREST_LIB}
39+
Boost::boost
40+
Boost::random
41+
Boost::system
42+
Boost::thread
43+
Boost::filesystem
44+
Boost::chrono
45+
Boost::atomic
46+
Boost::date_time
47+
Boost::regex
48+
OpenSSL::SSL
49+
)
50+
```
51+
2752
## What's in the SDK:
2853

2954
* Features - HTTP client/server, JSON, URI, asynchronous streams, WebSockets client, oAuth

0 commit comments

Comments
 (0)