BUG: Fix Xcode reference to Info.plist resource
- Generated Xcode projects for application bundles list the CMake-generated Info.plist input file as a resource. - The location of the input file was moved by a previous commit, but the reference to it as a resource file was not updated. - This change moves the file to CMakeFiles/<tgt>.dir/Info.plist to give it a more intuitive name in the Xcode project. - We also update the reference to point at the correct location. - See bug #7277.
This commit is contained in:
parent
264af17bfc
commit
1342965b05
@ -1475,11 +1475,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||||||
if(target.GetPropertyAsBool("MACOSX_BUNDLE"))
|
if(target.GetPropertyAsBool("MACOSX_BUNDLE"))
|
||||||
{
|
{
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
std::string plist = this->CurrentMakefile->GetCurrentOutputDirectory();
|
std::string plist = this->ComputeInfoPListLocation(target);
|
||||||
plist += cmake::GetCMakeFilesDirectory();
|
|
||||||
plist += "/";
|
|
||||||
plist += target.GetName();
|
|
||||||
plist += "Info.plist";
|
|
||||||
// Xcode will create the final version of Info.plist at build time,
|
// Xcode will create the final version of Info.plist at build time,
|
||||||
// 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.
|
||||||
@ -2213,11 +2209,8 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
|
|||||||
// MACOSX_BUNDLE file
|
// MACOSX_BUNDLE file
|
||||||
if(cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"))
|
if(cmtarget.GetPropertyAsBool("MACOSX_BUNDLE"))
|
||||||
{
|
{
|
||||||
std::string plistFile =
|
std::string plist = this->ComputeInfoPListLocation(cmtarget);
|
||||||
this->CurrentMakefile->GetCurrentOutputDirectory();
|
cmSourceFile* sf = mf->GetOrCreateSource(plist.c_str(), true);
|
||||||
plistFile += "/Info.plist";
|
|
||||||
cmSourceFile* sf =
|
|
||||||
this->CurrentMakefile->GetOrCreateSource(plistFile.c_str(), true);
|
|
||||||
cmtarget.AddSourceFile(sf);
|
cmtarget.AddSourceFile(sf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2965,3 +2958,15 @@ void cmGlobalXCodeGenerator::AppendDefines(std::string& defs,
|
|||||||
defs += "'";
|
defs += "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string
|
||||||
|
cmGlobalXCodeGenerator::ComputeInfoPListLocation(cmTarget& target)
|
||||||
|
{
|
||||||
|
std::string plist = target.GetMakefile()->GetCurrentOutputDirectory();
|
||||||
|
plist += cmake::GetCMakeFilesDirectory();
|
||||||
|
plist += "/";
|
||||||
|
plist += target.GetName();
|
||||||
|
plist += ".dir/Info.plist";
|
||||||
|
return plist;
|
||||||
|
}
|
||||||
|
@ -103,6 +103,8 @@ private:
|
|||||||
cmXCodeObject* frameworkBuildPhase,
|
cmXCodeObject* frameworkBuildPhase,
|
||||||
cmTarget& cmtarget);
|
cmTarget& cmtarget);
|
||||||
|
|
||||||
|
std::string ComputeInfoPListLocation(cmTarget& target);
|
||||||
|
|
||||||
void AddCommandsToBuildPhase(cmXCodeObject* buildphase,
|
void AddCommandsToBuildPhase(cmXCodeObject* buildphase,
|
||||||
cmTarget& target,
|
cmTarget& target,
|
||||||
std::vector<cmCustomCommand>
|
std::vector<cmCustomCommand>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user