From f952ead8571d7ff7a4a903278fbe4646f2693202 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 2 Jul 2009 14:13:12 -0400 Subject: ENH: Use logical target names in Xcode projects Previously we named Xcode targets using the output file name from one of the configurations. This is not very friendly, especially because it changes with CMAKE_BUILD_TYPE. Instead we should use the original logical target names for the Xcode target names. This is also consistent with the way the other IDE generators work. --- Source/cmGlobalXCodeGenerator.cxx | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 996d961..762e741 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1888,8 +1888,8 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget) cmXCodeObject* dependencies = this->CreateObject(cmXCodeObject::OBJECT_LIST); target->AddAttribute("dependencies", dependencies); - target->AddAttribute("name", this->CreateString(productName.c_str())); - target->AddAttribute("productName",this->CreateString(productName.c_str())); + target->AddAttribute("name", this->CreateString(cmtarget.GetName())); + target->AddAttribute("productName",this->CreateString(cmtarget.GetName())); target->SetTarget(&cmtarget); // Add source files without build rules for editing convenience. @@ -1990,8 +1990,8 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget, cmXCodeObject* dependencies = this->CreateObject(cmXCodeObject::OBJECT_LIST); target->AddAttribute("dependencies", dependencies); - target->AddAttribute("name", this->CreateString(productName.c_str())); - target->AddAttribute("productName",this->CreateString(productName.c_str())); + target->AddAttribute("name", this->CreateString(cmtarget.GetName())); + target->AddAttribute("productName",this->CreateString(cmtarget.GetName())); cmXCodeObject* fileRef = this->CreateObject(cmXCodeObject::PBXFileReference); @@ -2800,7 +2800,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( universal += ".build/"; universal += configName; universal += "/"; - universal += t->GetFullName(configName); + universal += t->GetName(); universal += ".build/Objects-normal/"; for( std::vector::iterator arch = this->Architectures.begin(); @@ -2953,23 +2953,7 @@ GetTargetObjectFileDirectories(cmTarget* target, dir += ".build/"; dir += this->GetCMakeCFGInitDirectory(); dir += "/"; - if(target->GetType() != cmTarget::EXECUTABLE) - { - dir += "lib"; - } dir += target->GetName(); - if(target->GetType() == cmTarget::STATIC_LIBRARY) - { - dir += ".a"; - } - if(target->GetType() == cmTarget::SHARED_LIBRARY) - { - dir += ".dylib"; - } - if(target->GetType() == cmTarget::MODULE_LIBRARY) - { - dir += ".so"; - } dir += ".build/Objects-normal/"; std::string dirsave = dir; if(this->Architectures.size()) -- cgit v0.12