LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   "qmake not found!" -- Qt-4.3.4 is installed, so what must I set to point cmake to it? (https://www.linuxquestions.org/questions/slackware-14/qmake-not-found-qt-4-3-4-is-installed-so-what-must-i-set-to-point-cmake-to-it-625837/)

analgesic 03-05-2008 04:24 AM

"qmake not found!" -- Qt-4.3.4 is installed, so what must I set to point cmake to it?
 
Greetings all. A complete newbie here (i.e. as of Saturday), but I'm loving it so far.

I was told that starting with Slackware was the way to go, as it would force me to do the work necessary to understand linux -- and boy were they ever right! I think I'm [just] starting to get the hang of things now, but I've run into a bit of a problem and apparently google is not my friend.

I've installed Qt-4.3.4, but cmake isn't being pointed to the correct directory. I tried running

Quote:

export QTDIR=/usr/local/Trolltech/Qt-4.3.4
and

Quote:

export PATH=$PATH:$QTDIR/bin
but it didn't help. I thought perhaps logging off and then in again was necessary to apply the new PATH, so I did so, only to find that my PATH hadn't changed at all. So I tried

Quote:

export PATH=$PATH:/usr/local/Trolltech/Qt-4.3.4/bin
That edited the PATH, but it didn't help cmake find the correct directory. I know that it's not a problem with Qt, since a few hours earlier I'd used the -i option to manually point an installation to the right directory.

Any suggestions?

sagrailo 03-05-2008 06:02 AM

The problem is that both Qt 3 and 4 qmake executables have the same name; luckily, the solution is simple. You don't have to mess with QTDIR with Qt 4.x: you just need to create a symlink qmake-qt4 to your Qt 4's qmake binary - CMake's Qt 4 module is looking for executable named qmake-qt4 first, and then to one named qmake. Once Qt 4's qmake found by CMake, it will do the rest.

You may wish also to try installing Qt 4 through corresponding SlackBuild script (tried to put a link here - alas, seems like I'm not allowed as this is my first post, but you should be able to find it easily yourself).

HTH.

duryodhan 03-05-2008 07:56 AM

I generally install qt4 to /opt/qt4 ... there are lots of packages out there that do this afaik, although I compiled it from src.

H_TeXMeX_H 03-05-2008 10:59 AM

what are you trying to install ?

analgesic 03-10-2008 01:35 AM

Quote:

Originally Posted by sagrailo (Post 3078753)
The problem is that both Qt 3 and 4 qmake executables have the same name; luckily, the solution is simple. You don't have to mess with QTDIR with Qt 4.x: you just need to create a symlink qmake-qt4 to your Qt 4's qmake binary - CMake's Qt 4 module is looking for executable named qmake-qt4 first, and then to one named qmake. Once Qt 4's qmake found by CMake, it will do the rest.

You may wish also to try installing Qt 4 through corresponding SlackBuild script (tried to put a link here - alas, seems like I'm not allowed as this is my first post, but you should be able to find it easily yourself).

HTH.

I did find an executable named "qt4qmake" at
/usr/share/apps/kdevappwizard/imports/qt4qmake
but I'm not sure what to do next. Should the symlink go to that location, or to my Qt4 install directory's "qmake" executable? And where should the symlink start from? Is the location specified within cmake's module?

I'd hate to have to re-install Qt 4 (I already had to, as I mistakenly installed the core instead of devel). But that's because it seems like taking the easy way out, rather than actually learning where my current problem lies and how to fix it directly.

Quote:

Originally Posted by duryodhan (Post 3078844)
I generally install qt4 to /opt/qt4 ... there are lots of packages out there that do this afaik, although I compiled it from src.

Yes, I did as well, though I simply left it in the default install directory since I'm really not sure what I'm doing yet. So I know where qmake is, I just can't figure out how to tell cmake where it is, though I've been able to successfully use cmake by manually pointing it to the Qt4 directory.

Quote:

Originally Posted by H_TeXMeX_H (Post 3079029)
what are you trying to install ?

qimageblitz

H_TeXMeX_H 03-10-2008 03:29 AM

Thanks for the link, I just built it from source successfully by running:

Code:

cmake -DQT_QMAKE_EXECUTABLE=/usr/local/Trolltech/Qt-4.3.0/bin/qmake .
Your qt version is 4.3.4 so you should run:

Code:

cmake -DQT_QMAKE_EXECUTABLE=/usr/local/Trolltech/Qt-4.3.4/bin/qmake .

analgesic 03-10-2008 01:50 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 3083688)
Thanks for the link, I just built it from source successfully by running:

Code:

cmake -DQT_QMAKE_EXECUTABLE=/usr/local/Trolltech/Qt-4.3.0/bin/qmake .
Your qt version is 4.3.4 so you should run:

Code:

cmake -DQT_QMAKE_EXECUTABLE=/usr/local/Trolltech/Qt-4.3.4/bin/qmake .

Huzzah -- it worked!

Now, is there a way I can set cmake to automatically load qmake from that directory?

EDIT: Oh, and where did the "-DQT_QMAKE_EXECUTABLE=..." option come from? I don't remember seeing it in cmake's help file.

H_TeXMeX_H 03-10-2008 03:02 PM

Well, you can also do this in interactive mode running 'cmake -i .', it should list it near the end as an option.

analgesic 03-10-2008 09:52 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 3084248)
Well, you can also do this in interactive mode running 'cmake -i .', it should list it near the end as an option.

But I can't set cmake to automatically go to the right directory?

sagrailo 03-11-2008 03:28 AM

Create a symlink qmake-qt4 say in /usr/local/bin (or anywhere else in your $PATH):
ln -s /usr/local/Trolltech/Qt-4.3.0/bin/qmake /usr/local/bin/qmake-qt4

CMake will catch it automatically then.

analgesic 03-12-2008 09:02 PM

Perfect -- many thanks to all for the help!


All times are GMT -5. The time now is 03:01 PM.