[cmake-developers] Please review FindQt_versioned_tools

Rolf Eike Beer eike at sf-mail.de
Wed May 21 14:43:30 EDT 2014


Am Mittwoch, 21. Mai 2014, 09:24:34 schrieb Clinton Stimpson:
> On Wednesday, May 21, 2014 10:50:42 AM Brad King wrote:
> > On 05/21/2014 09:18 AM, Stephen Kelly wrote:
> > > I recall discussion about this kind of thing before, but I think
> > > relating to qmake-qt4 and other versioned names.
> > 
> > Currently qmake is preferred over qmake-qt4, but I do not know
> > 
> > why.  There is a check to avoid using qmake from Qt5 at least:
> >  FindQt4: Do not use qmake from Qt5, 2013-03-05
> >  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=21123416
> > 
> > Originally qmake-qt4 was preferred over qmake:
> >  ENH: Add support for debian having both qt3 and qt4, 2006-02-28
> >  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2251970c
> >  (qmake-qt4 qmake)
> > 
> > Then the order was reversed without much detail in the commit:
> >  ENH: -apply the patches by Clinton Stimpson, 2006-04-27
> >  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f59ad1aa
> >  (qmake qmake-qt4)
> > 
> > The commit message mentions porting some changes from KDE's
> > module, so perhaps history is there.
> > 
> > Later they were flipped back and forth in one day:
> >  ENH:  Clarify a doc string.  Fixes #10358, 2010-03-17
> >  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bd0b37ea
> >  (qmake-qt4 qmake)
> >  
> >  Change to use FindX11.cmake.  Should fix #9929, 2010-03-17
> >  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=61ad5242
> >  (qmake qmake-qt4)
> > 
> > so that was likely an accident followed by a correction.
> > 
> > I think there was discussion too but I also do not remember when
> > or where.
> 
> I vaguely remember a discussion as well.
> I think it had something to do with find_program() looping over names then
> paths vs. paths then names.
> 
> Here's a test I just did on my machine:
> I have "qmake" for Qt3 in a system location, "qmake-qt4" for Qt4 in a system
> location, and "qmake" for my own Qt4 build under my home directory. I then
> add my own Qt4 build in CMAKE_PREFIX_PATH.
> 
> With find_program( .. qmake qmake-qt4 ...),
> I get my build of Qt4.
> 
> With  find_program( .. qmake-qt4 qmake ...),
> I get the system Qt4.

I have not touched the search for qmake, since searching for qmake is already 
protected against wrong major versions.

> Should we change FindQt4.cmake to loop over paths first, then it wouldn't
> matter as much what order the names are?  FindQt4 already handles the case
> where the qmake for Qt3 is found first and skip over it.

FindQt4 already only searches QT_BINARY_DIR for the other tools, and that is 
all this patch is about. IOW: I do not care much _which_ Qt version is found 
here, more that it finds a consistent set of tools, i.e. not using moc from Qt3 
together with Qt4 or vice versa. The Qt3 module is probably weaker in this 
spot, but I don't expect many people having different Qt3 installations these 
days, so hopefully noone will notice, and the patch would not make anything 
worse for them.

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140521/0cd50da5/attachment-0002.sig>


More information about the cmake-developers mailing list