summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-03 08:58:48 -0400
committerBrad King <brad.king@kitware.com>2012-08-03 10:17:49 -0400
commitb237dbd8c35c2ec7b43161612fd03e89d85756e6 (patch)
tree905b00efcc80c1e24576ae6c02bd7e8cdd6d4684 /Source
parent896524e13f4989e85398e28850221f2fa93293f5 (diff)
downloadcmake-b237dbd8c35c2ec7b43161612fd03e89d85756e6.tar.gz
Xcode: Fix object library references in multi-project trees (#13452)
In cmGlobalXCodeGenerator::Generate we generate a .xcodeproj for each directory in the tree containing a project() command. First we iteratively use SetGenerationRoot to add "ALL_BUILD" and other targets to each project. This leaves "CurrentProject" set to the last project when we invoke cmGlobalGenerator::Generate, which is not the same as the top-level project if any subdirectories invoke the project() command. When cmGlobalGenerator::Generate reaches CreateGeneratorTargets it constructs cmGeneratorTarget and calls ComputeTargetObjects exactly once per target. In this context the value of CurrentProject is undefined so we cannot pass it to GetObjectsNormalDirectory. Use "$(PROJECT_NAME)" instead so it will adapt automatically to each project. Also teach Tests/ObjectLibrary to cover this case.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 938977bfb7..c366bcb735 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3739,7 +3739,7 @@ cmGlobalXCodeGenerator
const char* configName = this->GetCMakeCFGIntDir();
std::string dir = this->GetObjectsNormalDirectory(
- this->CurrentProject, configName, gt->Target);
+ "$(PROJECT_NAME)", configName, gt->Target);
if(this->XcodeVersion >= 21)
{
dir += "$(CURRENT_ARCH)/";