Merge topic 'xcode-assetcatalog-folder-type'

8eacc339 Xcode: Reference '.xcassets' folders as assetcatalog (#15125)
02aa5965 Xcode: Refactor internal file type extension extraction
This commit is contained in:
Brad King 2014-09-04 09:48:22 -04:00 committed by CMake Topic Stage
commit 1dbb46483a
1 changed files with 8 additions and 8 deletions

View File

@ -864,24 +864,24 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
} }
if(fileType.empty()) if(fileType.empty())
{ {
// Compute the extension without leading '.'.
std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
if(!ext.empty())
{
ext = ext.substr(1);
}
// If fullpath references a directory, then we need to specify // If fullpath references a directory, then we need to specify
// lastKnownFileType as folder in order for Xcode to be able to // lastKnownFileType as folder in order for Xcode to be able to
// open the contents of the folder. // open the contents of the folder.
// (Xcode 4.6 does not like explicitFileType=folder). // (Xcode 4.6 does not like explicitFileType=folder).
if(cmSystemTools::FileIsDirectory(fullpath.c_str())) if(cmSystemTools::FileIsDirectory(fullpath.c_str()))
{ {
fileType = "folder"; fileType = (ext == "xcassets"? "folder.assetcatalog" : "folder");
useLastKnownFileType = true; useLastKnownFileType = true;
} }
else else
{ {
// Compute the extension without leading '.'.
std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
if(!ext.empty())
{
ext = ext.substr(1);
}
fileType = GetSourcecodeValueFromFileExtension( fileType = GetSourcecodeValueFromFileExtension(
ext, lang, useLastKnownFileType); ext, lang, useLastKnownFileType);
} }