Results 1 to 2 of 2

Thread: Multiple Targets with QMAKE

  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    131
    Thanks
    11
    Thanked 16 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Multiple Targets with QMAKE

    We've to use a small lib in our GUI written in C. I've integrated the lib with the following pro

    Qt Code:
    1. DEPENDPATH += .
    2. INCLUDEPATH += .
    3.  
    4. DEFINES += __i386__
    5. unix:DEFINES += _LINUX
    6. window:DEFINES += _WIN32
    7.  
    8. HEADERS += rttTmsCommLib.h
    9. SOURCES += rttTmsCommLib.c
    10.  
    11. TARGET = rttTmsComm
    12. unix:TEMPLATE = lib
    13. windows:TEMPLATE =vclib
    14. CONFIG += staticlib
    15.  
    16.  
    17. asts-tms-tp-monitor {
    18. TARGET = asts-tms-tp-monitor
    19. unix:TEMPLATE = app
    20. win32:TEMPLATE = vcapp
    21. CONFIG -= staticlib
    22. CONFIG += static
    23. HEADERS += asts-tms-tp-monitor.h
    24. SOURCES += asts-tms-tp-monitor.c
    25. }
    26.  
    27. tmsdemoclient {
    28. TARGET = tmsdemoclient
    29. unix:TEMPLATE = app
    30. win32:TEMPLATE = vcapp
    31. CONFIG -= staticlib
    32. CONFIG += static
    33. SOURCES += tmsdemoclient.c
    34. }
    To copy to clipboard, switch view to plain text mode 

    the file is invoced with SUBDIRS and works really nice under Windows and Linux. I can also use

    Qt Code:
    1. qmake -config asts-tms-tp-monitor
    2. qmake -config tmsdemoclient
    To copy to clipboard, switch view to plain text mode 

    to build the democlient and the monitor. But now I want that the 2 additional targets are also build when the lib is build (like make all -> rttTmsCommLib asts-tms-tp-monitor tmsdemoclient) and I don't know how to archieve this

  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: Multiple Targets with QMAKE

    The easiest way is to set things up as yet another SUBDIRS target. Note that the different .pro files don't have to be placed in separate directories.
    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.


  3. The following user says thank you to wysota for this useful post:

    nightghost (9th June 2009)

Similar Threads

  1. [MinGW] Multiple calls to qmake
    By Potch in forum Installation and Deployment
    Replies: 2
    Last Post: 21st December 2013, 07:30
  2. qmake sux a lot
    By singermornings in forum Qt Programming
    Replies: 6
    Last Post: 29th January 2009, 08:33
  3. qmake multiple INCLUDEPATH in Linux
    By rajeshs in forum Qt Programming
    Replies: 12
    Last Post: 15th November 2007, 10:38
  4. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  5. Using qmake to build multiple apps and libs
    By marchand in forum Newbie
    Replies: 2
    Last Post: 12th June 2006, 17:33

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.