How to reset CMake in QT Creator?
-
I updated Visual Studio on my Windows 10 machine and started to get the following error when running CMake from QT creator:
CMakeLists.txt:5: error: The CMAKE_C_COMPILER: cl is not a full path and was not found in the PATH. To use the JOM generator with Visual C++, cmake must be run from a shell that can use the compiler cl from the command line. This environment is unable to invoke the cl compiler. To fix this problem, run cmake from the Visual Studio Command Prompt (vcvarsall.bat). Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
This error can be fixed by removing intermediate CMake files from previous build, but I can't figure out where are they, because my build directory does not exist at all.
I tried to re-add CMake to Kits, and to "Re-configure CMake with initial parameters" in my project settings, but with no success.
-
I fixed this buy changing C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat with C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsx86_arm64.bat., see https://developernote.com/2021/09/how-i-fixed-cmake-configuration-has-no-path-to-c-compiler-in-qt-creator/