I want to add some version information to exe
when compile
.
On vs2008, I can do it through add->resource->version
steps.
But how can I do it through cmake
?
I want to add some version information to exe
when compile
.
On vs2008, I can do it through add->resource->version
steps.
But how can I do it through cmake
?
使用 MinGW(Windows 的 GCC)时,我们使用 windres,如下所示:
windres foo.rc foores.o
gcc -o foo.exe foo.o foores.o
请参阅此处的文档(MinGW)
使用 Visual Studio,您可以使用资源编译器。请参阅此处的文档(Microsoft)。资源文件 (.rc) 用于存储版本/作者信息。请参阅上面链接的 Microsoft 文档中的 .rc 文件格式。
示例 .rc 文件如下所示:
1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "Comments", "Addition Library"
VALUE "CompanyName", "Lithiumheads Inc."
VALUE "FileDescription", "A library to perform addition."
VALUE "FileVersion", "1, 0, 0, 0"
VALUE "InternalName", "Addition"
VALUE "LegalCopyright", "2011 Anurag Chugh"
VALUE "OriginalFilename", "Addition.dll"
VALUE "ProductName", "Addition Library"
VALUE "ProductVersion", "1, 0, 0, 0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1200
END
END