I have a solution for the problem of creating XCode 3.2.x project on a 10.6 machine that are to target the 10.4u SDK. Here's what I did (thanks to the OGRE and Open Scene Graph projects - which exposed me to this solution). WARNING: my solution assumes a 32 bit build, so here goes: Here's how: put this right at the top of the CMakeLists.txt - in my case, the very top level one. if (APPLE) # Force gcc <= 4.0 on Mac OS X because 4.2 is not supported prior to Mac OS X 10.5 include(CMakeForceCompiler) CMAKE_FORCE_C_COMPILER(gcc-4.0 GNU) CMAKE_FORCE_CXX_COMPILER(g++-4.0 GNU) SET(CMAKE_SIZEOF_VOID_P 4) endif () set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0") so, what's it do?? the FORCE_C_COMPILER stuff is going to ensure that the 4.0 series GCC compiler is picked up, which is really useful when the compiler-test phases of cmake get run. What isn't obvious though is that when this is done, some tests the ptr size are NOT carried out any longer, which impacted our project - so here's the caveat: I'm forcing the CMAKE_SIZEOF_VOID_P to 4, which means the rest of our codebase goes with a 32 bit build. For me, not a problem - for you - good luck :-) The CMAKE_XCODE_ATTRIBUTE_GCC_VERSION is *also* required. This forces the GCC_VERSION attribute within the xcode configuration to be 4.0 instead of 4.2 (assuming build platform of 10.6). Take note; if you leave the CMAKE_XCODE_ATTRIBUTE_GCC_VERSION out - then the Xcode GCC version will *still be 4.2* - so you need both of these settings in the CMakeLists.txt file. If anyone can improve on this - I'd appreciate it, thanks for all your help and good luck with those 10.4u builds from a 10.6.x machine! John Clayton --------------------------- FileWave (Europe) GmbH St. Gallerstrasse 1 CH - 9500 Wil Phone: +41 71 914 30 80 Fax: +41 71 914 30 81 Web: www.filewave.com Skype: johncclayton On 03.01.2011, at 14:36, John Clayton wrote:
|
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake