Normalize slashes of add_custom_(command|target) DEPENDS (#11973)

All commands accepting file paths should normalize the slashes so that
the string-represented names can be compared reliably.  The commands
add_library and add_executable have done this for years.  We taught
add_custom_command to normalize its OUTPUT names in commit a75a0a14
(Normalize add_custom_command OUTPUT names, 2010-12-15).  We handled a
special case of the DEPENDS option in commit 7befc007 (Handle trailing
slashes on add_custom_command DEPENDS, 2011-01-26).

Teach both add_custom_command and add_custom_target to normalize slashes
of DEPENDS files up front.  This approach subsumes the above-mentioned
special case so remove the one line added for it but keep its test.
Extend the CustomCommand test to check that slash count mismatches
between custom command OUTPUT and DEPENDS can still be linked correctly.
This commit is contained in:
Brad King
2011-03-30 09:52:07 -04:00
parent 88548a45fb
commit 128605054a
4 changed files with 15 additions and 6 deletions

View File

@@ -123,7 +123,11 @@ bool cmAddCustomTargetCommand
currentLine.push_back(copy);
break;
case doing_depends:
depends.push_back(copy);
{
std::string dep = copy;
cmSystemTools::ConvertToUnixSlashes(dep);
depends.push_back(dep);
}
break;
case doing_comment:
comment_buffer = copy;