From aed3ebb375b458013eda4f9e6dcae784c5776915 Mon Sep 17 00:00:00 2001 From: Sergey Kvachonok Date: Thu, 15 Feb 2024 15:42:30 +0300 Subject: [PATCH] docs: Add C/C++ include paths use examples --- README.md | 17 +++++++++++++++++ src/lib.rs | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/README.md b/README.md index 0210ca5..f892f5f 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,20 @@ fn main() { .emit(); } ``` + +## Getting C/C++ include paths from Conan dependencies + +To use the list of include paths, do the following after +parsing the `conan install` output: + +```rust +use conan2::ConanInstall; + +let metadata = ConanInstall::new().run().parse(); + +for path in metadata.include_paths() { + // Add "-I{path}" to CXXFLAGS or something. +} + +metadata.emit(); +``` diff --git a/src/lib.rs b/src/lib.rs index 31b5f0f..89c633d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -62,6 +62,23 @@ //! .parse() //! .emit(); //! ``` +//! +//! ## Getting C/C++ include paths from Conan dependencies +//! +//! To use the list of include paths, do the following after +//! parsing the `conan install` output: +//! +//! ```no_run +//! use conan2::ConanInstall; +//! +//! let metadata = ConanInstall::new().run().parse(); +//! +//! for path in metadata.include_paths() { +//! // Add "-I{path}" to CXXFLAGS or something. +//! } +//! +//! metadata.emit(); +//! ``` #![deny(missing_docs)]