PDA

View Full Version : how do I set the PREFIX inside the project file?



hakermania
18th August 2011, 11:48
Hello :)
I am building a project and I need to set the PREFIX of the installation root inside the project file.
I tried:


PREFIX = /usr/local

but when I run


qmake *.pro

it didn't output errors but there wasn't the word 'PREFIX' inside the makefile!
So, I assume that im doing something wrong?

hakermania
19th August 2011, 12:30
Sorry for this, it's not a bump. I figured it out, it is


DEFINES +="PREFIX=\"/usr/local\""

BUT I don't know how to use it inside my program!
For example:


cout << PREFIX;

gives error


/usr/local was not declared in this scope

and when I use:


cout << "PREFIX";

of course it outputs


PREFIX


I don't know what to do :/

nix
19th August 2011, 12:54
Try
DEFINES +="PREFIX=\\\"/usr/local\\\""

hakermania
19th August 2011, 21:09
good one!!!!!!!!!!!!!!!