QMake make install problems
Hi,
I am trying to use QMake's INSTALLS variable, but it adds files to innstall (in Makefile), only if the files have been already created.
The problem i have that out file is not compiled yet, right. So QMake does not add this file to install list. Is there any way to force QMake to use not created yet files in install?
Re: QMake make install problems
What do you mean by "not created yet"? When do you want to create them?
Re: QMake make install problems
Quote:
Originally Posted by
wysota
What do you mean by "not created yet"? When do you want to create them?
The project is a lib, i want that make install will cp all .so to /usr/lib, but so file is created only after i run 'make', if those files are not created yet QMake does not add them to the install list. So when i run 'make install' only headers are copied.
If i run 'make', then 'qmake -makefile' and then 'make install' only then .so files are in Makefile and copied to /usr/lib
Sorry, i hope it's clear enough now.
Re: QMake make install problems
Ok, I take it that the library name is held in the TARGET variable as usual. Then all you have to do is add the following to your project file:
Code:
target.path = /usr/lib
INSTALLS += target
Re: QMake make install problems
Quote:
Originally Posted by
wysota
Ok, I take it that the library name is held in the TARGET variable as usual. Then all you have to do is add the following to your project file:
Code:
target.path = /usr/lib
INSTALLS += target
It was a custom variable. Now it works!
Thank You very much!
Re: QMake make install problems
I made the same mistake and used a custom name...:confused::(
However, I have some additional questions:
1.) If I add a line
target.files += file1 file2 file3
it doesn't work anymore. Why not ? Is the usage of += not allowed ?
2.) In addition to the application binary I want to install the *.qm language file (which are not yet created when calling qmake, too). How can I do that ?
3.) Where can I find a complete documentation about all these variables ?
Especially a list of all reserved names (like "target") and the available fields (.path, .files, .depends, .comands, ...) would be very helpful.
Re: QMake make install problems
You can create a separate installation point, independant of target. Then you can use variables. Just make sure the files you add to it are contained in a separate variable and add that variable instead of separate files.
Re: QMake make install problems
What do you mean when you talk about a separate "installation point" ? I tried the following
Code:
QMFILES = file1.qm file2.qm file3.qm
target.path = /opt/myapp
tstarget.path = /opt/myapp
tstarget.files = $$QMFILES
INSTALLS += target tstarget
but it doesn't work :o.
Re: QMake make install problems
The following works for me just fine:
INSTALL_HEADERS += widgets/wwglobal.h
INSTALL_HEADERS += $$wwHeaders(WWWIDGETS)
flat_headers.files = $$INSTALL_HEADERS
flat_headers.path = $$[QT_INSTALL_HEADERS]/wwWidgets
INSTALLS += flat_headers
Re: QMake make install problems
Thank you for your reply, but I don't know how to apply this to my problem.
I don't have any header-files and also no environment value like WWWIDGETS...
Could you give another short example with just a simple application myApp and two translation binaries file1.qm and file2.qm ?
Re: QMake make install problems
This is a real world example, ignore the variable names, focus on the syntax. In my case INSTALL_HEADERS contains a list of files to copy, that's all you need to know.
In your case it'd be something like:
INSTALL_TRANSLATIONS += file1.qm file2.qm
transinstall.files = $$INSTALL_TRANSLATIONS
transinstall.path = /opt/something
INSTALLS+=transinstall
Remember that you have to run qmake after files file1.qm and file2.qm are created for this to work.
Re: QMake make install problems
Quote:
Remember that you have to run qmake after files file1.qm and file2.qm are created for this to work.
But that's the point ! qm-files are create during make and make is called after qmake...
So I have to call qmake twice during the build+installation process !
qmake => creates makefiles
make => builds application binaries
make translation => creates translation binaries (qm-files)
qmake => creates makefiles again !!!
make install => installs application+translation binaries
The problem is, that the first qmake ignores all install-target files that are not yet built.
For the application binary, Trolltech seems to have implemented a "special" solution with the reserved "target" target.
But there seems to be no such a solution for other files, right ? :(:(:(
Re: QMake make install problems
Quote:
Originally Posted by
Comer352l
But that's the point ! qm-files are create during make and make is called after qmake...
So I have to call qmake twice during the build+installation process !
qm files are not created by make. At least not by default - qm files are created by calling lrelease on the project file. You don't need to recreate qm files during every compilation, only once during a final release (you can work on ts files in the meantime). I'm sure calling qmake once more in this situation is not a problem.