gpt4 book ai didi

qt - 如何让cmake找到包配置文件

转载 作者:行者123 更新时间:2023-12-04 14:00:17 25 4
gpt4 key购买 nike

我正在尝试创建一个调用的项目

find_package(Shiboken REQUIRED)

cmake 提示
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "FindShiboken.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Shiboken",
but CMake did not find one.

Could not find a package configuration file provided by "Shiboken" with any
of the following names:

ShibokenConfig.cmake
shiboken-config.cmake

Add the installation prefix of "Shiboken" to CMAKE_PREFIX_PATH or set
"Shiboken_DIR" to a directory containing one of the above files. If
"Shiboken" provides a separate development package or SDK, be sure it has
been installed.

我确实将 Shiboken 编译并安装到 C:\Program Files\shiboken。我可以看到在文件夹 C:\Program Files\shiboken\lib\cmake\Shiboken-1.1.2 下有像 ShibokenConfig.cmake、ShibokenConfig-python2.7.cmake、ShibokenConfigVersion.cmake 这样的 cmake 文件

我如何让 cmake 知道它应该在该文件夹中搜索 ShibokenConfig.cmake?

最佳答案

Shiboken 的一位贡献者通过电子邮件回答了我的问题,我确认它正在工作。

解决方案:

cmake .. -G"MinGW Makefiles" -DShiboken_DIR=C:\shiboken\lib\cmake\Shiboken-1.1.2

注意: 我将 C:\Program Files\shiboken 复制到 C:\shiboken 是因为 cmake 提示“C:\Program Files”(可能是因为里面有空格)。

关于qt - 如何让cmake找到包配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14230565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com