VS: CMake does not find portable instance
- Install Visual Studio Build Tools
- Copy the contents of the install directory (e.g. c:\program files (x86)\Microsoft Visual Studio\2019\BuildTools) to a version-controlled location, e.g. c:\depot\buildtools
Expected result: cmake finds the build tools in the specified location
- cmake doesn't even look in the specified location (confirmed with procmon.exe)
- "could not find specified instance of Visual Studio"
One of our engineering pillars is that we can build and run our software having only a version control client installed on the build machine. It seems that cmake expects Visual Studio to be fully installed, and enforces this by querying C:\ProgramData and the registry. These queries should not be necessary when a specific instance location is explicitly provided.