<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ah, the bug didn&#8217;t say that it had been released yet, just that
it was in cvs.&nbsp; Sorry for the trouble.&nbsp; Thanks!<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> David Cole
[mailto:david.cole@kitware.com] <br>
<b>Sent:</b> Tuesday, March 30, 2010 7:59<br>
<b>To:</b> Simmons, Aaron<br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] working around gcc version bug in xocde generator<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>With CMake 2.8.1, you can, in your CMakeLists.txt file:<o:p></o:p></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION
&quot;4.2&quot;)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Or, more precisely:<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION&nbsp;&quot;com.apple.compilers.gcc.4_2&quot;)<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>This is part of the bug fix for&nbsp;<a
href="http://public.kitware.com/Bug/view.php?id=9125" target="_blank">http://public.kitware.com/Bug/view.php?id=9125</a>
which was included in the 2.8.1 release (rc3 and later...).<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>It is Xcode-generator specific, though, and has no effect on
generated files for other build systems.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>HTH,<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>David<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>On Mon, Mar 29, 2010 at 4:12 PM, Simmons, Aaron &lt;<a
href="mailto:asimmons@rosettastone.com" target="_blank">asimmons@rosettastone.com</a>&gt;
wrote:<o:p></o:p></p>

<p class=MsoNormal>My project requires using gcc 4.0 when compiling on Mac OS
X, as it has to support 10.4. &nbsp;This works fine for the makefile generator,
but it breaks with the XCode generator for Xcode 3.2 as the default gcc is
v4.2.<br>
<br>
Other posts on this list indicates that it's a bug in the Xcode generator.
&nbsp;I would like to workaround this issue somehow until a new version of
cmake is released.<br>
<br>
One poster suggested using gcc's -V option, which allows forcing the gcc
version. &nbsp;I've tried injecting this into the CMAKE_CXX_FLAGS like this:<br>
&nbsp; &nbsp; &nbsp; &nbsp;if (${CMAKE_GENERATOR} MATCHES &quot;Xcode&quot;)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set(CMAKE_CXX_FLAGS &quot;-V 4.0
${CMAKE_CXX_FLAGS}&quot;)<br>
&nbsp; &nbsp; &nbsp; &nbsp;endif(${CMAKE_GENERATOR} MATCHES &quot;Xcode&quot;)<br>
<br>
However, this creates a new error:<br>
&nbsp; &nbsp; &nbsp; &nbsp;'-V' must come at the start of the command line<br>
<br>
It seems that the CMAKE_CXX_FLAGS are always appended to the constructed gcc
command. &nbsp;Is there some way that I can prepend flags (that is, put them at
the very beginning of the command-line)?<br>
<br>
<br>
Thanks,<br>
aaron<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a
href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</body>

</html>