【问题标题】:how to make cmake find a package configuration file如何让cmake找到一个包配置文件
【发布时间】:2013-01-09 07:54:34
【问题描述】:

我正在尝试创建一个调用

的项目
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?

【问题讨论】:

    标签: qt cmake pyside


    【解决方案1】:

    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”(可能是里面有空格)。

    【讨论】:

      猜你喜欢
      • 2015-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-25
      相关资源
      最近更新 更多