The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15125 
====================================================================== 
Reported By:                Jan Rüegg
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15125
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-09-03 08:47 EDT
Last Modified:              2014-09-03 08:47 EDT
====================================================================== 
Summary:                    XCode generator cannot add assetcatalog assets
Description: 
When adding resources to an XCode CMake project like this:

set_target_properties(foo PROPERTIES RESOURCE example/demo_app/Images.xcassets)

An entry similar to this one is created in the xcode project:

1582C9DBB34F4291A1D09CA3 /* Images.xcassets */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = folder; name = Images.xcassets; path =
example/demo_app/Images.xcassets; sourceTree = SOURCE_ROOT; };

This works fine for normal folders, however I would like to use this to add an
assets folder. This creates a very similar entry, however to make it work with
xcode the lastKnownFileType needs to be changed from "folder" to
"folder.assetcatalog", like this:

1582C9DBB34F4291A1D09CA3 /* Images.xcassets */ = {isa = PBXFileReference;
fileEncoding = 4; lastKnownFileType = folder.assetcatalog; name =
Images.xcassets; path = example/demo_app/Images.xcassets; sourceTree =
SOURCE_ROOT; };

In CMake 3.0.1, this is generated in the file "cmGlobalXCodeGenerator.cxx", line
874:
  if(cmSystemTools::FileIsDirectory(fullpath.c_str()))
    {
    fileRef->AddAttribute("lastKnownFileType",
                          this->CreateString("folder"));
    }
In order to make it work, it would need to be changed to read something like
this (pseudocode):
  if(cmSystemTools::FileIsDirectory(fullpath.c_str()))
    {
      if (fileEndsWith(".xcassets"))
        {
          fileRef->AddAttribute("lastKnownFileType",
                        this->CreateString("folder.assetcatalog"));
        }
        else
        {
          fileRef->AddAttribute("lastKnownFileType",
                        this->CreateString("folder"));
        }
    }

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-09-03 08:47 Jan Rüegg      New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to