[CMake] Clarification for quoting of parameters for "configure_file()"

SF Markus Elfring elfring at users.sourceforge.net
Mon Mar 31 13:29:38 EDT 2014


Hello,

A wiki article mentions some details about how parameters are handled for CMake
commands.
http://cmake.org/Wiki/CMake/Language_Syntax#CMake_splits_arguments_unless_you_use_quotation_marks_or_escapes.

I would like to try out the following command with unquoted parameters in a
small build script.

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/t1.txt.in
${CMAKE_CURRENT_BINARY_DIR}/t1.txt @ONLY)


The application "CMake GUI 2.8.12.2" reports some "internal errors" as I would
expect it if I dare to use the following setting.

CMAKE_CURRENT_SOURCE_DIR: ... /Probe/quoting/contains s p a c e s;COPYONLY
ESCAPE_QUOTES
CMAKE_CURRENT_BINARY_DIR: ... /build/quoting/contains s p a c e s;COPYONLY
ESCAPE_QUOTES


But I wonder about the result that the configuration command works if the shown
file names do not contain semicolons.
http://cmake.org/cmake/help/cmake_tutorial.html#s1

Would you like to explain such an observation?

Regards,
Markus


More information about the CMake mailing list