Fix Xcode project references to the source tree

Xcode project source file references need to always be relative to the
top of the source tree in order for SCM and debug symbols to work right.
We must even allow the relative paths to cross outside of the top source
or build directories.

For subdirectory project() command Xcode projects we use the source
directory containing the project() command as the top.  Relative paths
are generated accordingly for each subproject.

See issue #8481.
This commit is contained in:
Brad King
2009-09-22 16:18:31 -04:00
parent 3fe5f8d960
commit 61495cdaae
2 changed files with 34 additions and 56 deletions
+3
View File
@@ -93,6 +93,8 @@ private:
std::vector<cmLocalGenerator*>&
generators);
std::string XCodeEscapePath(const char* p);
std::string RelativeToSource(const char* p);
std::string RelativeToBinary(const char* p);
std::string ConvertToRelativeForXCode(const char* p);
std::string ConvertToRelativeForMake(const char* p);
void CreateCustomCommands(cmXCodeObject* buildPhases,
@@ -206,6 +208,7 @@ private:
std::string CurrentProject;
std::set<cmStdString> TargetDoneSet;
std::vector<std::string> CurrentOutputDirectoryComponents;
std::vector<std::string> ProjectSourceDirectoryComponents;
std::vector<std::string> ProjectOutputDirectoryComponents;
std::map<cmStdString, cmXCodeObject* > GroupMap;
std::map<cmStdString, cmXCodeObject* > GroupNameMap;