MantisBT - CMake
View Issue Details
0013694CMakeCMakepublic2012-11-16 19:032016-06-10 14:31
Jevin Sweval 
Kitware Robot 
normalminoralways
closedmoved 
AppleMac OS X10.8.2
CMake 2.8.10.1 
 
0013694: CMAKE_OSX_SYSROOT isn't quoted, breaking builds when the SDK path contains a space
CMAKE_OSX_SYSROOT is eventually consumed by cmLocalGenerator::AddArchitectureFlags which will generate something like '-isysroot $SYSROOT'

I keep multiple versions of Xcode around in /Applications/Xcode $version.app/ so the sysroot path will contain a space.

The fix (for my case) is to wrap the sysroot path in quotes like so: '-isysroot "$SYSROOT"'

I can't imagine that this would break anything, and can only help.

I have applied a patch here https://github.com/jevinskie/cmake/commits/master [^]
1) Rename your Xcode.app folder such that it contains a space.
2) Try to build something
3) The build fails because the sysroot path was not properly quoted.
No tags attached.
related to 0015320closed Kitware Robot Xcode with space in path can not be used to run CMake 
Issue History
2012-11-16 19:03Jevin SwevalNew Issue
2012-11-17 13:18David ColeNote Added: 0031598
2015-01-01 06:41Stephen KellyRelationship addedrelated to 0015320
2016-06-10 14:28Kitware RobotNote Added: 0042151
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0031598)
David Cole   
2012-11-17 13:18   
I still have 10.7.5 installed on my Mac, with Xcode 4.2.1 at "/Developer/Applications/Xcode.app".

When I apply this patch, I cannot build with the Xcode generator if I change the root to have a space in it (i.e., "/Devel Oper"), nor can I build when I change "Xcode.app" to "Xco De.app". I get errors about "unknown compiler".

So... while the patch seems appropriate, and apparently fixes things for your scenario, I don't think it's sufficient for fixing all scenarios similar to it. I think there are more places where we'll need fixes besides the one location you've patched here.
(0042151)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.