[CMake] Xcode paths not turning out right

Brad King brad.king at kitware.com
Mon Sep 21 17:03:32 EDT 2009


Robert Dailey wrote:
> I've attached a test project that reproduces this issue. At the root 
> "test" directory, create a new directory called 'build'. So you will 
> have "test/build".
> 
> cd into test/build and run:
> 
> cmake -G "Xcode" ..
> 
> This will generate an xcode project for you. Open that, and right click 
> on main.cpp (which should be colored red because it is an invalid path) 
> and click "Get Info". Look at the path. It's totally wrong. 

Great, thanks.  Now I see the problem.  In fact it happens
even if I manually expand the function inline in the subdir.
The key is that the Xcode project file is in a subdir and
not the top.

This was in fact caused by the patch for the bug I linked
earlier in this thread:

  http://www.cmake.org/Bug/view.php?id=8481

In order to help Xcode 3.0 set breakpoints the project file
needs to reference sources with relative paths.  The fix for
that bug always converts paths relative to the top of the
tree instead of the directory containing the Xcode project
file.  It went unnoticed because usually these are the same.

I'm going to re-open that issue with a link to this message.

Thanks,
-Brad



More information about the CMake mailing list