Didn't work when I tried it.
If you are trying to write, for example, an include file containing defines for stuff only the build system knows then you could look at QMAKE_SUBSTITUTES paired with template files:
// test.hpp.in
#ifndef TEST_HPP
#define TEST_HPP
#include <QString>
#define MYAPPVERSION '"$$VERSION"'
#define MYSPECIALVAR '"$$MY_SPECIAL_VAR"'
#endif //TEST_HPP
// test.hpp.in
#ifndef TEST_HPP
#define TEST_HPP
#include <QString>
#define MYAPPVERSION '"$$VERSION"'
#define MYSPECIALVAR '"$$MY_SPECIAL_VAR"'
#endif //TEST_HPP
To copy to clipboard, switch view to plain text mode
# test.pro
...
MY_SPECIAL_VAR = stuff
QMAKE_SUBSTITUTES += test.hpp.in
...
# test.pro
...
MY_SPECIAL_VAR = stuff
QMAKE_SUBSTITUTES += test.hpp.in
...
To copy to clipboard, switch view to plain text mode
to get this file generated when qmake is run:
// test.hpp
#ifndef TEST_HPP
#define TEST_HPP
#include <QString>
#define MYAPPVERSION "1.0.0"
#define MYSPECIALVAR "stuff"
#endif //TEST_HPP
// test.hpp
#ifndef TEST_HPP
#define TEST_HPP
#include <QString>
#define MYAPPVERSION "1.0.0"
#define MYSPECIALVAR "stuff"
#endif //TEST_HPP
To copy to clipboard, switch view to plain text mode
Bookmarks