Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Run a task before resources compilation in Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Run a task before resources compilation in Qt Creator

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 2 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • deleted57D Offline
    deleted57D Offline
    deleted57
    wrote on last edited by
    #1

    Hi all
    I need to run a task before resources compilation start (that is the first compilation starting). Create a new target and assign to PRE_TARGETDEPS and QMAKE_EXTRA_TARGETS doesn't work since RESOURCES compilation always start before, then execute my additoonal target task and after start normal sources compilation. I still din't find a way to have some task runned as first on compilation. Someone can help me?
    Thank you

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Not sure, but maybe hacking around it with a custom compiler could help: http://doc.qt.io/qt-5/qmake-advanced-usage.html#adding-compilers

      (Z(:^

      1 Reply Last reply
      0
      • deleted57D Offline
        deleted57D Offline
        deleted57
        wrote on last edited by deleted57
        #3

        Interesting approach but doesn't work. Just tested and RESOURCES compilation always start before all...

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          OK, another idea :-)

          Add 2 new .pro files, like so:

          main.pro
          before/before.pro
          yourCode/yourCode.pro
          

          Then in main put this:

          CONFIG += ordered
          TEMPLATE = subdirs
          SUBDIRS = before yourCode
          

          And in before.pro handle all things you have to execute before yourCode.pro kicks in. CONFIG+=ordered ensures that the .pro files will be executed in the same order they are specified.

          If that does not work, I'd say the only thing left is to create a shell script and run it manually before build (or maybe switch to cmake if it supports such use case).

          (Z(:^

          1 Reply Last reply
          1
          • deleted57D Offline
            deleted57D Offline
            deleted57
            wrote on last edited by
            #5

            At first thank you for your help sierdzio. ^_^

            Split project files in different part didn't like so much than, unfortunately, it seem the only way available is to execute manually my task before compilation phase as you suggested...

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved