MantisBT - CMake
View Issue Details
0014280CMakeCMakepublic2013-07-08 17:572016-06-10 14:31
Daniel Franke 
Kitware Robot 
normalminoralways
closedmoved 
Windows
CMake 2.8.11.1 
 
0014280: rc-files are not regenrated/recompiled if included files change
This is a follow-up to 0004068.

Windows resources (.rc) may make use of preprocessor macros, not limited to, but including '#include <filename>' [1].

Consider a generated project.h that defines:
#define PROJECT_REVISION ...

and project.rc:
#include "project.h"
VS_VERSION_INFO VERSIONINFO
...
     VALUE "FileVersion", PROJECT_REVISION
...

Obviously PROJECT_REVISION may change which regenerates project.h, but project.rc does not depend on project.h and hence is not regenerated/rebuilt. Hence the "FileVersion" in the Properties -> Version tab may be outdated.

Thus: .rc files should be scanned for #include and depend on those.


[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx [^]
No tags attached.
Issue History
2013-07-08 17:57Daniel FrankeNew Issue
2013-07-09 09:57Brad KingNote Added: 0033519
2016-06-10 14:29Kitware RobotNote Added: 0042316
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0033519)
Brad King   
2013-07-09 09:57   
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 2.8.11)
project(FOO C)
add_executable(foo foo.c bar.rc)

$ cat ../bar.rc
#include "bar.h"
STRINGTABLE
BEGIN
  1026 BAR
END

$ cat ../bar.h
#define BAR "BAR1"

$ cmake --version
cmake version 2.8.11.2

$ cmake .. -G"MSYS Makefiles"

$ make
Scanning dependencies of target foo
[ 50%] Building C object CMakeFiles/foo.dir/foo.c.obj
[100%] Building RC object CMakeFiles/foo.dir/bar.rc.obj
Linking C executable foo.exe

$ grep bar.rc.obj CMakeFiles/foo.dir/depend.make
CMakeFiles/foo.dir/bar.rc.obj: ../bar.h
CMakeFiles/foo.dir/bar.rc.obj: ../bar.rc

$ make
[100%] Built target foo

$ touch ../bar.h

$ make
Scanning dependencies of target foo
[ 50%] Building RC object CMakeFiles/foo.dir/bar.rc.obj
Linking C executable foo.exe
[100%] Built target foo
(0042316)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.