In a Qt5 C++ project the .pro have the following
DATE = $$system(echo %DATE%)
...
DEFINES += DATETIME_VERSION=\"$${DATETIME}\"
It get the date, does some formatting and defines a variable that is read in C++ later.
That works fine on Windows. But not on macOS.
I do that because I don't know a qmake function that returns the date.
So to get date on macOS I think I can go around using date
command. But I will have to customize the output to make it similar to what I'm getting on Windows. That's too much work.
I'm wondering if is possible to call a python scrip from qmake? So maybe it will be possible to have the same python scrip being used on Windows/macOS.
Or, is there a smarter way to solve this problem?
References:
How to print a date in a regular format?
https://doc.qt.io/archives/qt-4.8/qmake-function-reference.html#system-command