franku
7th January 2011, 15:38
Hi, I am developing a windows application where I have the need of having a Program version included:
As Infowidget in the program itself (About..)
As Version information in the .exe binary when looking from the file explorer's view
At this point everthing is solved using a version.rc file that is compiled by the windres compiler. In this file included I have a version.h file that defines every version for my program. The advantage of this solution is to have only one file (the version.h) to be changed in my source code.
// version.h
#define STRFILEVER "0.1.0.6\0"
#define FILEVER 0,1,0,6
// version.rc
#include "version.h"
#include "icon.rc"
...
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "FileDescription", "My Application\0"
VALUE "FileVersion", STRFILEVER
VALUE "LegalCopyright", "Copyright (c) 2010\0"
VALUE "OriginalFilename", "App.exe\0"
VALUE "ProductName", "MyApp\0"
END
END
...
Now to the question. qmake will not automatically set the version.h file as a dependency in the makefiles for the version.rc file so I will always have to tag version.rc manually.
Is there a way to tell qmake to reflect version.h in the dependencies of version.rc ? How can I add custom dependencies to a certain file that is no library but (in my case) a ressource file.
Any comments ?
As Infowidget in the program itself (About..)
As Version information in the .exe binary when looking from the file explorer's view
At this point everthing is solved using a version.rc file that is compiled by the windres compiler. In this file included I have a version.h file that defines every version for my program. The advantage of this solution is to have only one file (the version.h) to be changed in my source code.
// version.h
#define STRFILEVER "0.1.0.6\0"
#define FILEVER 0,1,0,6
// version.rc
#include "version.h"
#include "icon.rc"
...
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "FileDescription", "My Application\0"
VALUE "FileVersion", STRFILEVER
VALUE "LegalCopyright", "Copyright (c) 2010\0"
VALUE "OriginalFilename", "App.exe\0"
VALUE "ProductName", "MyApp\0"
END
END
...
Now to the question. qmake will not automatically set the version.h file as a dependency in the makefiles for the version.rc file so I will always have to tag version.rc manually.
Is there a way to tell qmake to reflect version.h in the dependencies of version.rc ? How can I add custom dependencies to a certain file that is no library but (in my case) a ressource file.
Any comments ?