PDA

View Full Version : path to Makefile in *.pro file



Andreas
9th August 2012, 09:19
Hi,

is it possible to tell Qt in the *.pro file that the Makefile should be in another directoy in a way that the QtCreator can build the project?

At moment I have the following setting in my pro-file:


QMAKE_MAKEFILE = $${PRJ_BUILD}Makefile
message(QMAKE_MAKEFILE=$$QMAKE_MAKEFILE)

PRJ_BUILD is the path where the Makefile should be.

QMake already runs in QtCreator without any problem, but if I want to build then, make tells me, that it can not find the Makefile.
I think this is related to the variable OUT_PWD, but changing the variable will not work. Is this a readonly variable?
Can I change the QtProjectSettings of QtCreator for make in a pro-file?

Did I overseen anything?

The background is, that I use "Pro C" and the generated C-File, should not be in my sources, so I have to locate the Makefile in a different directory called "build"!

I have already seen the old thread (http://www.qtcentre.org/threads/22773-How-to-name-makefile-in-pro-file) of 2009, but there is no solution for me...

Thanks
Andreas

Andreas
10th August 2012, 07:33
Hi,

I solved my problem in an other way.
Now I don't relocate the Makefile, but I give a path where the generated C-File has to be...
But a small beauty fault is, that the Makefile is already in my sources...
but I think I can live with that.

Andreas

ChrisW67
10th August 2012, 08:14
Why not just shadow build the entire project? There's an option in the Qt Creator project settings to do this. It is the equivalent of:


$ pwd
/home/chrisw/myproject
$ mkdir ../myproject_build
$ cd ../myproject_build
$ qmake ../myproject
$ make

The soure tree is left entirely alone. All intermediate files go into myproject_build in a tree that mirrors the source.