When I am trying to install CMake I get the error:
Visual Studio 15 2017 could not find any instance of Visual Studio.
I am using Windows 7 and Visual Studio 2017. The CMakeOutput.log
file writes:
The system is: Windows - 6.1.7601 - AMD64
Any ideas?
In Visual Studio 2015, Visual Studio users can use a CMake generator to generate MSBuild project files, which the IDE then consumes for IntelliSense, browsing, and compilation.
In general the key to solving this problem always seems to be reinstalling/modifying Visual Studio, which ends up repairing the environment so that cmake can find the Visual Studio instance.
Open the "Visual Studio Installer", pick "Modify" and make sure it includes "Desktop Development with C++". This is probably missing, so install it. Don't forget to reboot. If it's still not working, open the "Individual Components" tab in the installer and make sure "Visual C++ tools for CMake" is checked.
I ran into the same error and performed the following steps to resolve the issue:
These steps resulted in the "Visual C++ tools for CMake" feature being installed, but the other optional C++ features included in this workload may also helpful for what you are trying to do.
After the Visual Studio updater finishes installing try re-running the command. You may need to open a new command window.
In my case, I installed Visual Studio, selecting the workloads and modules that I wanted, but I ignored the request to reboot, assuming that shutting down the computer at the end of the day and restarting it the following day would suffice. I was wrong.
The following day I tried a cmake build and got the "could not find any instance of Visual Studio" error. After several attempts to resolve, I re-ran the installer, made no changes to the configuration, and clicked Modify. This time I let it reboot the computer. The reboot took a long time. After which my cmake build worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With