| Summary: | cmake doesn't detect qmake for Qt4 | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Piotr Mierzwinski <piotr.mierzwinski> |
| Component: | RPM Packages | Assignee: | Nicolas Lécureuil <mageia> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | arkr17997, lmenut |
| Version: | Cauldron | ||
| Target Milestone: | --- | ||
| Hardware: | i586 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | libqt4-devel-4.8.7-3.mga6.i586.rpm | CVE: | |
| Status comment: | |||
|
Description
Piotr Mierzwinski
2015-08-02 01:24:08 CEST
Rémi Verschelde
2015-08-02 02:03:29 CEST
CC:
(none) =>
lmenut as done on our macro %cmake_qt4 you have to do : QTDIR="/usr/lib/qt4" ; export QTDIR ; PATH="/usr/lib/qt4/bin:$PATH" ; export PATH ; first as we don't have the link in /usr/bin/ . Status:
NEW =>
RESOLVED What about adding the qmake-qt4 and qmake-qt5 symlinks though? I agree they are not needed for RPM packaging, but for all end users who try to package Qt applications themselves, it's really annoying to have to run /usr/lib64/qt4/bin/qmake manually to prevent the $PATH from using Qt5's qmake. i won't for qt4 but i can take a look for qt5. forget my previous comment as this is not needed for qt5. @Nicolas Lécureuil at #1
Sorry, I don't get you :/
> first as we don't have the link in /usr/bin/ .
Yes you have. I didn't create it by myself (I mean link to qmake). Example:
$ cd /usr/bin
$ ls -l | grep qmake
lrwxrwxrwx 1 root root 23 lip 20 11:35 qmake -> /etc/alternatives/qmake*
And about macro:
Please take a look to FindQt4.cmake (up-to date package: cmake-3.3.0-1.mga6):
Quote from: /usr/share/cmake/Modules/FindQt4.cmake:525
set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac)
_qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION)
It's clear that cmake will look for "qmake-qt4", which is missing in "/usr/bin"
In my project I use following macro to find Qt4: "find_package(Qt4 REQUIRED phonon)" what works very well in Mageia 5 (in other distributions).
Your recipe doesn't work at all. Above environment variable I had exported in moment when I writing first post, sorry for I didn't put it before. Simply test below:
$ cd /usr/bin
$ mv qmake-qt4 qmake-qt4.bak
$ echo $QTDIR
/usr/lib/qt4
$ echo $PATH
/usr/lib/qt4/bin:/usr/bin:/usr/share/colorgcc:/bin:/usr/bin:/usr/local/bin:/usr/local/games:/usr/games:/usr/lib/qt5/bin:/home/piotr/bin
$
$ ls -l /usr/lib/qt4/bin | grep qmake
-rwxr-xr-x 1 root root 3424236 lip 25 01:47 qmake*
$
$ cd /home/piotr/Projects/qtcmd2
$ rm -rf build; mkdir build; cd build
$ cmake ../
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake/Modules/FindQt4.cmake:1326 (message):
Found unsuitable Qt version "5.5.0" from /usr/bin/qmake, this code requires
Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
Are able to explain why cmake not looking for qmake in first from PATH path?
I'm not expert how cmake works, that's why I've created qmake-qt4 symbolic link in /usr/bin, what is looked for in "FindQt4.cmake".
I'm not sure what is the problem in creating one more symbolic link (in Qt4 or Qt5 package) to make life easier for people who are creating application with Qt4?
Please note that not everybody (programmers) are using Qt5. I think still there is a lot of applications developing in Qt4. I suppose in other distributions (for example OpenSuse) such link exists. Is there any particular reason that's why you don't want to add it? As you can see above, settin path to qmake from Qt4 as first in PATH doesn't work.
Some workaround in this situation is setting qmake path in main CMakeLists.txt file. Like this: set(QT_QMAKE_EXECUTABLE /usr/lib/qt4/bin/qmake)
The issue here is that I'm not sure if in other distribution this location for qmake will be correct. The most likely for all using Plasma 5 will be fine, but for other NOT (Mageia 5, OpenSuse 13.2 and others). So it made that source code is not portable.
Second workaround is create synbolic link yourself.
Anyway workaround is always bad solution.Status:
RESOLVED =>
REOPENED Please test next qt4. After update all is fine :). From cmake I get followin message: -- Found Qt4: /usr/bin/qmake-qt4 (found version "4.8.7") Big thanks Nicolas. Fixed. Status:
REOPENED =>
RESOLVED you're welcome :)
Sunny yadav
2019-04-08 19:06:31 CEST
CC:
(none) =>
arkr17997 |