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.
This commit is contained in:
Brad King 2010-12-15 08:44:57 -05:00
parent a14a8562ea
commit a75a0a1448
2 changed files with 2 additions and 1 deletions

View File

@ -161,6 +161,7 @@ bool cmAddCustomCommandCommand
filename += "/"; filename += "/";
} }
filename += copy; filename += copy;
cmSystemTools::ConvertToUnixSlashes(filename);
break; break;
case doing_source: case doing_source:
// We do not want to convert the argument to SOURCE because // We do not want to convert the argument to SOURCE because

View File

@ -55,7 +55,7 @@ ADD_CUSTOM_COMMAND(
# Test creating files from a custom target # 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 DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${PROJECT_SOURCE_DIR}/doc1.tex ARGS -E copy ${PROJECT_SOURCE_DIR}/doc1.tex