Results 1 to 5 of 5

Thread: Qmake Extra Targets

  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Qmake Extra Targets

    Hi All,

    I wanted to roll building my Assistant-based help into the general qmake build process so I thought I'd just shoehorn it into the pro file. I looked at the usually very clear docs and found them somewhat lacking. Nothing I did seem to generate an extra target. This is the session where I created a basic empty project and pasted the example from the docs:
    Qt Code:
    1. chrisw@newton ~/workspace/zzbug $ cat test.pro
    2. TARGET = test
    3. TEMPLATE = app
    4. CONFIG += qt warn_on
    5. SOURCES += main.cpp
    6.  
    7. mytarget.target = .buildfile
    8. mytarget.commands = touch $$mytarget.target
    9. mytarget.depends = mytarget2
    10.  
    11. mytarget2.commands = @echo Building $$mytarget.target
    12.  
    13. QMAKE_EXTRA_TARGETS += mytarget mytarget2
    14.  
    15. chrisw@newton ~/workspace/zzbug $ qmake test.pro
    16.  
    17. chrisw@newton ~/workspace/zzbug $ make mytarget2
    18. Building .buildfile
    19.  
    20. chrisw@newton ~/workspace/zzbug $ make mytarget
    21. make: *** No rule to make target `mytarget'. Stop.
    22.  
    23. chrisw@newton ~/workspace/zzbug $
    To copy to clipboard, switch view to plain text mode 
    Nothing I do generates a target "mytarget" in the Makefile although "mytarget2" does get inserted. What obvious step am I missing?

    The example is on Linux/Qt 4.5.2 but I get the same (non-) result on Windows(2009.3 SDK).

    Chris

  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: Qmake Extra Targets

    Run qmake with "-d" parameter and see what comes out.
    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. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qmake Extra Targets

    Yikes... what exactly am I supposed to look for? Here are the bits surrounding mentions of the extra targets:
    Qt Code:
    1. DEBUG 1: Project file: reading /home/chrisw/workspace/zzbug/test.pro
    2. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:4 :TARGET: :=: (test)
    3. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:5 :TEMPLATE: :=: (app)
    4. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:6 :CONFIG: :+=: (qt warn_on)
    5. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:7 :SOURCES: :+=: (main.cpp)
    6. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:9 :mytarget.target: :=: (.buildfile)
    7. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:10 :mytarget.commands: :=: (touch .buildfile)
    8. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:11 :mytarget.depends: :=: (mytarget2)
    9. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:13 :mytarget2.commands: :=: (@echo Building .buildfile)
    10. DEBUG 1: Project Parser: /home/chrisw/workspace/zzbug/test.pro:15 :QMAKE_EXTRA_TARGETS: :+=: (mytarget mytarget2)
    11. DEBUG 1: Processing default_post: lex::yacc::warn_on::debug::uic::resources::qt::warn_on::release::incremental::link_prl::no_mocdepend::release::stl::qt_no_framework::qt::warn_on
    12. DEBUG 1: Project Parser: load'ing file /usr/share/qt4/mkspecs/features/default_post.prf.
    13. DEBUG 1: Running project test: CONFIG(debug::debug|release) [10]
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. DEBUG 1: QMAKE_EXTENSION_SHLIB === so
    2. DEBUG 1: QMAKE_EXTRA_COMPILERS === moc_header :: rcc :: image_collection :: moc_source :: uic :: yacc_decl :: yacc_impl :: lex
    3. DEBUG 1: QMAKE_EXTRA_TARGETS === mytarget :: mytarget2 :: mocclean :: mocables
    4. DEBUG 1: QMAKE_EXT_C === .c
    5. DEBUG 1: QMAKE_EXT_CPP === .cpp :: .cc :: .cxx :: .C
    6. DEBUG 1: QMAKE_EXT_CPP_MOC === .moc
    7. DEBUG 1: QMAKE_EXT_H === .h :: .hpp :: .hh :: .hxx :: .H
    To copy to clipboard, switch view to plain text mode 

    I cannot see any obvious error messages. The complete output is attached (gzipped).
    Attached Files Attached Files

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Qmake Extra Targets

    You renamed the target as ".buildfile". So try invoking "make .buildfile".
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    ChrisW67 (8th September 2009)

  6. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qmake Extra Targets

    D'oh! It was always going to be something dumb!

Similar Threads

  1. QMake, partitioning, and duplicate targets
    By dhjdhj in forum Qt Tools
    Replies: 3
    Last Post: 3rd August 2009, 20:28
  2. Multiple Targets with QMAKE
    By nightghost in forum Qt Tools
    Replies: 1
    Last Post: 7th June 2009, 10:11
  3. Replies: 0
    Last Post: 26th April 2009, 18:55
  4. qmake sux a lot
    By singermornings in forum Qt Programming
    Replies: 6
    Last Post: 29th January 2009, 09:33
  5. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 06:57

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.