diff options
author | Brad King <brad.king@kitware.com> | 2011-03-31 17:23:32 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-03-31 17:23:32 (GMT) |
commit | 148b528f9d7d991dc01f277624df4a8aa41feccc (patch) | |
tree | 4d73c1c4b406670800021667ae390e2594f99e42 | |
parent | ecc81cd353556af1d9afa3426f0892dd6b92b2b7 (diff) | |
parent | 128605054a2d773189869d6e1b5000e6d4a93241 (diff) | |
download | CMake-148b528f9d7d991dc01f277624df4a8aa41feccc.zip CMake-148b528f9d7d991dc01f277624df4a8aa41feccc.tar.gz CMake-148b528f9d7d991dc01f277624df4a8aa41feccc.tar.bz2 |
Merge topic 'custom-command-slashes'
1286050 Normalize slashes of add_custom_(command|target) DEPENDS (#11973)
-rw-r--r-- | Source/cmAddCustomCommandCommand.cxx | 12 | ||||
-rw-r--r-- | Source/cmAddCustomTargetCommand.cxx | 6 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 1 | ||||
-rw-r--r-- | Tests/CustomCommand/CMakeLists.txt | 2 |
4 files changed, 15 insertions, 6 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index 502829e..5634849 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -195,11 +195,13 @@ bool cmAddCustomCommandCommand { // An implicit dependency starting point is also an // explicit dependency. - depends.push_back(copy); + std::string dep = copy; + cmSystemTools::ConvertToUnixSlashes(dep); + depends.push_back(dep); // Add the implicit dependency language and file. cmCustomCommand::ImplicitDependsPair - entry(implicit_depends_lang, copy); + entry(implicit_depends_lang, dep); implicit_depends.push_back(entry); // Switch back to looking for a language. @@ -213,7 +215,11 @@ bool cmAddCustomCommandCommand target = copy; break; case doing_depends: - depends.push_back(copy); + { + std::string dep = copy; + cmSystemTools::ConvertToUnixSlashes(dep); + depends.push_back(dep); + } break; case doing_outputs: outputs.push_back(filename); diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx index 27dea98..4eba886 100644 --- a/Source/cmAddCustomTargetCommand.cxx +++ b/Source/cmAddCustomTargetCommand.cxx @@ -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; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 7b3fc86..7da35eb 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1904,7 +1904,6 @@ bool cmLocalGenerator::GetRealDependency(const char* inName, { // This is a full path. Return it as given. dep = inName; - cmSystemTools::ConvertToUnixSlashes(dep); return true; } diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 19e3c2c..b7c9ea2 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -102,7 +102,7 @@ ADD_CUSTOM_TARGET(TDocument ALL COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.h to doc2.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.h ${PROJECT_BINARY_DIR}/doc2.h - DEPENDS ${PROJECT_BINARY_DIR}/doc1.h doc1.txt + DEPENDS doc1.txt ${PROJECT_BINARY_DIR}//doc1.h # test 2 slashes COMMENT "Running top-level TDocument commands" SOURCES doc1.tex ) |