MantisBT - CMake
View Issue Details
0009271CMakeCMakepublic2009-07-14 13:582016-06-10 14:30
goatboy160 
Bill Hoffman 
normalfeaturealways
closedmoved 
CMake-2-6 
 
0009271: Add ability to enable Objective-C Garbage Collection
Added a target property to enable Garbage collection for Objective-C projects.

Index: .
===================================================================
--- . (revision 73)
+++ . (working copy)
@@ -1668,6 +1668,15 @@
                               this->CreateString("NO"));
   buildSettings->AddAttribute("GCC_INLINES_ARE_PRIVATE_EXTERN",
                               this->CreateString("NO"));
+
+ const char* gcStr = "NO";
+ if(target.GetPropertyAsBool("MACOSX_GCC_OBJC_GC"))
+ {
+ gcStr = "YES";
+ }
+ buildSettings->AddAttribute("GCC_ENABLE_OBJC_GC",
+ this->CreateString(gcStr));
+
   if(lang && strcmp(lang, "CXX") == 0)
     {
     flags += " ";
No tags attached.
related to 0009125closed David Cole Add support to set GCC Version and Deployment Target for XCode projects 
Issue History
2009-07-14 13:58goatboy160New Issue
2009-09-14 15:22Bill HoffmanNote Added: 0017479
2009-09-14 15:22Bill HoffmanStatusnew => assigned
2009-09-14 15:22Bill HoffmanAssigned To => Bill Hoffman
2010-09-28 12:05goatboy160Note Added: 0022376
2011-02-03 18:58David ColeNote Added: 0025267
2011-02-08 14:33David ColeRelationship addedrelated to 0009125
2011-02-10 11:44goatboy160Note Added: 0025373
2016-06-10 14:27Kitware RobotNote Added: 0041579
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0017479)
Bill Hoffman   
2009-09-14 15:22   
Can you use generic Xcode properties for this?
(0022376)
goatboy160   
2010-09-28 12:05   
Not sure. The above patch sets the XCode property that is set using the GUI.
(0025267)
David Cole   
2011-02-03 18:58   
As noted in 0009125, you can now:

...set the Xcode GCC_VERSION attribute, set a variable in the CMakeLists.txt file named CMAKE_XCODE_ATTRIBUTE_GCC_VERSION. By extension, set any variable named CMAKE_XCODE_ATTRIBUTE_XXXXX to set the correspondingly named XXXXX Xcode attribute.

So... to get GCC_ENABLE_OBJC_GC in the generated Xcode file, do:

  set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_OBJC_GC "YES")

Is that sufficient? Or do you need this on a per-target basis...?
(0025373)
goatboy160   
2011-02-10 11:44   
In my case I needed it on a per target basis.
(0041579)
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.