[cmake-commits] king committed CMakeLists.txt 1.17 1.18
check_command_line.c.in 1.1 1.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Sep 28 11:30:51 EDT 2006
Update of /cvsroot/CMake/CMake/Tests/CustomCommand
In directory public:/mounts/ram/cvs-serv29208/Tests/CustomCommand
Modified Files:
CMakeLists.txt check_command_line.c.in
Log Message:
ENH: Added VERBATIM option to ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET commands. This option enables full escaping of custom command arguments on all platforms. See bug#3786.
Index: check_command_line.c.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/check_command_line.c.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- check_command_line.c.in 21 Sep 2006 20:11:25 -0000 1.1
+++ check_command_line.c.in 28 Sep 2006 15:30:49 -0000 1.2
@@ -20,7 +20,7 @@
}
else
{
- printf("[%s]\n", *a);
+ /*printf("[%s]\n", *a);*/
}
}
if(*a || *e)
@@ -28,5 +28,6 @@
fprintf(stderr, "Number of arguments does not match expected.\n");
return 1;
}
+ printf("Command line escapes work!\n");
return 0;
}
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CustomCommand/CMakeLists.txt,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- CMakeLists.txt 25 Sep 2006 14:22:48 -0000 1.17
+++ CMakeLists.txt 28 Sep 2006 15:30:49 -0000 1.18
@@ -176,6 +176,17 @@
double\"quote
"\\;semi-colons\\;"
"semi\\;colon"
+ `back-ticks`
+ back`tick
+ "(parens)"
+ "(lparen"
+ "rparen)"
+ $dollar-signs$
+ dollar$sign
+ &ersands&
+ amper&sand
+ \@two-ats\@
+ one at at
"c:/posix/path/with space"
"c:\\windows\\path\\with space"
"'single quotes with space'"
@@ -184,6 +195,17 @@
"double\"quote with space"
"\\;semi-colons with space\\;"
"semi\\;colon with space"
+ "`back-ticks` with space"
+ "back`tick with space"
+ "(parens) with space"
+ "(lparen with space"
+ "rparen) with space"
+ "$dollar-signs$ with space"
+ "dollar$sign with space"
+ "&ersands& with space"
+ "amper&sand with space"
+ "\@two-ats\@ with space"
+ "one at at with space"
)
FOREACH(arg ${CHECK_ARGS})
SET(ARG "${arg}")
@@ -199,8 +221,18 @@
@ONLY IMMEDIATE)
ADD_EXECUTABLE(check_command_line
${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c)
-ADD_CUSTOM_TARGET(do_check_command_line #ALL
+ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check
COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line
${CHECK_ARGS}
+ VERBATIM
+ COMMENT "Checking custom command line escapes"
+ )
+ADD_CUSTOM_TARGET(do_check_command_line ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check
+ COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes"
+ COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line
+ ${CHECK_ARGS}
+ VERBATIM
)
ADD_DEPENDENCIES(do_check_command_line check_command_line)
More information about the Cmake-commits
mailing list