diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-08-19 21:17:13 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-08-19 21:17:13 (GMT) |
commit | c69c9e0134aa41df5c8def0c0d9d8878d0ae1cdc (patch) | |
tree | b7bd8007adeb6b901ff36623d27e3f120d341cd8 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 8d8c3be72bf03816ed8c273d59061b862ae27075 (diff) | |
download | CMake-c69c9e0134aa41df5c8def0c0d9d8878d0ae1cdc.zip CMake-c69c9e0134aa41df5c8def0c0d9d8878d0ae1cdc.tar.gz CMake-c69c9e0134aa41df5c8def0c0d9d8878d0ae1cdc.tar.bz2 |
ENH: add support for OUTPUT_NAME
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index c98f5c0..6056700 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1011,13 +1011,24 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, } case cmTarget::EXECUTABLE: { + const char* outname = target.GetProperty("OUTPUT_NAME"); + std::string name; + if(outname) + { + productName = outname; + name = outname; + } + else + { + name = target.GetName(); + } std::string symRoot; if(m_ExecutableOutputPath.size()) { std::string path = m_ExecutableOutputPath; if(target.GetPropertyAsBool("MACOSX_BUNDLE")) { - path += target.GetName(); + path += name; path += ".app/Contents/MacOS/"; } symRoot = path; @@ -1026,8 +1037,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, if(target.GetPropertyAsBool("MACOSX_BUNDLE")) { if(symRoot.size() == 0) - { - symRoot = target.GetName(); + { + symRoot = name; symRoot += ".app/Contents/MacOS/"; } productType = "com.apple.product-type.tool"; @@ -1111,6 +1122,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, pname = "lib"; } pname += target.GetName(); + if(target.GetType() == cmTarget::EXECUTABLE + && target.GetProperty("OUTPUT_NAME") ) + { + pname = target.GetProperty("OUTPUT_NAME"); + } + buildSettings->AddAttribute("PRODUCT_NAME", this->CreateString(pname.c_str())); } @@ -1153,8 +1170,8 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget) target->AddAttribute("buildSettings", buildSettings); cmXCodeObject* dependencies = this->CreateObject(cmXCodeObject::OBJECT_LIST); target->AddAttribute("dependencies", dependencies); - target->AddAttribute("name", this->CreateString(cmtarget.GetName())); - target->AddAttribute("productName",this->CreateString(cmtarget.GetName())); + target->AddAttribute("name", this->CreateString(productName.c_str())); + target->AddAttribute("productName",this->CreateString(productName.c_str())); target->SetcmTarget(&cmtarget); return target; } @@ -1180,8 +1197,8 @@ cmGlobalXCodeGenerator::CreateXCodeTarget(cmTarget& cmtarget, target->AddAttribute("buildSettings", buildSettings); cmXCodeObject* dependencies = this->CreateObject(cmXCodeObject::OBJECT_LIST); target->AddAttribute("dependencies", dependencies); - target->AddAttribute("name", this->CreateString(cmtarget.GetName())); - target->AddAttribute("productName",this->CreateString(cmtarget.GetName())); + target->AddAttribute("name", this->CreateString(productName.c_str())); + target->AddAttribute("productName",this->CreateString(productName.c_str())); cmXCodeObject* fileRef = this->CreateObject(cmXCodeObject::PBXFileReference); fileRef->AddAttribute("explicitFileType", |