Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] How to append version to target [Win XP - Qt5.0.2]
Forum Updated to NodeBB v4.3 + New Features

[Solved] How to append version to target [Win XP - Qt5.0.2]

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.1k Views 1 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.
  • M Offline
    M Offline
    Max13
    wrote on last edited by
    #1

    Hello !

    I'm trying to append the version number of my app, in the target filename. I tried "this":http://qt-project.org/faq/answer/how_can_i_add_version_information_to_my_application but it's not showing.

    Here is an extract:

    @VER_MAJ = 0
    VER_MIN = 2
    VER_BLD = $$cat(BUILD, lines)
    VERSION = $${VER_MAJ}.$${VER_MIN}.$${VER_BLD}
    message($$VERSION)

    TARGET = PMF-Desktop
    TEMPLATE = app@

    The thing is: When I message, the version is ok, but the filename is still "PMF_Desktop.exe". I tried to append it to the "TARGET" variable, or put it in "TARGET_x.y.z =" which BTW I don't understand (messaging it shows empty line). When I append it to "TARGET", it's OK but QtCreator can't start my app (shows something like: permission denied or file doesn't exist).

    Any idea of how to do it (maybe the way changed with Qt5) and how to use "TARGET_x.y.z" ?
    Thank you.

    We all have started by asking questions. Then after some time, we can begin answering them.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      i'm not sure if it works but try using MODULE_VERSION instead of VERSION.
      p.s. dont forget to rerun qmake ;)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Max13
        wrote on last edited by
        #3

        [quote author="raven-worx" date="1371555920"]try using MODULE_VERSION instead of VERSION.[/quote]
        Where did you get that variable ?
        It's not even in the "variable reference":http://qt-project.org/doc/qt-5.0/qtdoc/qmake-variable-reference.html :p

        I've just tried it, nothing changed. Thank you anyway.

        We all have started by asking questions. Then after some time, we can begin answering them.

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          [quote author="Max13" date="1371560274"]
          Where did you get that variable ?
          It's not even in the "variable reference":http://qt-project.org/doc/qt-5.0/qtdoc/qmake-variable-reference.html :p[/quote]
          from the Qt sources.

          But you could do this?
          @
          TARGET = PMF-Desktop$${VER_MAJ}
          @
          or do you want the full version in the target name?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Max13
            wrote on last edited by
            #5

            @TARGET = PMF-Desktop_$${VERSION}@
            Actually, this is working, but I have a "$$system()" above which get the build number from a file and increment it.

            I don't know why, but when I message() in the .pro file, it's shown 3 times (which created the bug above, about permissions), so the variable is incremented 3 times (I have a subdir project) and the generated file isn't the same as the one QtCreator wants to start.
            ANyway, it's not the same issue, so I can consider this one done =P

            We all have started by asking questions. Then after some time, we can begin answering them.

            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