File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -512,6 +512,44 @@ cli.set_compress(true);
512
512
res = cli.Post("/resource/foo", "...", "text/plain");
513
513
```
514
514
515
+ Building & Installation (Cmake)
516
+ -------------------------------
517
+
518
+ After installation with Cmake, a ` find_package(httplib) ` is available.
519
+ This creates a ` httplib::httplib ` target (if found).
520
+ It can be linked like so:
521
+ ``` cmake
522
+ target_link_libraries(your_exe httplib::httplib)
523
+ ```
524
+
525
+ The following will build & install for later use.
526
+
527
+ Linux/macOS
528
+ ``` shell
529
+ mkdir -p build
530
+ cd build
531
+ cmake -DCMAKE_BUILD_TYPE=Release ..
532
+ sudo cmake --build . --target install
533
+ ```
534
+ Windows
535
+ ``` cmd
536
+ mkdir build
537
+ cd build
538
+ cmake ..
539
+ runas /user:Administrator "cmake --build . --config Release --target install"
540
+ ```
541
+
542
+ These three variables are available after you run ` find_package(httplib) `
543
+ * ` HTTPLIB_HEADER_PATH ` - this is the full path to the installed header.
544
+ * ` HTTPLIB_IS_USING_OPENSSL ` - a bool for if OpenSSL support is enabled.
545
+ * ` HTTPLIB_IS_USING_ZLIB ` - a bool for if ZLIB support is enabled.
546
+
547
+ Want to use precompiled headers (Cmake feature since v3.16)?
548
+ It's as simple as doing the following (before linking):
549
+ ``` cmake
550
+ target_precompile_headers(httplib::httplib INTERFACE "${HTTPLIB_HEADER_PATH}")
551
+ ```
552
+
515
553
Split httplib.h into .h and .cc
516
554
-------------------------------
517
555
You can’t perform that action at this time.
0 commit comments