Closed zjturner closed 6 years ago
@zjturner, sorry for the long turnaround here. The beta5 should have this implemented. Would you mind giving it a test drive and reporting back?
I'll close this issue for now, but you can re-open if you don't find it working to your satisfaction.
CMake relies on various environment variables to find certain things, like a host compiler, or visual studio detection. Right now there is some logic to use
vswhere
, but as you are aware this is only available on recent versions of Visual Studio, and it doesn't even apply to non-Windows environments, where you sometimes still need to specify environment variables.What is needed is a way to specify environment variables in the configuration of a variant. For example:
In some cases, this is literally the only solution that will work, and no other amount of options can get around this. For example, imagine your compiler is clang, cross compiling for a Windows target on a Linux host. Here, clang actually finds the Windows SDK (on your Linux machine) by assuming you've set
INCLUDE
andLIB
. There's no (practical) way around this. Why this is important for CMake is because even just generating CMake has to run the compiler against various test programs, and if the environment isn't set up properly, this will just fail.