MantisBT - CMake
View Issue Details
0008968CMakeCMakepublic2009-05-05 17:062016-06-10 14:30
goatboy160 
Bill Hoffman 
normalmajoralways
closedmoved 
CMake-2-6 
 
0008968: Set .h file type attribute correctly for Objective-C headers
.h files for objective-C are not set properly in xcode. This causes the editor to not properly highlight the code. Putting in the following patch fixes the issue for my usage, since my objective-c code is in a bundle.


Index: cmGlobalXCodeGenerator.cxx
===================================================================
--- cmGlobalXCodeGenerator.cxx (revision 30)
+++ cmGlobalXCodeGenerator.cxx (working copy)
@@ -575,7 +575,8 @@
   else if(ext == "h" || ext == "hxx" || ext == "hpp")
     {
     const char* linkLanguage = cmtarget.GetLinkerLanguage(this);
- if(linkLanguage && (std::string(linkLanguage) == "CXX"))
+ // Force bundles to have sourcecode.c.h for objective-C headers...
+ if(linkLanguage && (std::string(linkLanguage) == "CXX") && !cmtarget.GetPropertyAsBool("MACOSX_BUNDLE") )
       {
       sourcecode += ".cpp.h";
       }
No tags attached.
Issue History
2009-05-05 17:06goatboy160New Issue
2009-09-21 13:20Bill HoffmanNote Added: 0017677
2009-09-21 13:20Bill HoffmanStatusnew => assigned
2009-09-21 13:20Bill HoffmanAssigned To => Bill Hoffman
2010-09-28 12:04goatboy160Note Added: 0022374
2016-06-10 14:27Kitware RobotNote Added: 0041552
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0017677)
Bill Hoffman   
2009-09-21 13:20   
But, you can have C++ bundles as well. Not sure we can do this patch...
(0022374)
goatboy160   
2010-09-28 12:04   
I believe this only changes the properties for the header when it's not in a bundle. The Bundle support has been inadequate in our current model for anything, so we've never been able to use it.
(0041552)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.