From a75a0a14484a7f11961430006fad602099d22f6c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 15 Dec 2010 08:44:57 -0500 Subject: Normalize add_custom_command OUTPUT names (#10485) Previously the OUTPUT arguments of add_custom_command were not slash-normalized but those of add_library and add_executable were. This caused the example add_custom_command(OUTPUT a//b.c ...) add_library(... a//b.c ...) to fail at build time with "no rule to make a/b.c". Fix this and modify the CustomCommand test to try it. --- Source/cmAddCustomCommandCommand.cxx | 1 + Tests/CustomCommand/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index f6b3234..7af6ec8 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -161,6 +161,7 @@ bool cmAddCustomCommandCommand filename += "/"; } filename += copy; + cmSystemTools::ConvertToUnixSlashes(filename); break; case doing_source: // We do not want to convert the argument to SOURCE because diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 746c9a7..13f4233 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -55,7 +55,7 @@ ADD_CUSTOM_COMMAND( # Test creating files from a custom target # ################################################################ -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.dvi +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex COMMAND ${CMAKE_COMMAND} ARGS -E copy ${PROJECT_SOURCE_DIR}/doc1.tex -- cgit v0.12