Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [SOLVED] Build Date - Mac OSX

    General and Desktop
    2
    4
    991
    Loading More Posts
    • 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
      maximus last edited by

      Hi,

      When I build my project, I set a variable so I get the current Date and Time (will be show in the "About my app" Dialog)

      On Windows, I use this:
      @#DEFINES += BUILDDATE=(DATE)
      #DEFINES += BUILDTIME=(TIME)@

      Works fine for Windows, but on MacOSX, i'd like to get the BuildDate and time also, but the code above is not working, is there any solution to do this on Mac also? Thanks!


      Free Indoor Cycling Software - https://maximumtrainer.com

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        DATE and TIME macros are defined in ISO C standard, they are supported by all compilers. It should work on Mac OS. However, I think you are trying to use them in the .pro file, right?

        An important thing is to remember that those macros are invoked at compilation time of a given file, not at linking time of the whole application. So if you are not doing a clean reabuild, you might end up with an older date.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • M
          maximus last edited by

          Hey sierdzio thanks for your reply,

          Yes I was trying to use them in the .pro file.
          On OS X it was weirdly giving error into another object "[Audio.h] Error 2" - at compile time when theses 2 lines are not commented.

          I'm also thinking just using a Global QString that I will update on major new version manually. that way it can have a uniform format, because (DATE) use the english date.
          i.e:
          BUILDATE = "20/09/2014"

          Thank you!


          Free Indoor Cycling Software - https://maximumtrainer.com

          1 Reply Last reply Reply Quote 0
          • M
            maximus last edited by

            Solved

            @//have to edit every new release
            const static QString date_released = "26/11/2014";@


            Free Indoor Cycling Software - https://maximumtrainer.com

            1 Reply Last reply Reply Quote 0
            • First post
              Last post