Hiho there,
I am trying to write a header file when qmake is executed and I can't make it write the characters "<" and ">".
More detailed, I would (simplified) like qmake to write following lines in a file called "test.hpp" for example!
As I am stuck at Qt4, I can't use the function "write_file", so my way would be to use "system()" instead, which works fine.
...
H = $$LITERAL_HASH
line01 = "$${H}ifndef TEST_HPP"
line02 = "$${H}define TEST_HPP"
line03 = "\n"
line04 = "$${H}include <QString>"
line05 = "\\n"
line06 = "$${H}endif //TEST_HPP"
...
system(echo $${line01} > test.hpp)
system(echo $${line02} >> test.hpp)
system(echo $${line03} >> test.hpp)
system(echo $${line04} >> test.hpp)
system(echo $${line05} >> test.hpp)
system(echo $${line06} >> test.hpp)
...
...
H = $$LITERAL_HASH
line01 = "$${H}ifndef TEST_HPP"
line02 = "$${H}define TEST_HPP"
line03 = "\n"
line04 = "$${H}include <QString>"
line05 = "\\n"
line06 = "$${H}endif //TEST_HPP"
...
system(echo $${line01} > test.hpp)
system(echo $${line02} >> test.hpp)
system(echo $${line03} >> test.hpp)
system(echo $${line04} >> test.hpp)
system(echo $${line05} >> test.hpp)
system(echo $${line06} >> test.hpp)
...
To copy to clipboard, switch view to plain text mode
As long as I include those two characters, the file is not containing "line04".
The other minor problem is that I can't also create the empty line, as in "line03" and "line05". Backslash and double backslash doesn't work here!
But I could live without that if the include would work properly!
So, if you know the way, please enlighten me too... And if you know a better way of creating that file, please feel free to point this out.
Thanks in advance!
freeman_w
Bookmarks