[Qt-interest] qmake issue: getting rid of INSTALL_ROOT for install target

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Wed Jun 23 15:49:05 CEST 2010


Hi All,

I've created a small test app which tries to simulate the issue of
qmake prepending the path upto where the last level pro file is while
generating the 'install' rule. There is no problem with the 'build'
path.

The build and install paths are exported by a top level Makefile
(written manually, since it's supposed to build other non-qt apps
too). Currently it's simply building the QT project "test" which
further has the lib project under it.

Initially I was exporting the build/install variables in the top-level
Makefile like this:

export BUILD_DIR_ROOT = $(PWD)/build
export INSTALL_DIR_ROOT = $(PWD)/install

I thought the $(PWD) might getting being passed as is to the last
level Makefile where it gets expanded when make executes it.

So I changed it to:

export BUILD_DIR_ROOT = $(shell pwd)/build
export INSTALL_DIR_ROOT = $(shell pwd)/install

So that the variables are populated with the pwd value _before_ they
get exported. But somehow the last level Makefile of lib still has the
install rule as such:

install_headers: first FORCE
    @$(CHK_DIR_EXISTS)
$(INSTALL_ROOT)/home/mandeep/work/install-issue/test/lib/$(INSTALL_DIR_ROOT)/testlib/include/
|| $(MKDIR) $(INSTALL_ROOT)/home/mandeep/work/install-issue/test/lib/$(INSTALL_DIR_ROOT)/testlib/include/

The problem is "/home/mandeep/work/install-issue/test/lib/" getting
prepended before the INSTALL_DIR_ROOT var exported by the top-level.
Why is this happening?

Can someone try it out on their system and let me know if the issue
exists there too or point out the problem with the make setup?
Thanks for your time.

This app will work on Linux (I'm running it on Ubuntu 10.04).

-mandeep

> I'll make a sample app to replicate this issue and post the src here.
> Lets see if its something specific to my setup alone.
>
> Thanks as always.
>
> Regards,
> -mandeep
>
>>
>>>
>>> Thanks,
>>> -mandeep
>>>
>>>
>>> On Tue, Jun 22, 2010 at 1:53 PM, Mandeep Sandhu
>>>
>>> <mandeepsandhu.chd at gmail.com> wrote:
>>> > Hi All,
>>> >
>>> > I have a simple .pro firle for my lib. Here's the relevant bit:
>>> >
>>> > mylib.pro
>>> > ========
>>> > include (common.pri)
>>> >
>>> > TARGET = mylib
>>> > ...
>>> > ...
>>> > INSTALLPATH     = $$INSTALLDIR/$$TARGET
>>> > target.path     = $$INSTALLPATH/lib
>>> > headers.path    = $$INSTALLPATH/include
>>> > headers.files   = <header file names>
>>> >
>>> > INSTALLS       += headers target
>>> >
>>> >
>>> > common.pri
>>> > ==========
>>> > ...
>>> > INSTALLDIR = /home/me/test/install
>>> >
>>> > This generates a makefile which has a install rule, which is causing
>>> > me problems. I'm posting a snippet of the header install target:
>>> >
>>> > install_headers: first FORCE
>>> >    @$(CHK_DIR_EXISTS)
>>> > $(INSTALL_ROOT)/home/me/test/mylib/src//home/me/test/install/include/
>>> >
>>> > || $(MKDIR)
>>> > || $(INSTALL_ROOT)/home/me/test/mylib/src//home/me/test/install/include/
>>> >
>>> > This causes make to install stuff in the src dir (where Makefile is)
>>> > and NOT under /home/me/test/install!!!
>>> >
>>> > Why does qmake prepend $(INSTALL_ROOT)/$(PWD) to the install target?
>>> > Is there a way to alter this behavior?
>>> >
>>> > Basically I would like to use absolute paths for specifying my build
>>> > and install dirs. If I use relative paths then it's not a problem, but
>>> > then I have to prepend "../" each time I go into a subdir (which looks
>>> > messy and error prone).
>>> >
>>> > Googling revealed a similar problem related long ago:
>>> > http://lists.trolltech.com/pipermail/qt-interest/2009-February/002009.htm
>>> > l (the associated issue reported -
>>> > http://bugreports.qt.nokia.com/browse/QTBUG-3650)
>>> >
>>> > What are the other alternatives for using absolute paths for install
>>> > directive using .pro file (other than altering the makefile with some
>>> > external script)?
>>> >
>>> > Any pointers will be appreciated.
>>> >
>>> > Thanks,
>>> > -mandeep
>>
>> --
>> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>>  Senior Product Manager - Nokia, Qt Development Frameworks
>>      PGP/GPG: 0x6EF45358; fingerprint:
>>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: install-issue.tar.gz
Type: application/x-gzip
Size: 989 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100623/9c802f30/attachment.gz 


More information about the Qt-interest-old mailing list