With CMake 2.8.1, you can, in your CMakeLists.txt file:<div>set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.2")<br><br></div><div>Or, more precisely:</div><div>set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.gcc.4_2")</div>
<div>
<br></div><div>This is part of the bug fix for <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...).</div>
<div><br></div><div>It is Xcode-generator specific, though, and has no effect on generated files for other build systems.</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">
On Mon, Mar 29, 2010 at 4:12 PM, Simmons, Aaron <span dir="ltr"><<a href="mailto:asimmons@rosettastone.com" target="_blank">asimmons@rosettastone.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My project requires using gcc 4.0 when compiling on Mac OS X, as it has to support 10.4. 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. 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. I've tried injecting this into the CMAKE_CXX_FLAGS like this:<br>
if (${CMAKE_GENERATOR} MATCHES "Xcode")<br>
set(CMAKE_CXX_FLAGS "-V 4.0 ${CMAKE_CXX_FLAGS}")<br>
endif(${CMAKE_GENERATOR} MATCHES "Xcode")<br>
<br>
However, this creates a new error:<br>
'-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. 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><br>
</blockquote></div><br></div>