Browse Source

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.
Brad King 15 years ago
parent
commit
a75a0a1448
2 changed files with 2 additions and 1 deletions
  1. 1 0
      Source/cmAddCustomCommandCommand.cxx
  2. 1 1
      Tests/CustomCommand/CMakeLists.txt

+ 1 - 0
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

+ 1 - 1
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