Copy built files to new location from a Qt Project file
I'm using a series of Qt Project files to build libraries on Windows, Mac and Linux platforms. Per platform I'd like to copy all the built library files into one location after they are built.
Using QMAKE_POST_LINK in the Project file seems to be the best way to do this. To keep things simple I wanted to use the same command on all platforms. I installed Cygwin on my Windows computer and tried to use 'cp' but I can't get it to work. I've tried it several ways.
If I try
Code:
QMAKE_POST_LINK=cp /Projects/TestFile.txt /Projects/OSPF/TestFile.txt
I get
cp: cannot stat `/Projects/TestFile.txt': No such file or directory
if I try (add '\' in middle):
Code:
QMAKE_POST_LINK=cp /Projects/TestFile.txt\ /Projects/OSPF/TestFile.txt
I get
cp: missing destination file operand after `/Projects/TestFile.txt /Projects/OSPF/TestFile.txt'
Does anyone know what I might be doing wrong?
Re: Copy built files to new location from a Qt Project file
You need to tell windows on what spot you want it :
Use eg. C:\map\file.txt or ..\map\file.txt
Try using backslashes everywhere also.
Everall
Re: Copy built files to new location from a Qt Project file
I use this:
Code:
dlltarget.path = $$[QT_INSTALL_BINS]
target.path = $$[QT_INSTALL_LIBS]
INSTALLS += target dlltarget
Then a simple "make install" does the trick. Of course adjust the paths to your liking.
Re: Copy built files to new location from a Qt Project file
Everall:
backslahes won't work with cygwin's 'cp'
wysota:
I not sure I can call 'make install'. I'm running from Qt Creator do a large build via SUBDIR and I'll need to move files around to automate testing.
Does anyone know the correct Windows/DOS command I can use with QMAKE_POST_LINK? I tried:
Code:
QMAKE_POST_LINK=cmd.exe /C copy \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
and I get:
The system cannot find the file specified
What seems simple is turning out to be diffcuilt because the commands appear to be interpreted and not passed on directly.
Re: Copy built files to new location from a Qt Project file
Quote:
Originally Posted by
gmat4321
I not sure I can call 'make install'. I'm running from Qt Creator do a large build via SUBDIR and I'll need to move files around to automate testing.
Sure you can. At least with recent versions of Creator. I think you can even invoke it automatically from qmake after building the project using QMAKE_POST_LINK but I'm not sure of that.