PDA

View Full Version : Include a file using variables into the Makefile created by qmake



tarod
28th January 2008, 08:05
Hello,

I need some help with qmake and the Makefile generated by Qt. I was searching in Qt Assistant but I didn't find anything to solve my problem.

I'd like to include a file using variables into the Makefile created by "qmake" command. Something like that:

.pro example


TEMPLATE = lib
TARGET =
DEPENDPATH += .
LIBS += …

include ( var.include )

INCLUDEPATH += .

Is that possible?

By the way, is there something to include my own variable into the Makefile? Example:

.pro example


TEMPLATE = lib
TARGET =
DEPENDPATH += .
LIBS += …

MYOWNVARIABLE = $(ROOT)

INCLUDEPATH += .

Thank you very much.

wysota
28th January 2008, 11:18
I'd like to include a file using variables into the Makefile created by "qmake" command.

include(file.pri) should work fine.


By the way, is there something to include my own variable into the Makefile?
What does "my own variable" mean? Read qmake docs and the Undocumented qmake article in our wiki.

tarod
6th February 2008, 10:06
Hello again,

I was trying to include a file using include(file.pri) but the file is processed when my idea is only read the variables that contains that file. Any solution?


What does "my own variable" mean? Read qmake docs and the Undocumented qmake article in our wiki.

I'd like to include variables like MYINCLUDE = hello.h, MYCOMPILER = g++ and so into the .pro provided by qmake. These variables sould appear in the Makefile.

Is that possible?

Thank you very much.

wysota
6th February 2008, 13:53
If you make a variable assignment in a .pro file, it is copied to the resulting Makefile.