项目场景:
ubuntu 中VTK cmake 过程中找不到QT5目录
问题描述:
cmake-gui 中,勾选VTK_Group_QT后,Configure报错:
By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5" with any of
the following names:
Qt5Config.cmake
qt5-config.cmake
Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.
解决方案:
手动填上Qt5_DIR的地址,地址要精确到Qt5Config.cmake所在文件夹(坑死,找了一下午,tnnd)。安装了libqt5-default啥的没用,重新下载安装QT5.12.5,我默认安装到了/opt/QT5.12.5。在安装时一定要把Desktop gcc勾选上,不然白装了qtcreator…
正确的目录为:
/opt/Qt5.12.5/5.12.5/gcc_64/lib/cmake/Qt5
填上后,Configure+Generate: