[cmake-developers] [CMake 0015200]: Odd quoting issue when mixing single, double and escaped quotes to COMMAND

Mantis Bug Tracker mantis at public.kitware.com
Thu Oct 9 08:24:58 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15200 
====================================================================== 
Reported By:                Ray Donnelly
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15200
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-10-09 08:24 EDT
Last Modified:              2014-10-09 08:24 EDT
====================================================================== 
Summary:                    Odd quoting issue when mixing single, double and
escaped quotes to COMMAND
Description: 
Using the following CMakeList.txt:

add_executable (blender blender.c)

set(TARGETDIR_VER "C:/Program Files (x86)/Blender/share/blender/2.72")

add_custom_command(
  TARGET blender POST_BUILD MAIN_DEPENDENCY blender
  COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime
files and scripts to ${TARGETDIR_VER}'
)

Using any old blender.c (hello world will do)
And either "MSYS Makefiles" or "MinGW Makefiles" generators (actually I suspect
any Makefile generator at all), we get badly quoted strings in
CMakeFiles/blender.dir/build.make:

/C/cmake-3.0.2-win32-x86/bin/cmake.exe -E echo 'now run: "make install" to copy
runtime files and scripts to "C:/Program Files
(x86)/Blender/share/blender/2.72'"

It seems that the final ' and " have been swapped, which causes:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'

Steps to Reproduce: 
unzip quote-problem.7z, and from the MSYS2 shell enter:

/c/cmake-3.0.2-win32-x86/bin/cmake.exe -G'MSYS Makefiles'
make

and observe the error message above.

Additional Information: 
This happens on the officially release 3.0.2 Windows binary and also on MSYS2's
cmake.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-10-09 08:24 Ray Donnelly   New Issue                                    
2014-10-09 08:24 Ray Donnelly   File Added: quote-problem.7z                    
======================================================================




More information about the cmake-developers mailing list