【发布时间】:2024-01-12 14:40:01
【问题描述】:
我想创建一个项目使用 VSCode+CMake+VCPKG(VTK+Qt5) 而且我仍然想与队友分享我的 VCPKG 依赖关系。 所以我导出了 VCPKG。
当我尝试find_package(Qt5 COMPONENTS Core REQUIRED) 时发生问题
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.
我尝试set(Qt5_DIR "{vckpg_root_path}\installed\x64-windows\share\qt5")
没有Qt5Config.cmake可以让cmake读取!!
里面就是这样。
我怎样才能准确地使用 Qt5 并在 cmakelist.txt 中设置包含文件目录?
【问题讨论】:
-
Qt5Config 通常在 lib/cmake 文件夹下。我通常倾向于自己构建 QT,所以不确定 vcpkg 版本。
标签: c++ windows qt visual-studio-code cmake