PDA

View Full Version : qmake question



lni
17th April 2007, 19:13
Hi,

I have a common config.h file located in a shared directory, which is shared by many pro files under different directories. Is there a command I can use in the config.h file to determine the full path of the pro file when executaing qmake on any of the pro files?

Currently, I have to add the following same line in every pro file, which I don't like.
dir = $$system( pwd )

camel
17th April 2007, 20:48
Didn't you ask the same question already?

What did not work with the approaches posted in this thread:
http://www.qtcentre.org/forum/f-qt-programming-2/t-how-to-get-current-dir-using-qmake-5071.html#6

lni
17th April 2007, 20:57
Didn't you ask the same question already?

What did not work with the approaches posted in this thread:
http://www.qtcentre.org/forum/f-qt-programming-2/t-how-to-get-current-dir-using-qmake-5071.html#6

You bet!!! Sorry I didn't know you already answered it the next day I posted the question! And it is exactly the answer I was looking for!!!

Excellent!! Thanks!

lni
17th April 2007, 21:00
On the other hand, I feel bad, because I already put

CURRENT_DIR = $$system( pwd )

in all the final pro files, and now I have to yak it!!

wysota
18th April 2007, 00:42
Use sed :)

find . -name "*.pro" - exec sed -e "s/CURRENT_DIR = $$system( pwd )/$$OUT_PWD/g" "{}" > \{\}.new; mv \{\}.new "{}" \;