PDA

View Full Version : QMake problem when using INSTALL and a shadow build directory



superpacko
6th September 2011, 15:43
Here's my problem,
Im using INSTALL to copy some dlls and resources such as config files that the final executable need to run. So for example i have something like:

someDll.path = ../dist/bin/
someDll.files = ../thirdParty/*.dll

INSTALLS += someDll

This works perfectly when building in the same directory, but if i use a shadow build then the install doesnt work properly. The thing is that eventhough i used relative paths, when qmake builds the makefile it transforms the relative paths to the absolute path of the .pro file.
So since the shadow build is diferent but the paths where built from the .pro path, the install directory wont be inside the shadow build, but in the .pro path.

if i have this structure:

Project
|__Project.pro
|__module1

|__module1.pro
|__dist

|__bin


|__project.exe
|__thridParty

|__library.dll


shadowBuild
|__Makefile
|__module1

|__Makefile
|__dist

|__bin


|_project.exe


the install line in the Makefile created inthe shadow build will look like: -$(INSTALL_FILE) c:\Project\thirdParty\library.dll c:\Project\dist\..\bin\ --> as you can see the shadowBuild directory is not used!

The case is diferent with the variable DESTDIR, if you use a relative path there, qmake will keep it relative. Im not sure why is doing something diferent when Installing. Any ideas or workarounds? is there a way in the .pro to know which is the build directory ?


thanks a lot.