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. can i specify a pre_build step in my .pro file?

can i specify a pre_build step in my .pro file?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
19 Posts 6 Posters 6.0k Views
  • 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.
  • K Offline
    K Offline
    kenchan
    wrote on last edited by kenchan
    #9

    so, which is your favourite tool to work with that can do this kind of thing for you then?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #10

      i don't understand what you're getting at by asking this question?

      to be clear, i'm asking "can this be done?"

      the answer is "yes" or "no", right?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kenchan
        wrote on last edited by
        #11

        i am just asking you what tool you prefer to use or have used that can do what you want. I am just thinking that you are finding the Qt Creator pro file combination laking in that respect Hence your question to the forum.

        This is after all an open forum and any one can ask any kind of question they like. I thought I might learn from your experience of better tools for doing the kind of things you are describing.

        Excuse me for wasting your time!!

        1 Reply Last reply
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #12

          i had been using xcode, which already does the particular thing that i need (always does post-build steps regardless of whether a re-link is necessary), and MSDEV (which did not, causing me to need to delete the exe, by hand, every time)

          also i do not know that Qt Creator is lacking this feature, since no definitive answer has been given

          i did not intend to ruffle your feathers.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kenchan
            wrote on last edited by
            #13

            Thank you for your explanation. I hope someone on the forum will be able to help you with you question.
            good luck.

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #14

              Hi
              We use $$system to run scripts that does some tasks.

              doc sample:
              UNAME = $$system(uname -s)
              contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me )

              1 Reply Last reply
              0
              • D Offline
                D Offline
                davecotter
                wrote on last edited by
                #15

                but when does that get run? any time the .pro is parsed? mine gets parsed THREE times when i "run qmake", and does NOT get parsed before running

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  patrik08
                  wrote on last edited by JKSH
                  #16

                  Have a look by
                  [EDIT: Irrelevant link removed --JKSH]
                  code ...
                  before the big build Framework start... is a submodule dir that compile bevore all... only question from pro e pri file and comand....

                  or CMakeFile.txt... can do all in build order...

                  1 Reply Last reply
                  -1
                  • D Offline
                    D Offline
                    davecotter
                    wrote on last edited by
                    #17

                    i'm not looking for a hack, i'm looking for official support.
                    i'm guessing at this point the answer is "no"

                    1 Reply Last reply
                    0
                    • aha_1980A Offline
                      aha_1980A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on last edited by
                      #18

                      I have not tested myself, but see https://wiki.qt.io/Undocumented_QMake:

                      "And finally an example on how to call a batch file called "PreBuildEvent.bat" each time you compile your code (tested in VisualStudio, based on qt-creator-enterprise-src-3.1.0\share\qtcreator\static.pro):"

                      PRE_BUILD_FILE = ../Applications/PreBuildEvents.bat
                      # must use a variable as input
                      PHONY_DEPS = .
                      PreBuildEvent.input = PHONY_DEPS
                      # use non-existing file here to execute every time
                      PreBuildEvent.output = phony.txt
                      # the system call to the batch file
                      PreBuildEvent.commands = call $$PRE_BUILD_FILE
                      # some name that displays during execution
                      PreBuildEvent.name = running Pre-Build steps...
                      # "no_link" tells qmake we don’t need to add the output to the object files for linking, and "no_clean" means there is no clean step for them.
                      # "target_predeps" tells qmake that the output of this needs to exist before we can do the rest of our compilation.
                      PreBuildEvent.CONFIG += no_link no_clean target_predeps
                      # Add the compiler to the list of 'extra compilers'.
                      QMAKE_EXTRA_COMPILERS += PreBuildEvent
                      

                      Qt has to stay free or it will die.

                      1 Reply Last reply
                      2
                      • aha_1980A Offline
                        aha_1980A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on last edited by
                        #19

                        (Of course that is no official solution, but most likely will work nicely)

                        Qt has to stay free or it will die.

                        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