I want to link something.cc with another C++ library, but still run everything on Rust. I thus want to call C++ code, from Rust, and still have it compiled and linked using Cargo. All the projects I find are the inverse: compiling rust from Cmake and using on C++.
So, how do I compile a cmake project from build.rs and link to something.cc?
Well, as far as I can tell, this should work as-is, in the sense that it should already invoke the compiler and the linker properly, that's the very purpose of cxx_build. This allows you to call the C++ code from your main.rs if you create the appropriate declarations in Rust.
In that case, build the library using CMake, and specify an install directory that is accessible by the Rust build. Then, emit cargo:rustc-link-lib commands from the build script, see here.