[Cmake-commits] CMake branch, next, updated. v2.8.12-4232-g1c469b1

Brad King brad.king at kitware.com
Mon Oct 21 11:31:16 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  1c469b1b9577f62c420fcf8182f66bda8fd776b3 (commit)
       via  e5ec8ad47dc07623b6318bb413e01cc921cf66c4 (commit)
      from  979831aee6b68b8c9a39e1f70797637002dd8a73 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c469b1b9577f62c420fcf8182f66bda8fd776b3
commit 1c469b1b9577f62c420fcf8182f66bda8fd776b3
Merge: 979831a e5ec8ad
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Oct 21 11:31:15 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 21 11:31:15 2013 -0400

    Merge topic 'xcode-folder-types' into next
    
    e5ec8ad Xcode: Generate 'folder' source type for directories (#14498)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e5ec8ad47dc07623b6318bb413e01cc921cf66c4
commit e5ec8ad47dc07623b6318bb413e01cc921cf66c4
Author:     Michael Priestman <michael.priestman at autodesk.com>
AuthorDate: Mon Oct 21 15:46:25 2013 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Oct 21 11:09:59 2013 -0400

    Xcode: Generate 'folder' source type for directories (#14498)
    
    Teach the Xcode generator to set 'lastKnownFileType' to be 'folder' for
    file references that are directories.  If you set 'explicitFileType' to
    'sourcecode', then Xcode cannot browse the directory.

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index c8b6832..13ed143 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -876,10 +876,20 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
     ext = realExt.substr(1);
     }
 
-  std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang);
-
-  fileRef->AddAttribute("explicitFileType",
-                        this->CreateString(sourcecode.c_str()));
+  // 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 (Xcode 4.6 does not like explicitFileType=folder).
+  if(cmSystemTools::FileIsDirectory(fullpath.c_str()))
+    {
+    fileRef->AddAttribute("lastKnownFileType",
+                          this->CreateString("folder"));
+    }
+  else
+    {
+    std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang);
+    fileRef->AddAttribute("explicitFileType",
+                          this->CreateString(sourcecode.c_str()));
+    }
 
   // Store the file path relative to the top of the source tree.
   std::string path = this->RelativeToSource(fullpath.c_str());
@@ -1009,7 +1019,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
       cmTarget::SourceFileFlags tsFlags =
         cmtarget.GetTargetSourceFileFlags(*i);
 
-      if(strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0)
+      if(filetype &&
+         strcmp(filetype->GetString(), "compiled.mach-o.objfile") == 0)
         {
         externalObjFiles.push_back(xsf);
         }

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalXCodeGenerator.cxx |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list