PDA

View Full Version : Some building questions



Morea
22nd February 2006, 12:21
Hi.
I've managed to build Qt programs by giving the commands
qmake -project
qmake
make -f Makefile.Release

But I'd rather just do

qmake -project
qmake
make
and get the executable in the current directory. Not in the Release directory. How can I do that?

The second question is: Are the programs dynamic or static built? Can I swtich between these two modes in any easy way?

Cesar
22nd February 2006, 12:52
I hope refering to QtForum won't be punished :)
Here's a solution (http://www.qtforum.org/post/58289/qmake-generated-makefiles-causes-different-output-.html#post58289) for your first question.

Morea
23rd February 2006, 08:50
Nice! Now I need some help with a custom made makefile.



all:
qmake -project
qmake
make


The line


CONFIG -= debug_and_release debug_and_release_target

should be added to the <projectname>.pro file automatically, how can I do that in a nice simple automatic way?
Any ideas?

Cesar
23rd February 2006, 09:27
You might do one of the following:

qmake -project "CONFIG -= debug_and_release debug_and_release_target"
qmake "CONFIG -= debug_and_release debug_and_release_target"
Comment out debug_and_release and debug_and_release_target from %QTDIR\mkspecs\win32-g++\qmake.conf file

Morea
23rd February 2006, 10:11
So simple! Thanks, now I finaly almost have a working Dev-C++ and Qt environment!

jacek
23rd February 2006, 11:20
Nice! Now I need some help with a custom made makefile.



all:
qmake -project
qmake
make

You might run into troubles with such rule. "qmake -project" will include in your .pro file all files that look like sources from the current directory and all of its subdirectories. If there will be some autogenerated files left (for example moc output), you might get linker errors.

Morea
23rd February 2006, 11:39
Yes, but if I use a separate directory for each project I will stay clear of the problems.
Yes, it's a mess, but dev-c++ is a total crap when it comes to Qt integration.
I'm waiting for a Qt and C++ development IDE.

But regarding the moc files, I've tried to rebuild the code a few times and it seems to ignore the
moc_mainwindow.cpp file.
Is this qmake beeing clever and making a good guess about files beginning with moc_ ?

jacek
23rd February 2006, 11:54
Is this qmake beeing clever and making a good guess about files beginning with moc_ ?
I guess it's clever enough to skip them, but I recall that few people had problems with too much entries in a .pro file.