[CMake] Add a flag to the resource compiler.
Wilco Schillemans
w.schillemans at erasmusmc.nl
Tue Jun 12 05:40:33 EDT 2007
Hello,
I have written a small example project to illustrate the problem I am
having with changing the command line options for the resource compiler.
Somehow the SET(CMAKE_COMPILE_RESOURCE "this should cause a build
error") is not behaving the way I expect it to do.
Can someone spot the error?
I am using cmake 2.4 patch 6 and I build using Microsoft Visual Studio
2005 Express Edition.
Kind regards,
Wilco
CMakeLists.txt:
-----------------------------------------------------------------------------
PROJECT(resource_test)
ENABLE_LANGUAGE(RC)
SET(CMAKE_COMPILE_RESOURCE "this should cause a build error")
SET(SOURCES test.cpp)
IF(WIN32)
SET(SOURCES ${SOURCES} test.rc)
ENDIF(WIN32)
ADD_EXECUTABLE(test ${SOURCES})
-----------------------------------------------------------------------------
test.cpp:
#include <iostream>
-----------------------------------------------------------------------------
int main(int argc, char* argv[])
{
std::cout << "test" << std::endl;
return 0;
}
-----------------------------------------------------------------------------
and test.rc
-----------------------------------------------------------------------------
#define LANG_ENGLISH 0x09
#define SUBLANG_ENGLISH_UK 0x02
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#define VOS_NT_WINDOWS32 0x00040004L
#define VFT_APP 0x00000001L
#define VS_FF_DEBUG 0x00000001L
// Version Information
1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "CompanyName", "test company"
VALUE "FileDescription", "test application"
VALUE "FileVersion", "1.0.0.0"
VALUE "InternalName", "test.exe\0"
VALUE "LegalCopyright", "copyright"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "test.exe\0"
VALUE "ProductName", "test\0"
VALUE "ProductVersion", "1.0.0.0"
#ifdef _DEBUG
VALUE "Comments", "debug"
#else
VALUE "Comments", "release"
#endif
}
}
}
-----------------------------------------------------------------------------
--
Wilco Schillemans
Erasmus MC - Daniel den Hoed Cancer Center
Department of Radiation Oncology
Groene Hilledijk 301
3075 EA Rotterdam
The Netherlands
Tel: +31 10 439 12 60
Fax: +31 10 439 10 12
E-mail: w.schillemans at erasmusmc.nl
More information about the CMake
mailing list