ENH: add support for bundles

This commit is contained in:
Bill Hoffman 2005-07-13 16:23:32 -04:00
parent 19ae75a934
commit 472c00e3a4
1 changed files with 29 additions and 4 deletions

View File

@ -901,14 +901,39 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
break;
}
case cmTarget::EXECUTABLE:
{
std::string symRoot;
if(m_ExecutableOutputPath.size())
{
std::string path = m_ExecutableOutputPath;
if(target.GetPropertyAsBool("MACOSX_BUNDLE"))
{
path += target.GetName();
path += ".app/Contents/MacOS/";
}
symRoot = path;
}
fileType = "compiled.mach-o.executable";
if(target.GetPropertyAsBool("MACOSX_BUNDLE"))
{
if(symRoot.size() == 0)
{
symRoot = target.GetName();
symRoot += ".app/Contents/MacOS/";
}
productType = "com.apple.product-type.tool";
}
else
{
productType = "com.apple.product-type.tool";
}
if(symRoot.size())
{
buildSettings->AddAttribute("SYMROOT",
this->CreateString
(m_ExecutableOutputPath.c_str()));
(symRoot.c_str()));
}
}
fileType = "compiled.mach-o.executable";
productType = "com.apple.product-type.tool";
break;
case cmTarget::UTILITY:
@ -1139,7 +1164,7 @@ void cmGlobalXCodeGenerator::AddLinkLibrary(cmXCodeObject* target,
cmXCodeObject* ldflags = settings->GetObject("OTHER_LDFLAGS");
std::string link = ldflags->GetString();
cmSystemTools::ReplaceString(link, "\"", "");
cmsys::RegularExpression reg("^([ \t]*\\-[lWRB])|([ \t]*\\-framework)|(\\${)|([ \t]*\\-pthread)|([ \t]*`)");
cmsys::RegularExpression reg("^([ \t]*\\-[lLWRB])|([ \t]*\\-framework)|(\\${)|([ \t]*\\-pthread)|([ \t]*`)");
// if the library is not already in the form required by the compiler
// add a -l infront of the name
link += " ";