使用Qt Creator写代码,感觉代码补全什么的没有clion好用。
于是使用clion来运行qt项目,却遇到了问题。
CMake Error at CMakeLists.txt:11 (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.
为什么会这样子,原来是使用clion新建项目的时候需要添加。
前缀路径
这个路径需要包含
只需要添加这个路径,新建项目就不会报错。
既可以编译成功了