[CMake] Add a flag to the resource compiler.

Wilco Schillemans w.schillemans at erasmusmc.nl
Mon Jun 11 12:07:10 EDT 2007


Hello,

I am trying to port some of our projects to cmake.

In these projects we have windows resource files *.rc with #ifdef _DEBUG 
lines in it.

For example:

#ifdef _DEBUG
  FILEFLAGS 0x00000001L
#else
  FILEFLAGS 0x0L
#endif

We also use this flag to make sure the word DEBUG appears in some of the 
version flags that are visible in the file properties dialogue in windows.

But how do I add the _DEBUG flag to the resource compiler in CMAKE?

I have tried to use :

ENABLE_LANGUAGE(RC)
SET(CMAKE_COMPILE_RESOURCE "rc /d _DEBUG <FLAGS> /fo<OBJECT> <SOURCE>")

But this does not seem to have any effect at all.

If I use SET(CMAKE_COMPILE_RESOURCE "nonsense") I expect an error in 
Visuals Studio when building the project, but this is not the case. This 
SET is ignored and the usual "rc.exe ..." is used.

Defines that are added using ADD_DEFINITIONS() and includes paths set 
with INCLUDE_DIRECTORIES() are added to the resource compiler call. Why 
is this? These are C/C++ includes and definitions.

Can someone help me? (I am using Visual Studio 2005 Express Edition.)

Kind regards,

Wilco

-- 
Wilco Schillemans
Erasmus MC - Daniel den Hoed Cancer Center
Department of Radiation Oncology
Groene Hilledijk 301
3075 EA Rotterdam
The Netherlands





More information about the CMake mailing list