ENH: fix for bug 992, mac bundle install fix

This commit is contained in:
Bill Hoffman 2005-07-14 16:00:40 -04:00
parent a9692f0a18
commit 44b54d2b94
1 changed files with 29 additions and 4 deletions

View File

@ -358,10 +358,35 @@ void cmLocalGenerator::GenerateInstallRules()
} }
break; break;
case cmTarget::EXECUTABLE: case cmTarget::EXECUTABLE:
fname = exeOutPath; if(l->second.GetPropertyAsBool("MACOSX_BUNDLE"))
fname += l->second.GetFullName(m_Makefile); {
files = fname.c_str(); fname = exeOutPath;
this->AddInstallRule(fout, dest, type, files); fname += l->second.GetFullName(m_Makefile);
std::string plist = fname;
plist += ".app/Contents/Info.plist";
fname += ".app/Contents/MacOS/";
fname += l->second.GetName();
files = fname.c_str();
std::string bdest = dest;
bdest += "/";
bdest += l->second.GetName();
std::string pdest = bdest;
pdest += ".app/Contents";
bdest += ".app/Contents/MacOS";
// first install the actual executable
this->AddInstallRule(fout, bdest.c_str(), type, files);
files = plist.c_str();
// now install the Info.plist file
this->AddInstallRule(fout, pdest.c_str(),
cmTarget::INSTALL_FILES, files);
}
else
{
fname = exeOutPath;
fname += l->second.GetFullName(m_Makefile);
files = fname.c_str();
this->AddInstallRule(fout, dest, type, files);
}
break; break;
case cmTarget::INSTALL_FILES: case cmTarget::INSTALL_FILES:
{ {