Is it possible to include C/C++ header files in a qmake (.pro) file?
I have a version.h header file with several definitions for my project (strings, version numbers, etc.). I also have an .rc file for Windows to add version info to my exe/dll, which includes this header file.
So, can I somehow get the #defines in my header file to be processed in my .pro file, or what other way could I use to define strings and other constants in one file and have them accessible from my C++ code, the .rc file and the .pro file by including that file?
You can use the DEFINES variable in the .pro file. The following works with gcc and clang.
The definitions are passed to the C/C++ compiler. I don’t know if the rc compiler also gets them, though.