Qt-interest Archive, February 2007
qmake lacking features?
Message 1 in thread
I ran into two problems with qmake:
First, permissions of installed files if compiling on unix:
If I use INSTALLS+=(name_of_target), it will add bunch of lines in style:
-$(INSTALL_FILE) "some_file" "$(INSTALL_ROOT)/usr/local/share/somedir/"
to generated Makefile
But if I look higher in the makefile:
COPY = cp -f
COPY_FILE = $(COPY)
INSTALL_FILE = $(COPY_FILE)
So the file is copied, including the permissions.
But problem is, that the files can be (and often are) build with
undesired permissions (for example if the build is done using umask
077, then "make install" will install the files unreadable for anybody
except root)
I tried to find some elegant way to add rule to set permissions on
installed files.
There is something like
unix:(name_of_target).extra = ...
BUT the extra section is launched before the instalation of that
target, while the files need to be chmodded after they are installed.
I looked in manual of qt3 and qt4 qmake and found nothing else ....
Any elegant way to add chmod commands to generated makefile by
modifying the corresponding .pro file?
Also, is there some easy option to telling apart if qmake for Qt3 or
Qt4 was invoked in the project (.pro) file?
Something like:
if (qt3) {
... somestuff
}
if (qt4) {
... anotherstuff, like plugging in q3support ....
}
Martin Petricek
--
[ signature omitted ]
Message 2 in thread
On 16.02.07 16:01:28, BH wrote:
> First, permissions of installed files if compiling on unix:
>
> If I use INSTALLS+=(name_of_target), it will add bunch of lines in style:
> -$(INSTALL_FILE) "some_file" "$(INSTALL_ROOT)/usr/local/share/somedir/"
> to generated Makefile
>
> But if I look higher in the makefile:
>
> COPY = cp -f
> COPY_FILE = $(COPY)
> INSTALL_FILE = $(COPY_FILE)
>
> So the file is copied, including the permissions.
>
> I tried to find some elegant way to add rule to set permissions on
> installed files.
>
> There is something like
> unix:(name_of_target).extra = ...
>
> BUT the extra section is launched before the instalation of that
> target, while the files need to be chmodded after they are installed.
Undocumented, but qmake uses QMAKE_<makevariable> to identify the
programs used for COPY, COPY_FILE and INSTALL_FILE/INSTALL_DIR. So
setting QMAKE_INSTALL_FILE/DIR should work properly (the same is used by
the Qt4 buildsystem).
I don't know wether this works for Qt3 too, didn't check its sources ;)
For more undocumented features see:
http://wiki.qtcentre.org/index.php?title=Undocumented_qmake
> Also, is there some easy option to telling apart if qmake for Qt3 or
> Qt4 was invoked in the project (.pro) file?
>
> Something like:
>
> if (qt3) {
> ... somestuff
> }
>
> if (qt4) {
> ... anotherstuff, like plugging in q3support ....
> }
Well, qt3support goes into the QT variable. Qt3 qmake doesn't know that
variable and thus treats it as a user-specified variable - ignoring it
unless its used somewhere else.
Other than that you might want to use QMAKE_VERSION which is set to 1.0x
or 2.0x (also from the website above)
Andreas
--
[ signature omitted ]
Message 3 in thread
Andreas Pakulat <apaku@xxxxxx> wrote on 02/16/2007 09:40:31 AM:
# Undocumented, but qmake uses QMAKE_<makevariable> to identify the
# programs used for COPY, COPY_FILE and INSTALL_FILE/INSTALL_DIR. So
# setting QMAKE_INSTALL_FILE/DIR should work properly (the same is used by
# the Qt4 buildsystem).
#
# I don't know wether this works for Qt3 too, didn't check its sources ;)
#
# For more undocumented features see:
# http://wiki.qtcentre.org/index.php?title=Undocumented_qmake
Huh, I didn't think to put stuff like that in there but that's a good
point.
Actually, I'll extend that to a little bit more general of a statement:
if you're trying to figure out how to change the bits of stuff that get
output into your makefile, especially if they're the contents of a
makefile variable, there's a decent chance that they appear in a qmake
variable - and you should check the makespec for your platform as a
reference.
I'll get that tip added to the wiki.
--
[ signature omitted ]