Open btzy opened 1 year ago
Looks like this is the same problem I ran into here:
As far as I can tell, this crate is currently only driving the configuration/building process, so it does not have access to any information like that.
I guess in the future, one can imagine parsing the cmake install-config (e.g., https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-to-create-a-ProjectConfig.cmake-file) but that is probably a massive undertaking
I have a CMake library that conditionally adds link time dependencies based on the output of a
check_cxx_source_compiles
command. That's all fine when building a CMake project, but when building a Cargo library I need to add a line like this into build.rs:To mimic the behaviour of the CMake library, I will need to somehow retrieve the value of the variable that is set by the
check_cxx_source_compiles
command. That might not be possible directly, but it should be possible determine the value by reading (in build.rs) the output of the CMake configure command.Is there a way to go about doing that? Or more generally, does cmake-rs have a good way to get information back from CMake after the CMake library is configured?