summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-03 14:33:12 (GMT)
committerBrad King <brad.king@kitware.com>2014-09-03 14:33:12 (GMT)
commit02aa5965e6b4b82b5e8b893beadc56069d4a7ebb (patch)
treec156312699d57651357a586125536d3b8d2a99ea /Source/cmGlobalXCodeGenerator.cxx
parentfb8acb74e83a591c1231c4a07c221f4392f4c0be (diff)
downloadCMake-02aa5965e6b4b82b5e8b893beadc56069d4a7ebb.zip
CMake-02aa5965e6b4b82b5e8b893beadc56069d4a7ebb.tar.gz
CMake-02aa5965e6b4b82b5e8b893beadc56069d4a7ebb.tar.bz2
Xcode: Refactor internal file type extension extraction
Move it earlier so it can be used for directories too.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ee5fc00..1c3d358 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -864,6 +864,13 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
}
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
// lastKnownFileType as folder in order for Xcode to be able to
// open the contents of the folder.
@@ -875,13 +882,6 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
}
else
{
- // Compute the extension without leading '.'.
- std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
- if(!ext.empty())
- {
- ext = ext.substr(1);
- }
-
fileType = GetSourcecodeValueFromFileExtension(
ext, lang, useLastKnownFileType);
}