Results 1 to 2 of 2

Thread: How to specify qmake-generated target in a platform independent way

  1. #1
    Join Date
    Aug 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How to specify qmake-generated target in a platform independent way

    qmake's TARGET variable is used to specify base name of the generated target. But the final filename is composed by qmake depending on the host OS rules.

    Regarding

    Qt Code:
    1. TEMPLATE = lib
    2. TARGET = test
    To copy to clipboard, switch view to plain text mode 
    it turns out to be test.dll and libtest.so for Windows and Linux respectively.

    When setting up installation rules, I'd like to refer the target by its final filename rather then messing up the configuration with platform prefixes like win32 or unix.

    Qt Code:
    1. target.path = $$DEPLOY_DIR
    2. target.files = <target filename here>
    3. INSTALLS += target
    To copy to clipboard, switch view to plain text mode 
    There's the same named TARGET variable in generated Makefile, but it is impossible to use it directly in target.files.

  2. #2
    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: How to specify qmake-generated target in a platform independent way

    With TARGET you don't need to set target.files -- it will be filled by qmake automatically.
    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. default target in generated makefiles
    By iefremov in forum Installation and Deployment
    Replies: 1
    Last Post: 24th December 2010, 10:57
  2. Replies: 3
    Last Post: 18th January 2010, 10:35
  3. Platform independent GUI
    By bnilsson in forum Qt Programming
    Replies: 39
    Last Post: 28th November 2009, 11:00
  4. Replies: 3
    Last Post: 16th June 2009, 08:04
  5. Replies: 3
    Last Post: 4th February 2008, 19:28

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.