Results 1 to 5 of 5

Thread: Copy built files to new location from a Qt Project file

  1. #1
    Join Date
    Aug 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default 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
    Qt Code:
    1. QMAKE_POST_LINK=cp /Projects/TestFile.txt /Projects/OSPF/TestFile.txt
    To copy to clipboard, switch view to plain text mode 
    I get
    cp: cannot stat `/Projects/TestFile.txt': No such file or directory


    if I try (add '\' in middle):
    Qt Code:
    1. QMAKE_POST_LINK=cp /Projects/TestFile.txt\ /Projects/OSPF/TestFile.txt
    To copy to clipboard, switch view to plain text mode 
    I get
    cp: missing destination file operand after `/Projects/TestFile.txt /Projects/OSPF/TestFile.txt'

    Does anyone know what I might be doing wrong?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    99
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default 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

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Copy built files to new location from a Qt Project file

    I use this:
    qmake Code:
    1. dlltarget.path = $$[QT_INSTALL_BINS]
    2. target.path = $$[QT_INSTALL_LIBS]
    3. INSTALLS += target dlltarget
    To copy to clipboard, switch view to plain text mode 

    Then a simple "make install" does the trick. Of course adjust the paths to your liking.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Aug 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default 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:
    qmake Code:
    1. QMAKE_POST_LINK=cmd.exe /C copy \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
    To copy to clipboard, switch view to plain text mode 
    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.
    Last edited by wysota; 18th December 2010 at 08:09.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Copy built files to new location from a Qt Project file

    Quote Originally Posted by gmat4321 View Post
    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.
    Last edited by wysota; 18th December 2010 at 08:34.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 11th May 2010, 04:50
  2. Replies: 3
    Last Post: 6th April 2010, 20:32
  3. Replies: 4
    Last Post: 11th March 2010, 13:52
  4. Replies: 1
    Last Post: 3rd December 2009, 23:34
  5. visual studio project files - adding extra files
    By luf in forum Qt Programming
    Replies: 3
    Last Post: 13th June 2008, 21:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.