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 script only in Release mode
Forum Updated to NodeBB v4.3 + New Features

Run script only in Release mode

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 2 Posters 437 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.
  • G Offline
    G Offline
    GeraldBrandt
    wrote on last edited by
    #1

    Hi,

    I have Qt Creator run a script every time I do a build (for versioning). I'd like that script to only run for release builds. Is there a way I can do that?

    I currently have:

    versionTarget.target = src/include/version.h
    versionTarget.depends = FORCE
    versionTarget.commands = cd ..; pwd ; echo update version ... ; ./rev.sh ; touch src/include/version.h
    PRE_TARGETDEPS += src/include/version.h
    QMAKE_EXTRA_TARGETS += versionTarget
    

    in my .pro file.

    Thanks,
    Gerald

    J.HilkJ 1 Reply Last reply
    0
    • G GeraldBrandt

      Hi,

      I have Qt Creator run a script every time I do a build (for versioning). I'd like that script to only run for release builds. Is there a way I can do that?

      I currently have:

      versionTarget.target = src/include/version.h
      versionTarget.depends = FORCE
      versionTarget.commands = cd ..; pwd ; echo update version ... ; ./rev.sh ; touch src/include/version.h
      PRE_TARGETDEPS += src/include/version.h
      QMAKE_EXTRA_TARGETS += versionTarget
      

      in my .pro file.

      Thanks,
      Gerald

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hey, @GeraldBrandt

      this should work

      CONFIG(release, debug|release){
      versionTarget.target = src/include/version.h
      versionTarget.depends = FORCE
      versionTarget.commands = cd ..; pwd ; echo update version ... ; ./rev.sh ; touch src/include/version.h
      PRE_TARGETDEPS += src/include/version.h
      QMAKE_EXTRA_TARGETS += versionTarget
      }
      

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      G 1 Reply Last reply
      1
      • J.HilkJ J.Hilk

        hey, @GeraldBrandt

        this should work

        CONFIG(release, debug|release){
        versionTarget.target = src/include/version.h
        versionTarget.depends = FORCE
        versionTarget.commands = cd ..; pwd ; echo update version ... ; ./rev.sh ; touch src/include/version.h
        PRE_TARGETDEPS += src/include/version.h
        QMAKE_EXTRA_TARGETS += versionTarget
        }
        
        G Offline
        G Offline
        GeraldBrandt
        wrote on last edited by
        #3

        @J-Hilk Thanks for the quick response, I'll try it! While I'm on the topic, how about running the script in Release mode and under Linux only?

        Is there a document I'm missing that covers this?

        Gerald

        J.HilkJ 1 Reply Last reply
        0
        • G GeraldBrandt

          @J-Hilk Thanks for the quick response, I'll try it! While I'm on the topic, how about running the script in Release mode and under Linux only?

          Is there a document I'm missing that covers this?

          Gerald

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by J.Hilk
          #4

          @GeraldBrandt
          take a look at the documentation section scopes and conditions

          I believe for Linux the identifier is unix


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          1

          • Login

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