如何让cmake找到一个包配置文件

时间:2013-01-09 07:54:34

标签: qt cmake pyside

我正在尝试调用一个调用

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

下有一些cmake文件,如ShibokenConfig.cmake,ShibokenConfig-python2.7.cmake,ShibokenConfigVersion.cmake。

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

1 个答案:

答案 0 :(得分:6)

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”(可能是由于其中的空格引起的)。