[cmake-developers] Qt 4 and 5 on the same system - qmake binary name priority
Marcus D. Hanwell
marcus.hanwell at kitware.com
Fri Mar 8 14:59:57 EST 2013
On Fri, Mar 8, 2013 at 2:52 PM, Clinton Stimpson <clinton at elemtech.com> wrote:
> On Friday, March 08, 2013 02:35:53 PM Marcus D. Hanwell wrote:
>> I notice that Arch has already patched this, but CMake master as of
>> aa027af9 still finds /usr/bin/qmake when a /usr/bin/qmake-qt4 is
>> available. This bug is reported here,
>>
>> http://public.kitware.com/Bug/view.php?id=13985
>>
>> Is there any issue with changing the order so that if qmake-qt4 is
>> found that is used preferentially over qmake which it seems will tend
>> to be the Qt 5 qmake? Stephen mentions qtchooser but it isn't clear
>> how relevant that is to making the find module prefer a qt4 specific
>> suffix if one is found. I didn't look at the proposed patch that
>> closely, but would like to understand any constraints on changing the
>> binary name search order before proposing anything.
>
> Its not as simple as changing the order.
> If I have my own build of Qt4, and if FindQt4.cmake had this:
> find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 qmake-mac qmake ...)
> and I try to use my build of Qt
> CMAKE_PREFIX_PATH=/home/me/qt/qt-4.7.2 cmake ../
> It finds /usr/bin/qmake-qt4 instead, because it searched for qmake-qt4 in all
> possible paths before searching for qmake.
>
> Currently, I think we need to keep "qmake" first.
>
> The proposed patch does improve the situation by making a separate
> find_program() call for each executable name. It also verifies the results of
> each find_program().
>
Yeah, I didn't notice that (and hadn't thought about interaction with
prefix path). It is a shame upstream couldn't agree on alternative
names for the Qt 5 versions so that a consistent scheme could be used
across distros. I can of course specify the full qmake path and all is
well (or use the Arch patched FindQt4 module). What made me think this
might work is all the subsequent calls for QT_*_EXECUTABLE but now I
notice they use QT_BINARY_DIR.
Thanks,
Marcus
More information about the cmake-developers
mailing list