How to change qmake PREFIX location
According to "qmake -h", this would set it globally:
qmake -set prefix /path/to/correct/dir
qmake and QT_INSTALL_PREFIX. How can I select a new location for Qt library?
This is a 'builtin' compiled into qmake from qconfig.cpp. The best way is to reconfigure Qt with another -prefix and rebuild unfortunately. For most other variables, you can use a .qmake.cache file. See
http://doc.qt.digia.com/qt/qmake-environment-reference.html
for more info
qmake set install directory
Try to edit the qwtconfig.pri
file in the source directory, it has the installation path hardcoded for different platforms, as well as many other options you might want to change.
How can the install path be set for a qt project
I've found the solution to this, and it is just as easy as specifying the --prefix option to configure.
For qmake on the command line, you simpy add a PREFIX= parameter:
qmake PREFIX=/usr/local
There are two ways to do this in QtCreator. First, you could change your .pro file to include an explicit PREFIX variable definition. However, this is not recommended, as the prefix is a preference specific to each user, and it is preferable to keep the distributed project files generic. A better way to do this, is in your own project settings. Simply go to the build configuration that you are using, expand the qmake settings, and add PREFIX= to the additional arguments.
Qt project files and PREFIX variable
PREFIX doesn't mean anything in qmake files. The target for files is done via the target
parameter. So if you want to make PREFIX determine the base location, such as /usr/local
, you can do do something like this:
isEmpty(PREFIX) {
PREFIX = /usr/local
}
TARGET = myapp
TARGET.path = $$PREFIX/
The isEmpty(PREFIX)
will allow it to be changed during the command line call to qmake, e.g.
qmake PREFIX=/opt
Change Qt install path after building?
I was looking into this and found a way that works (in qt 4.7.2) by customizing qt with a qt.conf file.
In my case, I added a qt4-4.7.2/bin/qt.conf (I think it must be in the same place as the qmake executable)
With the following contents:
[Paths]
Prefix = c:/my_path/to/qt4-4.7.2
and the qmake -query started returning the proper paths!
See: http://qt-project.org/doc/qt-5.0/qtdoc/qt-conf.html for more details
How qmake set .dll and .lib file output path respectively
Try setting DESTDIR in your qmake file.
qmake using incorrect paths to Qt installation on linux
You can change that value with:
# qmake -set VARIABLE VALUE
I.e. in your case with:
# qmake -set QT_INSTALL_PREFIX /edrive/local/qt
Although judging from your qmake location, you're calling wrong qmake.
Try
/edrive/local/qt/bin/qmake -query "QT_INSTALL_PREFIX"
I have a feeling you have 2 Qt installations aside.
configure qmake for install headers to different subfolders
This works for me:
headerinstall.pri:
for(header, INSTALL_HEADERS) {
path = $${INSTALL_PREFIX}/$${dirname(header)}
eval(headers_$${path}.files += $$header)
eval(headers_$${path}.path = $$path)
eval(INSTALLS *= headers_$${path})
}
at the end of your .pro file:
INSTALL_PREFIX = /tmp/installprefix
INSTALL_HEADERS = $$HEADERS
include(headerinstall.pri)
qmake -query internal settings in Linux - where are they?
At configure time these paths are hardcoded in 'src/corelib/global/qconfig.cpp', and end up hardcoded into qmake when it is built. They are also hardcoded into many other files, like all the .la and .pc files, not to mention the Makefile install rules.
The only way to fix this is to figure out why configure keeps screwing up the prefix. configure is a big shell script, so it's easy to see where $QT_INSTALL_PREFIX is assigned from the '-prefix' argument, and then the different checks that are done on it (like running it through 'config.tests/unix/makeabs'). Try putting print statements before/after $QT_INSTALL_PREFIX is changed, and you should be able to find out where the path gets screwed up.
Also, you don't have to wait for the full build to complete to tell if the prefix was set
correctly. After configure runs, take a look in 'src/corelib/global/qconfig.cpp' and see what 'qt_configure_prefix_path_str' is set to.
Related Topics
Copying Files with Wildcard (*) to a Folder in a Bash Script - Why Isn't It Working
Why Can't Bash Recognize The Existence of a Socket File
How to Send Email from The Command Line
Raspberry-Pi Docker Error: Standard_Init_Linux.Go:178: Exec User Process Caused "Exec Format Error"
Running Docker Without Sudo on Ubuntu 14.04
How to Find All Immediate Sub-Directories of The Current Directory on Linux
Bluetooth Low-Energy on Linux API
What Special Meaning Does an Equal-Sign Have in Zsh
-Bash: /Usr/Bin/Virtualenvwrapper.Sh: No Such File or Directory
How to Add a Directory to The Perl Library Path at The System Level
Error: Nvidia-Smi Has Failed Because It Couldn't Communicate with The Nvidia Driver
How to Change Qmake Prefix Location
Will Java Compiled in Windows Work in Linux
Where Is Linux Cfs Scheduler Code
Difference Between Wic and Hddimg Format in Yocto
Incomplete Lsb Comment. Insserv: Missing Valid Name for 'Provides:' Please Add
System Calls: Difference Between Sys_Exit(), Sys_Exit and Exit()