I used below commands to install some stuff.
qmake PREFIX=/path/to/my/dir
make
make install
However the path I gave was wrong, how do I update PREFIX to the right location and remove the old install, then install again?
I tried:
rm -rf /path/to/my/dir/bin # this is where the program being installed
qmake PREFIX=/path/to/correct/dir
make
make install
But it's still being installed to the old path.
According to "qmake -h", this would set it globally:
qmake -set prefix /path/to/correct/dir
For ~ QT 5:
In qmake
the installation directory for the standard installation rules comes from the qmake
variable target.path
.
In general, qmake
does not use a setting called PREFIX
, although because this is the traditional term in Unix for the target installation directory, it is a popular enough convention for particular projects to create their own PREFIX
variable for use within their project files (*.pro
).
Take a look through the .pro
files of the project and find out where target.path
is set. If it is set from an environment variable, i.e.
target.path = $$(PREFIX) # note the regular parentheses
then you can pass the value in the environment you run qmake
in:
$ PREFIX=/path/to/my/dir qmake
If it is set from a qmake
property, i.e.
target.path = $$[PREFIX] # note the square brackets
then you can set the property persistently for future qmake
runs on the command line:
$ qmake -set PREFIX /path/to/my/dir
If it is set from an internal variable, it will look like
target.path = $$PREFIX
or
target.path = $${PREFIX} # note the curly braces
There's no way to override the value of an internal variable from the qmake
command line; you need to figure out where in the .pro
file the internal variable is being set and make appropriate changes, perhaps by just editing the .pro
file, or if there is some kind of logic there, figuring out how to have it choose a different value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With