View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009125CMakeCMakepublic2009-06-09 20:552011-02-08 14:33
Reportergoatboy160 
Assigned ToDavid Cole 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0009125: Add support to set GCC Version and Deployment Target for XCode projects
DescriptionXcode needs to support these options. I've added code to the GlobalXCodeGenerator to handle these two very important flags for XCode.

Here's a patch to the XCodeGlobalGenerator from 2.6.3

@@ -2481,6 +2487,10 @@
       this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT");
   const char* sysrootDefault =
     this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT_DEFAULT");
+ const char* gccVersion =
+ this->CurrentMakefile->GetDefinition("CMAKE_OSX_GCC_VERSION");
+ const char* deploymentTarget =
+ this->CurrentMakefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET");
   if(osxArch && sysroot)
     {
     bool flagsUsed = false;
@@ -2522,6 +2532,16 @@
                                   this->CreateString(sysroot));
       }
     }
+ if(gccVersion)
+ {
+ buildSettings->AddAttribute("GCC_VERSION",
+ this->CreateString(gccVersion));
+ }
+ if(deploymentTarget)
+ {
+ buildSettings->AddAttribute("MACOSX_DEPLOYMENT_TARGET",
+ this->CreateString(deploymentTarget));
+ }
   for( std::vector<cmXCodeObject*>::iterator i = configs.begin();
        i != configs.end(); ++i)
     {
TagsNo tags attached.
Attached Files

 Relationships
related to 0006195closedDavid Cole Add a "CMAKE_OSX_DEPLOYMENT_TARGET" to pass -mmin-macosx-version to gcc 
related to 0008915closed Missing feature to set Xcode specific build settings 
related to 0008179closedDavid Cole Mac XCode generator: build type depend XCODE_ATTRIBUTE_* would be nice 
related to 0010722closedBrad King Add PlatformToolset support to Visual Studio 2010 generator 
related to 0009271closedBill Hoffman Add ability to enable Objective-C Garbage Collection 
related to 0002582closedKitware Robot Set XCode arguments from CMakeLists.txt 
related to 0008178closedBill Hoffman Mac XCode generator: It is not possible to customize some important xcode settings 

  Notes
(0018003)
Angus (reporter)
2009-10-07 01:07

CMAKE_OSX_GCC_VERSION is redundant: use CMAKE_C_VERSION and/or CMAKE_CXX_VERSION to set Xcode GCC_VERSION appropriately.
see http://www.itk.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F [^]
(0018068)
Sean McBride (reporter)
2009-10-14 13:46

The 'deployment target' part of your request, if I understand you correctly, is covered by bug 0006195 (and fixed).
(0019521)
David Cole (manager)
2010-02-12 14:13

Fixed in CVS HEAD of CMake:

/cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v <-- Source/cmGlobalXCodeGenerator.cxx
new revision: 1.242; previous revision: 1.241

To 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.
(0019522)
David Cole (manager)
2010-02-12 15:02

And..... fix the style problem with the previous commit:

/cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v <-- Source/cmGlobalXCodeGenerator.cxx
new revision: 1.243; previous revision: 1.242
(0020033)
David Cole (manager)
2010-03-30 11:09

The fix for this issue was included in CMake 2.8.1 - rc3.
(0024111)
David Cole (manager)
2010-12-14 18:50

Closing bugs that have been resolved for more than 3 months without any further updates.

 Issue History
Date Modified Username Field Change
2009-06-09 20:55 goatboy160 New Issue
2009-10-07 01:07 Angus Note Added: 0018003
2009-10-14 13:46 Sean McBride Note Added: 0018068
2010-02-12 14:11 David Cole Status new => assigned
2010-02-12 14:11 David Cole Assigned To => David Cole
2010-02-12 14:13 David Cole Note Added: 0019521
2010-02-12 14:13 David Cole Status assigned => resolved
2010-02-12 14:13 David Cole Resolution open => fixed
2010-02-12 15:01 David Cole Status resolved => feedback
2010-02-12 15:01 David Cole Resolution fixed => reopened
2010-02-12 15:02 David Cole Note Added: 0019522
2010-02-12 15:02 David Cole Status feedback => resolved
2010-02-12 15:02 David Cole Resolution reopened => fixed
2010-02-12 16:21 David Cole Status resolved => feedback
2010-02-12 16:21 David Cole Resolution fixed => reopened
2010-02-12 16:21 David Cole Relationship added related to 0006195
2010-02-12 16:21 David Cole Status feedback => resolved
2010-02-12 16:21 David Cole Resolution reopened => fixed
2010-03-30 11:08 David Cole Status resolved => feedback
2010-03-30 11:08 David Cole Resolution fixed => reopened
2010-03-30 11:09 David Cole Note Added: 0020033
2010-03-30 11:09 David Cole Status feedback => resolved
2010-03-30 11:09 David Cole Resolution reopened => fixed
2010-06-03 13:20 Brad King Relationship added related to 0010722
2010-12-14 18:50 David Cole Note Added: 0024111
2010-12-14 18:50 David Cole Status resolved => closed
2011-02-08 14:29 David Cole Relationship added related to 0008915
2011-02-08 14:33 David Cole Relationship added related to 0009271
2011-02-08 14:33 David Cole Relationship added related to 0008179
2011-02-08 14:34 David Cole Relationship added related to 0002582
2011-02-08 14:34 David Cole Relationship added related to 0008178


Copyright © 2000 - 2018 MantisBT Team