View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011789CMakeCMakepublic2011-02-03 03:332011-02-04 10:49
ReporterJean Porcherot 
Assigned ToClinton Stimpson 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformWin XP/SevenOSOS Version
Product VersionCMake 2.8.3 
Target VersionFixed in Version 
Summary0011789: Unable to force a Qt version to be picked by cmake
DescriptionHi,

Earlier, I reported issue 0011779 (http://public.kitware.com/Bug/view.php?id=11779 [^]). James proposed a great solution that works...partially.

I Added the qt.conf.in and it works fine...unless there is a Qt version installed on the PC. As proposed, I set QTDIR to C:/code/sw/3rdparty/Qt/4.7.1/qt-win32-msvc2008, but, on the PC I run cmake from, the devlopper installed Qt 4.5.2 some time ago.

Then, FindQt4.cmake picks up the 4.5.2 version of Qt rather than the 4.7.1 I'm asking it to use through the QTDIR variable.

That's because, we check for the registry before we check for the QTDIR path (see below):

GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
  "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
  $ENV{QTDIR}/bin
  DOC "The qmake executable for the Qt installation to use"
)

So, once again, I had to modify the FindQt4.cmake script by commenting the GET_FILENAME_COMPONENT line.

I'd rather not modify this file as the modification will be lost next time I'll upgrade cmake. Is there another way to workaround the problem from my CMakeLists.txt?

Thanks in davance

Jean
TagsNo tags attached.
Attached Files

 Relationships
related to 0011779closedClinton Stimpson FindQt4 fails because I re-organised my Qt folder 

  Notes
(0025263)
Clinton Stimpson (developer)
2011-02-03 18:46

Typically, people put it in their PATH environment variable because they need their apps (that were just built) to find the Qt dlls at runtime.

The PATH environment variable has a higher priority than any of those paths in that find_program() call.

So that and CMAKE_PREFIX_PATH should probably be preferred as general ways to find things.
(0025276)
Jean Porcherot (reporter)
2011-02-04 05:49

OK, adding set( CMAKE_PREFIX_PATH "$ENV{QTDIR}/bin" ) works well.

Thanks for your help and reactivity!

Jean
(0025282)
Clinton Stimpson (developer)
2011-02-04 10:49

closing.. as there are more general ways of telling cmake what you want found.

 Issue History
Date Modified Username Field Change
2011-02-03 03:33 Jean Porcherot New Issue
2011-02-03 08:15 Brad King Relationship added related to 0011779
2011-02-03 08:15 Brad King Assigned To => Clinton Stimpson
2011-02-03 08:15 Brad King Status new => assigned
2011-02-03 18:46 Clinton Stimpson Note Added: 0025263
2011-02-04 05:49 Jean Porcherot Note Added: 0025276
2011-02-04 10:49 Clinton Stimpson Note Added: 0025282
2011-02-04 10:49 Clinton Stimpson Status assigned => closed
2011-02-04 10:49 Clinton Stimpson Resolution open => won't fix


Copyright © 2000 - 2018 MantisBT Team