Writing rust wrapper for C++ library structured for cmake

Hi,
I am new to Rust and I am trying to develop Rust wrapper for an existing C++ library. The source code organization of this library is done in a certain way and it uses CMakeLists.txt. These CMakeLists.txt files make use of macros such as INCLUDE_DIRS, DEPENDS_LIBRARIES etc.
As a very first step, I am trying to generate rust binding for one class which is declared in one header file. This header file include standard library headers and some other header files of this library.
Following an example from Create a build.rs File - The bindgen User Guide, I tried to compile build.rs which compiles wrapper.h. My wrapper.h includes the header file I mentioned above.
cargo build command errors out saying file "map" cannot be found.
"map" is of course included on very first line in my header file.
How should I resolve this issue? I am quite certain rust users who want to interoperate with C++ would have come across this issue.
My second question is about cmake. The directory structure of this library is done well. How can I leverage CMakeLists.txt in Rust environment?
In the final form, there will be wrappers for good number of C++ classes.
Any concrete directions, first hand experience will be greatly appreciated.
Thanks.

Hi,

Might be that bindgen doesn't support C++ STL classes, such as map. See https://rust-lang.github.io/rust-bindgen/cpp.html#generating-bindings-to-c for C++ limitations. Generally speaking, when creating any kind of bindings for C / C++ codebase you probably want to expose a C interface / facade if at all possible.