# Qmake



## DemoDoG (Mar 3, 2012)

Okay, I*'*m trying to install this application called mmapper and it*'*s suppose*d* to be installed using Qmake and/or Cmake. I installed them both (qt4 and cmake) but have no idea on how to use them, instruction says I should go into directory and type Cmake or go to src directory and use Qmake but qmake wants more info of file etc.. any help on how it is used?

*P*rogram is this one:
http://sourceforge.net/projects/mmapper/


----------



## DemoDoG (Mar 3, 2012)

I got a little further by doing this:

```
setenv QMAKESPEC freebsd-g++
qmake -project
qmake
make
```
Now it at least starts to try building but I get lots of errors and it stops. should I type it in some other way or have I forgotten to set some variable?

In the installation instructions for the program it says I should just go into src directory and type qmake.


----------



## DemoDoG (Mar 3, 2012)

Ok I just tested this.
[cmd=]sh build.sh [/cmd]

*T*hat seemed to start some kind of compiling (why cant I do *./build.sh*?)

Well it seems that my QT stuff can*'*t be found, missing QT. Anyone here knows the correct setup in enviroment for cmake to find qt?

Versions I use:
QT 4.7.4
cmake 2.8.6_1
FreeBSD 9.0 R


----------



## xibo (Mar 4, 2012)

If you can't do *./build.sh* it is because the file lacks the execuable bit in its mode flags (see chmod(1)), or because it lacks its interpreter id magic (#!/bin/sh in first line of file).

Further, the qmake executable is called qmake-qt4 in FreeBSD, while a symlink from qmake to qmake-qt4 is not created by default during installation with ports or pkg_install.

Some linux/gnu distributions are symlinking qmake to qmake-qt3, which will not properly pull in the Qt4 configurations; maybe this is the case in FreeBSD, too? (never had qt3 installed here)


----------



## DemoDoG (Mar 5, 2012)

Yeah, I must start looking for some manual about how to set up QT on FreeBSD. I don*'*t even know the difference between make, cmake, or qmake  *C*an it be built by any of those?

I don*'*t understand why the manual says I just have to download source and then in directory type *cmake* and it should be made. But of course it perhaps has to be done on linux. *A*nyhow it seesm hard to find information about how to set up QT?


----------



## kpa (Mar 5, 2012)

You should ask this on the freebsd-kde mailing list, the FreeBSD KDE maintainers must have gone trough the same headaches with QT as you're now facing and they might have some valuable information to share.


----------



## roddierod (Mar 5, 2012)

DemoDoG said:
			
		

> Yeah I must start looking for some manual about how to setup QT on FreeBSD. I dont even know the difference between make cmake or qmake  can it be built by any of those?
> I dont understand why manual says I just have to download source and then in directory type cmake and it should be made. But ofcourse it perhaps has to be done on linux. anyhow it seesm hard to find information about how to setup QT?



I've just started playing with porting applications and just started on a QT based app a few hours before reading this post, so some of the things I can tell you.

1st, from looking at the files on this project page and instructions they give you are going to be geared toward Linux and Windows, since they do have a windows exe.

Qmake is the make for QT applications and setting the the *QMAKESPEC* variable is what you need to do to get things to start.

All the errors you are seeing are probably all the things you need to convert from Linuxism to FreeBSD. Without seeing the errors I can't be more specific, but I know one that bits me on everything I tried to port so far is the Linux *inotify* which you have to translate to *kqueue* in FreeBSD.

It's early in the morning and I only had one cup of coffee so I hope this made sense. If you post the compile errors I may be able to give you some more pointers.


----------



## DemoDoG (Mar 5, 2012)

Thanks Roddierod! Well to be honest I haven*'*t even got any compile errors yet since building doesn*'*t even start because it can*'*t find QT. What should I put as QMAKESPEC to make it find the latest QT from ports? (4.7.4) Do I also have to set QMAKEDIR? What do you have in your enviroment that works?


----------



## roddierod (Mar 5, 2012)

Well all I needed was


```
setenv QMAKESPEC freebsd-g++
```

To get it to find qmake. Are you sure you have qmake installed? 
Check and make sure qmake and qmake-qt4 are located in */usr/local/bin*.

If all that is correct you should be able to just issue

```
qmake
```
 to start the build process. Then you should get some errors...


----------



## DemoDoG (Mar 7, 2012)

It seems I did not have a complete install, so now I have re-installed FreeBSD on the machine and have compiled devel/qt4 (my god it took long time!)

Tomorrow I will test to se what happens, does this port include both qmake and qmake-qt4?


----------



## roddierod (Mar 7, 2012)

I kind of assumed from the way you phrased things you did not have Qt or qmake installed, but you should not have needed to re-install FreeBSD itself, unless there were other issues.

devel/qt4-qmake is it own port, it does not seem to be a dependent of Qt itself, or at least I did not see it listed as so.


----------



## DemoDoG (Mar 8, 2012)

*A*ccording to *pkg_info* the qt4-make is already installed on my system after I did the full QT installation but either qmake or qt4-make has turned up in /usr/local/bin? Can I add it there myself?


----------



## roddierod (Mar 8, 2012)

I think your safest bet here is to try and install devel/qt4-make. If the install bombs saying the port is already installed then great or if it installs the port than great too.

After that set the *QMAKESPEC* variable and try and build.


----------



## DemoDoG (Mar 8, 2012)

It can*'*t be installed since it says it is already installed  and the command qmake or qt4-make won*,*t work lol - well I will dig into it further, thanks for helpful advice!


----------



## roddierod (Mar 8, 2012)

Can you post the error messages?


----------



## DemoDoG (Mar 8, 2012)

*T*here are none, as I said it doesn't recognise the command qmake although it is installed, so I can*'*t use qmake at all.


----------



## roddierod (Mar 8, 2012)

I meant the error message from just typing qmake in general or the error or message from trying to install devel/qt4-make. I was just trying to see if despite what pkg_info says that qt4-make is not installed. I'm guessing that either your path is screwed up - which is doubtful since you can do other things - I assume - OR qt4-make is not installed. In which case, no matter what pkg_info says you need to force the install.


----------



## DemoDoG (Mar 8, 2012)

Okay, well I have just tried typing in qmake and qt4-make in console and it just says that it doesn*'*t know that command - and it never shows up in /usr/local/bin.

Ok, I try to forceinstall it


----------



## DemoDoG (Mar 9, 2012)

Thanks ALOT! I finally managed to build it! I installed everything as packages again and it worked, I could build the program without having to change anything in the sourcecode.

Silly question perhaps - do I need to keep all the QT stuff to keep running the program? feel so stupid I have to install 200+ MB stuff just to get such small program running


----------



## roddierod (Mar 9, 2012)

You would probably just need Qt runtime support, but I don't know the port/package structure of Qt to tell you which one to remove or not. Good luck.


----------

