View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014280CMakeCMakepublic2013-07-08 17:572016-06-10 14:31
ReporterDaniel Franke 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSWindowsOS Version
Product VersionCMake 2.8.11.1 
Target VersionFixed in Version 
Summary0014280: rc-files are not regenrated/recompiled if included files change
DescriptionThis 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 [^]
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0033519)
Brad King (manager)
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 (administrator)
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.

 Issue History
Date Modified Username Field Change
2013-07-08 17:57 Daniel Franke New Issue
2013-07-09 09:57 Brad King Note Added: 0033519
2016-06-10 14:29 Kitware Robot Note Added: 0042316
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team