Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-21182

please add a writeToFile() and appendToFile() (maybe also deleteFile() ) functions to qmake

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • 5.0.0
    • 4.7.3
    • Build tools: qmake
    • None
    • Win32 (MinGW+MSys), MacOSX (64-bit), Linux

    • 84614cabfaaab5eb4be04688a84cef8d79493f75

    Description

      I'm using qmake for a larger project and tried to implement an autoversioning script (see attatchment) that tries to read the current date and the current SVN or git version and outputs both into two separate .h files. In principle it works, but sometimes I have problems with the different commands on different platforms:

      • I succeeded in having a special rule for windows date command, but I sometimes have problems with {{system(echo $$LITERAL_HASH define BLA \"$$VARIABLE_NAME\" > file.h) }} some systems (MacOS) seem to need apostrophes (like here: {{system(echo '$$LITERAL_HASH define BLA \"$$VARIABLE_NAME\"' > file.h) }} ) ... others (like Win32+MinGW, depending on whether Windows or MinGW/Msys echo is called) sometimes don't ...

      so it would be nice to have functions
      writeToFile(filename, data)
      appendToFile(filename, data)

      ... maybe also
      replaceInFile(filename, substr, data)

      in qmake, so I don't have to write this simple functionality using echo ... which is really a mess, if you want it to work on different systems.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            buddenha Oswald Buddenhagen
            jkriege2 Jan Krieger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes