简体   繁体   中英

cmake does not see Qt4

NOTE : not the same problem as question "make cannot find Qt4"!

Hi. There are a lot of very similar questions to this out there but I couldn't find one with so clear a problem. I need to install pyside on Scientific Linux 5.8. I've over come most dependency issues with some difficult and now I'm trying to build pyside from source.

I've git clone'd the required directories, now cd'ing first into apiextractor/ and running

]$ mkdir build
]$ cd build
]$ cmake ../

... fails with the cmake error:

 Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x

However, I have installed qt47 and qt47-devel from the atrpms-testing repository. Looking in /usr/lib64/

]$ /usr/lib64/qt*

... produces:

我的虚拟机的屏幕截图

So my question is fairly straightforward: why is cmake (specifically the command "find_package(Qt4 4.5.0 REQUIRED)") not finding Qt 4.7 when it is there and located where you would expect.

NOTE: I'm using cmake-2.8 as required.

Cheers,

Derek

I would guess that cmake relies on qmake to determine the layout of the Qt libraries. So if your system has several versions of Qt installed, you will have to take care to specify which qmake you want cmake to use, eg:

$ mkdir build
$ cd build
$ cmake .. -DQT_QMAKE_EXECUTABLE=path/to/qt4/qmake

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM