[CMake] Cmake 2.8.4 and gcc 4.6 on OSX

Michael Allen jmallen at gmail.com
Fri May 6 10:51:57 EDT 2011


Hi guys,
I've installed a newer version of gcc because the version supplied by
Apple is so far out of date, but I don't know how to configure cmake
such that it uses the normal gcc flags instead of the
Apple specific flags. Is there a way to configure cmake to use the
appropriate flags even though I'm not using the "normal" compiler?



When I try to build my project I receive the following output:


CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52
(MESSAGE):
  The C compiler "/usr/local/bin/gcc" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: /Users/michael/projects/master/o9d/python_cpp_tools/build_dir/buildc4c0eb7d9810705c0dd38b1162f24a89/module_183cd54f21e9b9574d2c791d03adc680/CMakeFiles/CMakeTmp


  Run Build Command:/usr/bin/make "cmTryCompileExec/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  /usr/local/bin/cmake -E cmake_progress_report
  /Users/michael/projects/master/o9d/python_cpp_tools/build_dir/buildc4c0eb7d9810705c0dd38b1162f24a89/module_183cd54f21e9b9574d2c791d03adc680/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o

  /usr/local/bin/gcc -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
  /Users/michael/projects/master/o9d/python_cpp_tools/build_dir/buildc4c0eb7d9810705c0dd38b1162f24a89/module_183cd54f21e9b9574d2c791d03adc680/CMakeFiles/CMakeTmp/testCCompiler.c


  gcc: error: x86_64: No such file or directory

  gcc: error: unrecognized option ‘-arch’

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o] Error 1

  make: *** [cmTryCompileExec/fast] Error 2





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


make: *** No targets specified and no makefile found.  Stop.


More information about the CMake mailing list