MantisBT - CMake
View Issue Details
0010014CMakeCMakepublic2009-12-08 20:042010-01-24 15:13
Song Zhiwei 
Alex Neundorf 
normalminoralways
closedfixed 
CMake-2-8 
 
0010014: Missing " around the file name which contains spaces when producing the Code::Blocks project file
I use CMake to generate a Code::Blocks MinGW Makefiles for my project
Module4Test. Module4Test.cbp contains lines as below:

        <MakeCommands>
           <Build command="C:/MinGW/bin/mingw32-make.exe -f
C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile
module4test/fast" />
           <CompileFile command="C:/MinGW/bin/mingw32-make.exe -f
C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile
"$file"" />
           <Clean command="C:/MinGW/bin/mingw32-make.exe -f
C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile
clean" />
           <DistClean command="C:/MinGW/bin/mingw32-make.exe -f
C:/Documents\ and\ Settings/Song\ Zhiwei/Desktop/build2/src/Makefile
clean" />
        </MakeCommands>

As you noticed, no " are added around C:/Documents\
..../Makefile, so the build fails.

I think it is a bug
No tags attached.
? TESTSPACE.cbp-buggy (7,433) 2010-01-15 04:03
https://public.kitware.com/Bug/file/2768/TESTSPACE.cbp-buggy
? TESTSPACE.cbp (7,653) 2010-01-15 04:03
https://public.kitware.com/Bug/file/2769/TESTSPACE.cbp
zip TestSpace.zip (471) 2010-01-15 04:06
https://public.kitware.com/Bug/file/2770/TestSpace.zip
Issue History
2009-12-08 20:04Song ZhiweiNew Issue
2009-12-08 20:07Song ZhiweiNote Added: 0018727
2009-12-08 20:08Song ZhiweiNote Deleted: 0018727
2009-12-08 20:09Song ZhiweiNote Added: 0018728
2009-12-08 20:11Song ZhiweiNote Edited: 0018728
2009-12-09 15:14Alex NeundorfStatusnew => assigned
2009-12-09 15:14Alex NeundorfAssigned To => Alex Neundorf
2009-12-09 15:21Alex NeundorfNote Added: 0018751
2009-12-09 20:19Song ZhiweiNote Added: 0018764
2010-01-15 04:03Eric NOULARDFile Added: TESTSPACE.cbp-buggy
2010-01-15 04:03Eric NOULARDFile Added: TESTSPACE.cbp
2010-01-15 04:06Eric NOULARDNote Added: 0019144
2010-01-15 04:06Eric NOULARDFile Added: TestSpace.zip
2010-01-15 04:09Eric NOULARDNote Added: 0019145
2010-01-24 15:13Alex NeundorfNote Added: 0019289
2010-01-24 15:13Alex NeundorfStatusassigned => closed
2010-01-24 15:13Alex NeundorfResolutionopen => fixed
2010-01-24 15:13Alex NeundorfSummaryMissing " around the file name which contains spaces when producing the Code::Blocks project file => Missing " around the file name which contains spaces when producing the Code::Blocks project file
2010-01-24 15:13Alex NeundorfDescription Updated

Notes
(0018728)
Song Zhiwei   
2009-12-08 20:09   
(edited on: 2009-12-08 20:11)
Seems &quot; was replaced with " in the title and description above.

(0018751)
Alex Neundorf   
2009-12-09 15:21   
Hmm...
In your description I see double quotes around the complete commands, and inside the commands the spaces are escaped.
How should it look like ?
(if something doesn't work here as a comment, just attach it as a text file to this bug report).

Alex
(0018764)
Song Zhiwei   
2009-12-09 20:19   
On Windows, seems that the escaped space does not work properly. It works when I run make.exe under the command window. But it does not work when I click the Build button in the Code::Blocks, the error is:

mingw32-make.exe: C:/Documents\: No such file or directory
mingw32-make.exe: *** No rule to make target `C:/Documents\'. Stop.

Maybe is a problem inside Code::Blocks. However, this problem will be solved if &quot; are added around the make file name like adding them around $file.
(0019144)
Eric NOULARD   
2010-01-15 04:06   
Hi Alex,

I did face the same problem with C::B 8.02 (+mingw) on Windows.
I did attach two files the "buggy one" is the one generated by CMake
the other is the one which is working for me when "fixed" by hand
as suggested by songzw.

I'll attach the zip of the corresponding project.
I did not test the issue on Linux.
(0019145)
Eric NOULARD   
2010-01-15 04:09   
Looks like the " things is only necessary in
argument of a command=""...

in:
<Option working_dir="D:/users/Erk/Blah/B B" />

there is none and it seems OK.

By the way, the bug is reproducible with CMake 2.6.x or CMake 2.8.x
(not tested CVS version)
(0019289)
Alex Neundorf   
2010-01-24 15:13   
Ok, I think I fixed this now in cvs HEAD, but I cannot verify it.
Please test and reopen the bugreport if it still doesn't work.
http://public.kitware.com/cgi-bin/viewcvs.cgi/Source/cmExtraCodeBlocksGenerator.cxx?root=CMake&view=log [^]

Alex