View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012332CMakeCMakepublic2011-07-12 04:572016-06-10 14:31
Reporterspineless 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformQt 4.7.2 for Desktop MingwOSWinXpOS Versionservice pack 3
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0012332: CMake fails to find Qt 4
DescriptionCMake fails to find Qt 4 installation. CMake should be able to find Qt without any user configuration, and this bug severely limits its usability as the most universal make program available.

While importing a project into Qt using its SVN import wizard. Wizard tries to use cmake to import project, but fails with the following message:

juffed version: 0.8.2
CMake Error at C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE
QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR
QT_QTCORE_LIBRARY)
Call Stack (most recent call first):
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1162 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:205 (FIND_PACKAGE)


Also, The error message is not clear enough for a user just trying out cmake for the first time to be able to correct the issue themselves.
Steps To ReproduceInstall latest Qt SDK
Install CMake

In Qt creator select:
Create new project...
Project from version control -> subversion checkout
Repository: http://juffed.svn.sourceforge.net/svnroot/juffed/0.8 [^] (for example)
Next >
Run cmake
Tagsfind_package, FindQt4.cmake, qt, QT_QMAKE_EXECUTABLE
Attached Files

 Relationships

  Notes
(0027028)
Clinton Stimpson (developer)
2011-07-12 12:23

Do you have an idea on how CMake would automatically find it?

What do you think of asking the Qt Creator developers to pass that information down to CMake when creating the project?
One can have multiple Qt installations with Qt Creator, and Qt Creator will let you choose which one(s) to use when creating a non-CMake based project. I don't think CMake would really know which of multiple ones to use. Even if there was only one Qt, the Qt Creator installer doesn't put anything in the registry for CMake to look up.
(0027029)
Clinton Stimpson (developer)
2011-07-12 12:28

QtCreator bug 2346 seems related.
(0027034)
spineless (reporter)
2011-07-13 04:35
edited on: 2011-07-13 05:26

If you think it's impossible to find Qt installation directories automatically, how about printing out a line in the error message to tell the user how to set up cmake to find and use the correct version of Qt?

What's the file "FindQt4.cmake" for, it not for finding Qt4 then?

(0027035)
Aurelien Vallee (reporter)
2011-07-13 17:54

"Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY)"

This message is reported by FIND_PACKAGE_HANDLE_STANDARD_ARGS in FindQt4.cmake:1162

This implies that either of these variables are not set: QT_QMAKE_EXECUTABLE, QT_MOC_EXECUTABLE, QT_RCC_EXECUTABLE, QT_INCLUDE_DIR, QT_LIBRARY_DIR.

Looking at the script, it seems to try to locate Qt using the qmake executable to retrieve the Qt install path (which is a fairly sane and standard practice).

The possible solutions for your problem are:
1. Add the path to the directory containing the qmake executable to your PATH environment variable (i.e. export PATH=/path/to/qmake/dir/:PATH under linux)
2. Set the cmake variable QT_QMAKE_EXECUTABLE to the full path of the qmake executable (i.e. cmake /path/to/CMakeLists.txt -DQT_QMAKE_EXECUTABLE=/path/to/qmake/executable/dir/)
3. Set the QT_QMAKE_EXECUTABLE in your CMakeCache.txt or using ccmake/cmakegui
(0030276)
David Cole (manager)
2012-08-11 11:38

Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041861)
Kitware Robot (administrator)
2016-06-10 14:28

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2011-07-12 04:57 spineless New Issue
2011-07-12 04:59 spineless Tag Attached: find_package
2011-07-12 04:59 spineless Tag Attached: qt
2011-07-12 04:59 spineless Tag Attached: FindQt4.cmake
2011-07-12 04:59 spineless Tag Attached: QT_QMAKE_EXECUTABLE
2011-07-12 12:23 Clinton Stimpson Note Added: 0027028
2011-07-12 12:28 Clinton Stimpson Note Added: 0027029
2011-07-13 04:35 spineless Note Added: 0027034
2011-07-13 05:26 spineless Note Edited: 0027034
2011-07-13 17:54 Aurelien Vallee Note Added: 0027035
2012-08-11 11:38 David Cole Status new => backlog
2012-08-11 11:38 David Cole Note Added: 0030276
2016-06-10 14:28 Kitware Robot Note Added: 0041861
2016-06-10 14:28 Kitware Robot Status backlog => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team