Visual studio have to remove .vs folder to have CMAKE work
Unsolved
General and Desktop
-
I have a QT project, using CMake in Visual Studio 2022. Each day when I open the project in VS the first time it fails with a "find_package" error trying to find Qt6. (I've lost the copy of the error, will paste it when it happens again).
The only way to resolve this is to delete the
out
and.vs
folders in the project. Then when it re-opens it does the CMake configure and works just fine. Then closing and re-opening usually works ok - except when it doesn't on random occasions.Has anyone else found this?
-
New day - here's the error!
CMake Error at DisplayGui/CMakeLists.txt:13 (find_package): By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt6", but CMake did not find one. Could not find a package configuration file provided by "Qt6" with any of the following names: Qt6Config.cmake qt6-config.cmake Add the installation prefix of "Qt6" to CMAKE_PREFIX_PATH or set "Qt6_DIR" to a directory containing one of the above files. If "Qt6" provides a separate development package or SDK, be sure it has been installed.
-
I use cmake on VS 2022, but I'm not an expert. It feels very beta-ish. When something does not work, I try one of the two:
- Restart VS2022
- Make a cmake build into the same build folder using Qt Creator. That updates CMakeCache.txt, and suddenly VS2022 knows what to do.
Unfortunately, I don't have a deeper understanding of what's going on here...