cmake-rs icon indicating copy to clipboard operation
cmake-rs copied to clipboard

Find CMake bundled with MSVC

Open knopp opened this issue 3 years ago • 1 comments

Hi,

it would be quite useful if the crate could determine location of CMake binary bundled with MSVC. The usual location is

${msvcPath}\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin.

knopp avatar Feb 17 '22 13:02 knopp

It would be nice, but what is your intent? If it's to build with cmake/<ninja/vs>/msvc, it would seem the standard way to bring cmake into PATH is to run vcvars script beforehand. In that case, I think it would be appropriate to add some way for the cmake or cc crate to find and execute the vcvars script as needed, instead. But I haven't seen other people doing that... :/

fwiw i've solved it like this: https://github.com/unicorn-engine/unicorn/blob/3fcfdcedd83284ce71d751fcec8b8d422a00ee87/bindings/rust/build.rs#L9 (but, it should be in a crate, I agree). Maybe some of the underlying msvc/VS-specific stuff (like cc crate's setup_config and/or vswhere wrapper) should be their own crates..

shuffle2 avatar Apr 12 '22 04:04 shuffle2