How to add flags to RC.EXE through QMake .pro makefiles

Posted by Hernán on Stack Overflow See other posts from Stack Overflow or by Hernán
Published on 2010-05-01T05:11:31Z Indexed on 2010/05/01 5:17 UTC
Read the original article Hit count: 484

Filed under:
|
|
|

I've the following definition in my .pro file:

RC_FILE = app.rc

This RC file contains a global include at the top:

#include "version_info.h"

The version_info.h header is on a common header files directory.

Since RC.EXE takes INCLUDE environment variable in consideration, according to MS documentation, my build process batch sets up that accordingly:

SET INCLUDE=%PROJECTDIR%\version;%INCLUDE%
...
QMAKE project.pro -spec win32-msvc2008 -r CONFIG += release

This works perfect as RC seems to read that INCLUDE var so the "version_info.h" file is including on every RC file properly.

The problem is when I generate a VS solution (or Import it through the VS Addin). The RC invocation does not contain any /I flag (as I expect) but does not read any INCLUDE variable, even when I've setup through system 'environment variables' dialog in XP.

So I'm stuck with this problem, with two alternatives I could not get to work:

  • Make VS RC.exe invocation honour the INCLUDE variable (didn't work either as user or system variable).
  • Force QMAKE to pass /I flag to RC invocation, and get that /I flag imported into the project settings (Resource Compiler properties).

Thanks in advance.

© Stack Overflow or respective owner

Related posts about qmake

Related posts about rc