cmLocalGenerator: Port PList handling to cmGeneratorTarget.

This commit is contained in:
Stephen Kelly 2015-10-09 22:31:05 +02:00
parent 31c4aee75a
commit 37ab74a607
4 changed files with 12 additions and 11 deletions

View File

@ -2062,7 +2062,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// a per-configuration Info.plist file. The cfbundle plist // a per-configuration Info.plist file. The cfbundle plist
// is very similar to the application bundle plist // is very similar to the application bundle plist
this->CurrentLocalGenerator this->CurrentLocalGenerator
->GenerateAppleInfoPList(&target, "$(EXECUTABLE_NAME)", ->GenerateAppleInfoPList(gtgt, "$(EXECUTABLE_NAME)",
plist.c_str()); plist.c_str());
std::string path = std::string path =
this->ConvertToRelativeForXCode(plist.c_str()); this->ConvertToRelativeForXCode(plist.c_str());
@ -2111,7 +2111,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// so let it replace the framework name. This avoids creating // so let it replace the framework name. This avoids creating
// a per-configuration Info.plist file. // a per-configuration Info.plist file.
this->CurrentLocalGenerator this->CurrentLocalGenerator
->GenerateFrameworkInfoPList(&target, "$(EXECUTABLE_NAME)", ->GenerateFrameworkInfoPList(gtgt, "$(EXECUTABLE_NAME)",
plist.c_str()); plist.c_str());
std::string path = std::string path =
this->ConvertToRelativeForXCode(plist.c_str()); this->ConvertToRelativeForXCode(plist.c_str());
@ -2154,7 +2154,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// so let it replace the executable name. This avoids creating // so let it replace the executable name. This avoids creating
// a per-configuration Info.plist file. // a per-configuration Info.plist file.
this->CurrentLocalGenerator this->CurrentLocalGenerator
->GenerateAppleInfoPList(&target, "$(EXECUTABLE_NAME)", ->GenerateAppleInfoPList(gtgt, "$(EXECUTABLE_NAME)",
plist.c_str()); plist.c_str());
std::string path = std::string path =
this->ConvertToRelativeForXCode(plist.c_str()); this->ConvertToRelativeForXCode(plist.c_str());

View File

@ -3012,7 +3012,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static void cmLGInfoProp(cmMakefile* mf, cmTarget* target, static void cmLGInfoProp(cmMakefile* mf, cmGeneratorTarget* target,
const std::string& prop) const std::string& prop)
{ {
if(const char* val = target->GetProperty(prop)) if(const char* val = target->GetProperty(prop))
@ -3022,7 +3022,7 @@ static void cmLGInfoProp(cmMakefile* mf, cmTarget* target,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target, void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target,
const std::string& targetName, const std::string& targetName,
const char* fname) const char* fname)
{ {
@ -3066,7 +3066,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target, void cmLocalGenerator::GenerateFrameworkInfoPList(cmGeneratorTarget* target,
const std::string& targetName, const std::string& targetName,
const char* fname) const char* fname)
{ {

View File

@ -279,13 +279,14 @@ public:
/** /**
* Generate a Mac OS X application bundle Info.plist file. * Generate a Mac OS X application bundle Info.plist file.
*/ */
void GenerateAppleInfoPList(cmTarget* target, const std::string& targetName, void GenerateAppleInfoPList(cmGeneratorTarget* target,
const std::string& targetName,
const char* fname); const char* fname);
/** /**
* Generate a Mac OS X framework Info.plist file. * Generate a Mac OS X framework Info.plist file.
*/ */
void GenerateFrameworkInfoPList(cmTarget* target, void GenerateFrameworkInfoPList(cmGeneratorTarget* target,
const std::string& targetName, const std::string& targetName,
const char* fname); const char* fname);
/** Construct a comment for a custom command. */ /** Construct a comment for a custom command. */

View File

@ -59,7 +59,7 @@ void cmOSXBundleGenerator::CreateAppBundle(const std::string& targetName,
plist += "/"; plist += "/";
plist += this->GT->GetAppBundleDirectory(this->ConfigName, true); plist += this->GT->GetAppBundleDirectory(this->ConfigName, true);
plist += "/Info.plist"; plist += "/Info.plist";
this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target, this->LocalGenerator->GenerateAppleInfoPList(this->GT,
targetName, targetName,
plist.c_str()); plist.c_str());
this->Makefile->AddCMakeOutputFile(plist); this->Makefile->AddCMakeOutputFile(plist);
@ -90,7 +90,7 @@ void cmOSXBundleGenerator::CreateFramework(
std::string plist = newoutpath; std::string plist = newoutpath;
plist += "/Resources/Info.plist"; plist += "/Resources/Info.plist";
std::string name = cmSystemTools::GetFilenameName(targetName); std::string name = cmSystemTools::GetFilenameName(targetName);
this->LocalGenerator->GenerateFrameworkInfoPList(this->GT->Target, this->LocalGenerator->GenerateFrameworkInfoPList(this->GT,
name, name,
plist.c_str()); plist.c_str());
@ -182,7 +182,7 @@ void cmOSXBundleGenerator::CreateCFBundle(const std::string& targetName,
this->GT->GetCFBundleDirectory(this->ConfigName, true); this->GT->GetCFBundleDirectory(this->ConfigName, true);
plist += "/Info.plist"; plist += "/Info.plist";
std::string name = cmSystemTools::GetFilenameName(targetName); std::string name = cmSystemTools::GetFilenameName(targetName);
this->LocalGenerator->GenerateAppleInfoPList(this->GT->Target, this->LocalGenerator->GenerateAppleInfoPList(this->GT,
name, name,
plist.c_str()); plist.c_str());
this->Makefile->AddCMakeOutputFile(plist); this->Makefile->AddCMakeOutputFile(plist);