[cmake-developers] Please review FindQt_versioned_tools

Clinton Stimpson clinton at elemtech.com
Wed May 21 11:24:34 EDT 2014




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.

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.

Clint




More information about the cmake-developers mailing list