[CMake] Getting cmake to double quote paths in Xcode project

Ben Dolman ben.dolman at gmail.com
Wed Nov 11 19:24:46 EST 2009


I'm having a problem when I use ${CMAKE_CFG_INTDIR} as part of my
LIBRARY_OUTPUT_DIRECTORY when generating Xcode projects.  It seems that
cmake properly puts quotes around the path when I have a dash in the path,
but does not put them there when I don't.  Here's what I have:

set_target_properties (MyTarget PROPERTIES
        LIBRARY_OUTPUT_DIRECTORY "/build/${CMAKE_CFG_INTDIR}/lib/lua"
)

The SYMROOT in the resulting project.pbxproj looks like this (notice there
are no quotes):
SYMROOT = /build/$(CONFIGURATION)/lib/lua;

When I change my path to include a dash things change:

set_target_properties (MyTarget PROPERTIES
        LIBRARY_OUTPUT_DIRECTORY "/build/${CMAKE_CFG_INTDIR}/lib/lua-5"
)

This time there are quotes:
SYMROOT = "/build/$(CONFIGURATION)/lib/lua-5";

The first one works great; Xcode opens it and builds it to
/build/Debug/lib/lua, /build/Release/lib/lua, etc.  The second one doesn't
work; Xcode fails to even parse the file ("Project
/projects/Root/Root.xcodeproj cannot be opened because the project file
cannot be parsed."). For whatever reason Xcode wants to put quotes around a
path that has a dash in it, but not around a path that doesn't.

I tried this in both 2.6 and 2.8 with the same result.  Is there some way to
force cmake to include the quotes when generating the Xcode files? Xcode
doesn't seem to like the $(CONFIGURATION) variable unless you have quotes
around your path.

Thanks,
Ben Dolman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091111/a3ed6a5e/attachment.htm>


More information about the CMake mailing list