summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-02 18:13:12 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-02 18:13:12 (GMT)
commitf952ead8571d7ff7a4a903278fbe4646f2693202 (patch)
tree6e13826ced5e02bd3929ca365d9140cb573a864e
parent04fb177de14eff9c54e1decb3668c084daf7e3d7 (diff)
downloadCMake-f952ead8571d7ff7a4a903278fbe4646f2693202.zip
CMake-f952ead8571d7ff7a4a903278fbe4646f2693202.tar.gz
CMake-f952ead8571d7ff7a4a903278fbe4646f2693202.tar.bz2
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.
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx26
1 files 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<std::string>::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())