Details
-
Suggestion
-
Resolution: Done
-
Not Evaluated
-
4.7.3
-
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.