cmake没有找到Qt4 [英] cmake not finding Qt4

查看:856
本文介绍了cmake没有找到Qt4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从4.8.0出来,我重新安装Qt,现在我想使用cmake太。为了使cmake工作,我记得必须添加mingw bin文件夹( QtSDK\Desktop\Qt\4.7.3 )到PATH回到Qt4.7.3,所以我猜想在 QtSDK\Desktop\Qt\4.8.0 中会有一个类似的文件夹,但现在不是这样。我的问题是,有没有人有设置Qt和cmake的经验?我现在可以使用一些帮助,因为我已经google了一会儿,并且无法找到任何方式使cmake工作。



当尝试构建,我得到这个众所周知的消息:

  CMake错误在C:/ Program Files(x86)/ CMake 2.8 / share / cmake-模块/ FindPackageHandleStandardArgs.cmake:91(MESSAGE):
无法找到Qt4(缺少:QT_QMAKE_EXECUTABLE QT_INCLUDE_DIR)
调用堆栈(最近调用):
C: / CMake 2.8 / share / cmake-2.8 / Modules / FindPackageHandleStandardArgs.cmake:252(_FPHSA_FAILURE_MESSAGE)
C:/ Program Files(x86)/ CMake 2.8 / share / cmake-2.8 / Modules / FindQt4.cmake:1171 FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:3(find_package)


解决方案

所以,我发现了什么问题,我想我应该知道。我只是添加了 C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\bin 到我的PATH变量。可能有用的是注意,在默认的4.8.0安装,qmake位于 C:\QtSDK\Desktop\Qt\4.8.0\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ code>,而不是4.7.3中的 C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin 。注意区别; msvc2010 vs mingw 。它实际上是显而易见的,因为 msvc2010 是该目录中唯一的文件夹。



我没有尝试skyhisi的答案,因为它不再需要,但我猜,这是另一个正确的(如果不是更好的方式)使cmake工作。 / p>

Since 4.8.0 is out, I've reinstalled Qt, and now I want to use cmake too. To make cmake work, I remember having to add the mingw bin folder (QtSDK\Desktop\Qt\4.7.3) to PATH back in Qt4.7.3, so I guessed that there would be a similar folder in QtSDK\Desktop\Qt\4.8.0 now but this is not the case. My question is, does anybody else have experience with setting up Qt and cmake? I could use some help right now, as I've googled for a bit and was unable to find any ways to make cmake work.

When trying to build, I get this well known message:

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE QT_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1171 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:3 (find_package)

解决方案

So, I found out what was the problem, and I think I should have known before. I simply added C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\bin to my PATH variable. It may be useful to note that, in a default 4.8.0 install, qmake is located in C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\bin as opposed to C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin in 4.7.3. Notice the difference; msvc2010 vs mingw. It's actually glaringly obvious, as msvc2010 was the only folder in that directory.

I didn't try skyhisi's answer as it was no longer needed, but I'm guessing that it's another correct (if not better) way to make cmake work.

这篇关于cmake没有找到Qt4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆