Hi, I am developing a windows application where I have the need of having a Program version included:

  1. As Infowidget in the program itself (About..)
  2. 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.

Qt Code:
  1. // version.h
  2.  
  3. #define STRFILEVER "0.1.0.6\0"
  4. #define FILEVER 0,1,0,6
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. // version.rc
  2.  
  3. #include "version.h"
  4. #include "icon.rc"
  5.  
  6. ...
  7.  
  8. BLOCK "StringFileInfo"
  9. BEGIN
  10. BLOCK "040904B0"
  11. BEGIN
  12. VALUE "FileDescription", "My Application\0"
  13. VALUE "FileVersion", STRFILEVER
  14. VALUE "LegalCopyright", "Copyright (c) 2010\0"
  15. VALUE "OriginalFilename", "App.exe\0"
  16. VALUE "ProductName", "MyApp\0"
  17. END
  18. END
  19. ...
To copy to clipboard, switch view to plain text mode 

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 ?