summaryrefslogtreecommitdiffstats
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-05-28 18:16:39 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-05-28 19:05:41 (GMT)
commitc4af46b4443374f0a0a64bb7db87750454cc3dac (patch)
tree68f7e80f0575083486a092d1896b06fe443e6df0 /Source/cmAddCustomCommandCommand.cxx
parent5e9441cd39f9112acc052d465ebd9f21f29ad581 (diff)
downloadCMake-c4af46b4443374f0a0a64bb7db87750454cc3dac.zip
CMake-c4af46b4443374f0a0a64bb7db87750454cc3dac.tar.gz
CMake-c4af46b4443374f0a0a64bb7db87750454cc3dac.tar.bz2
add_custom_command: Normalize OUTPUT and DEPENDS paths.
While tracing dependencies of a target, cmTargetTraceDependencies follows sources by full path to determine if the source is to be produced by a custom command. Commit 4959f341 (cmSourceFileLocation: Collapse full path for directory comparisons., 2014-03-27) changed the storage of target sources to be in the form of a normalized path instead of an unnormalized path. The path is followed by looking it up in a mapping via cmMakefile::GetSourceFileWithOutput to acquire an appropriate cmSourceFile. The mapping is populated with the OUTPUT components of add_custom_command invocations, however it is populated with unnormalized paths. This means that the tracing logic does not find appropriate cmSourceFiles, and does not generate appropriate build rules for the generated sources. Normalize the paths in the OUTPUT components of add_custom_command to resolve this. The paths in the DEPENDS component of add_custom_command are also not normalized, leading to the same problem again. Normalize the depends paths after generator evaluation and expansion.
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index d5f00ff..6a95550 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -173,6 +173,10 @@ bool cmAddCustomCommandCommand
break;
}
+ if (cmSystemTools::FileIsFullPath(filename.c_str()))
+ {
+ filename = cmSystemTools::CollapseFullPath(filename);
+ }
switch (doing)
{
case doing_working_directory: