Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, March 2008
Paths not respected with Windows and MinGW


Message 1 in thread

As I stated in my previous mail, I am developing some programs [0] with Qt 
using Kdevelop under Debian. I defined the paths in the .pro so as to have 
all the .ui files under source_root/src/ui. The .pro by defect creates the 
binary in bin.

Now I have to compile the program in Windows. I downloaded Qt 4.3.4 and MinGW 
(the one that is automatically downloaded by the installer, from TT's ftp 
server).

I run qmake within the root of the project's source. the .pro in the root 
says:

SUBDIRS +=src
TEMPLATE = subdirs
CONFIG += warn_on qt thread

Now, the .pro in source_root/src/ says:

SOURCES += main.cpp practico1.cpp \
 scanlinetable.cpp
TEMPLATE = app
CONFIG += warn_on thread qt release
TARGET = ../bin/practico1
UI_DIR = ui
FORMS += ui/mainwindow.ui
HEADERS += practico1.h \
 scanlinetable.h

But, compiling under Windows, I get three folders under source_root/src/ 
(namely bin, release and debug). Of course, the binary ends up in 
source_root/src/bin instead of source_root/bin.

More than that, if the UIs (under source_root/src/ui) include a file in 
source_root/src, I have to modify the .h created by UIC from, for example, 
#include "glwidget.h" to #include "../glwidget.h"

What am I doing wrong? I guess I have to define something else in one of the 
two .pro for this to work correctly. Âany ideas?

Regards, Lisandro

[0] http://perezmeyer.com.ar/files/psg/


-- 
 [ signature omitted ] 

Message 2 in thread

El Domingo 02 Marzo 2008, Lisandro DamiÃn Nicanor PÃrez Meyer escribiÃ:
> As I stated in my previous mail, I am developing some programs [0] with Qt
> using Kdevelop under Debian. I defined the paths in the .pro so as to have
> all the .ui files under source_root/src/ui. The .pro by defect creates the
> binary in bin.
>
> Now I have to compile the program in Windows. I downloaded Qt 4.3.4 and
> MinGW (the one that is automatically downloaded by the installer, from TT's
> ftp server).
>
> I run qmake within the root of the project's source. the .pro in the root
> says:
>
> SUBDIRS +=src
> TEMPLATE = subdirs
> CONFIG += warn_on qt thread
>
> Now, the .pro in source_root/src/ says:
>
> SOURCES += main.cpp practico1.cpp \
>  scanlinetable.cpp
> TEMPLATE = app
> CONFIG += warn_on thread qt release
> TARGET = ../bin/practico1
> UI_DIR = ui
> FORMS += ui/mainwindow.ui
> HEADERS += practico1.h \
>  scanlinetable.h
>
> But, compiling under Windows, I get three folders under source_root/src/
> (namely bin, release and debug). Of course, the binary ends up in
> source_root/src/bin instead of source_root/bin.
>
> More than that, if the UIs (under source_root/src/ui) include a file in
> source_root/src, I have to modify the .h created by UIC from, for example,
> #include "glwidget.h" to #include "../glwidget.h"

This last thing I solved it by adding INCLUDEPATH = . in the .pro. The binary 
is still created in the wrong place, thought.

-- 
 [ signature omitted ] 

Message 3 in thread

On Sunday 02 March 2008, Lisandro DamiÃn Nicanor PÃrez Meyer wrote:
> But, compiling under Windows, I get three folders under source_root/src/
> (namely bin, release and debug). Of course, the binary ends up in
> source_root/src/bin instead of source_root/bin.

You can solve this with this:

TARGET = practicol
DESTDIR = ../bin

that way you force qmake to put the binary into the right place.

There are other nice qmake variables you might want to look at, eg. 
OBJECTS_DIR and MOC_DIR. Luckily they are documented... ;-)



	Konrad

Attachment:

Attachment: pgpqTBQgvSexB.pgp
Description: PGP signature


Message 4 in thread

El Lunes 03 Marzo 2008, Konrad Rosenbaum escribiÃ:
> On Sunday 02 March 2008, Lisandro DamiÃn Nicanor PÃrez Meyer wrote:
> > But, compiling under Windows, I get three folders under source_root/src/
> > (namely bin, release and debug). Of course, the binary ends up in
> > source_root/src/bin instead of source_root/bin.
>
> You can solve this with this:
>
> TARGET = practicol
> DESTDIR = ../bin
>
> that way you force qmake to put the binary into the right place.
>
> There are other nice qmake variables you might want to look at, eg.
> OBJECTS_DIR and MOC_DIR. Luckily they are documented... ;-)
> 	Konrad

Thanks Konrad! I had TARGET = ../bin/practico1 . It works fine in Linux, but 
it seems it doesn't in Windows.

I'll file a wishlist bug to kdevelop so as to solve this.

Thank you!


-- 
 [ signature omitted ]