Results 1 to 5 of 5

Thread: QMake to Build Help Files

  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

    Question QMake to Build Help Files

    Hi All,

    I cannot seem to find any mention of having qmake build compiled help files from a help project and source. Are these rules in qmake's repertoire and how can I use them?

    Cheers,
    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 to Build Help Files

    There are no predefined rules for this, you have to provide them yourself.
    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
    Sep 2009
    Posts
    57
    Thanks
    7
    Thanked 5 Times in 4 Posts

    Default Re: QMake to Build Help Files

    Of course, the question is HOW do you do this?

    A .pro file can only have a single target, so I've created a subdir with my .qhp files. But the .pro file can only build apps, libs and subdirs. Here is my help.pro file.. what is needed to make it generate a target qch rather than assuming it is building a binary?

    TARGET = GoldenCheetah.qch

    qhelpgenerator.output = help.qch
    qhelpgenerator.input = help.qhp
    qhelpgenerator.commands = ghelpgenerator help.qhp
    qhelpgenerator.CONFIG = no_link
    QMAKE_EXTRA_COMPILERS += qhelpgenerator

  4. #4
    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 to Build Help Files

    Quote Originally Posted by liversedge View Post
    A .pro file can only have a single target
    That's not true. One pro file can define an arbitrary number of targets but only one is considered the "main" target (i.e. the one that is executed when you call make without parameters). Have a look at the docs for QMAKE_EXTRA_TARGETS variable.
    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.


  5. #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 to Build Help Files

    Two variations that do the job:
    Qt Code:
    1. # the main target
    2. TEMPLATE = app
    3. SOURCES += ...
    4. HEADERS += ...
    5.  
    6. # The help
    7. # Using a "custom compiler"
    8. QHP_FILES += help1.qhp help2.qhp
    9.  
    10. qhp_qhc.input = QHP_FILES
    11. qhp_qhc.output = ${QMAKE_FILE_BASE}.qch
    12. qhp_qhc.commands = qhelpgenerator ${QMAKE_FILE_NAME}
    13. qhp_qhc.CONFIG = no_link target_predeps
    14. QMAKE_EXTRA_COMPILERS += qhp_qhc
    15.  
    16. # Or for a single file using a custom target
    17. myhelp.target = test3.qhc
    18. myhelp.depends = test3.qhp
    19. myhelp.commands = qhelpgenerator $$myhelp.depends
    20. QMAKE_EXTRA_TARGETS += myhelp
    21. PRE_TARGETDEPS += test3.qhc
    To copy to clipboard, switch view to plain text mode 
    Utimately they amount to much the same sort of thing. The first is more flexible with multiple help files to generate.

  6. The following user says thank you to ChrisW67 for this useful post:

    liversedge (1st August 2011)

Similar Threads

  1. Eclipse, Moc Files, Custom Build Steps
    By gmat4321 in forum Qt Programming
    Replies: 4
    Last Post: 6th August 2010, 05:25
  2. Replies: 12
    Last Post: 7th July 2009, 17:32
  3. How to generate .lib files during a build?
    By QTInfinity in forum Installation and Deployment
    Replies: 2
    Last Post: 3rd October 2008, 18:56
  4. Mac: Copy Files Build Phase and qmake...
    By kuwan in forum Qt Programming
    Replies: 4
    Last Post: 25th September 2007, 20:59
  5. qmake to build both 32-bit and 64-bit
    By lni in forum Qt Programming
    Replies: 8
    Last Post: 12th December 2006, 19:35

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.