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. qmake math operation (increment)
QtWS25 Last Chance

qmake math operation (increment)

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

    Hello,

    I am trying to to add build increment mechanism within .pro file.

    To do so I have created a file named "version" with this content "1.1.15" (MAJOR_VERSION.MINOR_VERSION.BUILD_NUMBER)

    Please find here my .pro content

    MY_VERSION = "$$cat(version)"
    
    VERSIONS = $$split(MY_VERSION, ".")
    
    VERSION_MAJ = $$member(VERSIONS, 0)
    VERSION_MIN = $$member(VERSIONS, 1)
    VERSION_BUILD = $$member(VERSIONS, 2)
    
    # VERSION_BUILD++ ??? HOW TO ???
    
    VERSIONS = $$VERSION_MAJ $$VERSION_MIN $$VERSION_BUILD
    MY_VERSION = $$join(VERSIONS, ".")
    
    write_file(version, MY_VERSION)
    

    Could someone help me on this ?

    T 1 Reply Last reply
    0
    • T tarekb

      Hello,

      I am trying to to add build increment mechanism within .pro file.

      To do so I have created a file named "version" with this content "1.1.15" (MAJOR_VERSION.MINOR_VERSION.BUILD_NUMBER)

      Please find here my .pro content

      MY_VERSION = "$$cat(version)"
      
      VERSIONS = $$split(MY_VERSION, ".")
      
      VERSION_MAJ = $$member(VERSIONS, 0)
      VERSION_MIN = $$member(VERSIONS, 1)
      VERSION_BUILD = $$member(VERSIONS, 2)
      
      # VERSION_BUILD++ ??? HOW TO ???
      
      VERSIONS = $$VERSION_MAJ $$VERSION_MIN $$VERSION_BUILD
      MY_VERSION = $$join(VERSIONS, ".")
      
      write_file(version, MY_VERSION)
      

      Could someone help me on this ?

      T Offline
      T Offline
      tarekb
      wrote on last edited by
      #2

      @tarekb could be a possible solution

      win32 {
          VERSION_BUILD = $$system("set /a $$VERSION_BUILD + 1")
      } else:unix {
          VERSION_BUILD = $$system("echo $(($$VERSION_BUILD + 1))")
      }
      
      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