[CMake] Changing compiler

David Doria daviddoria at gmail.com
Wed Apr 20 07:39:58 EDT 2011


I am trying to build ITK with a non-system-standard compiler. I did so
by running:

ccmake ../../src/ITK/
-DCMAKE_CXX_COMPILER=/home/doriad/src/gcc-4.5.2/bin/gcc/g++

However, I get:

---------------
 CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:45
 (MESSAGE):
   The C++ compiler "/home/doriad/src/gcc-4.5.2/bin/gcc/g++" is not able to
   compile a simple test program.

   It fails with the following output:

    Change Dir: /home/doriad/bin/ITK/CMakeFiles/CMakeTmp



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

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

   gmake[1]: Entering directory `/home/doriad/bin/ITK/CMakeFiles/CMakeTmp'

---------------

This is indeed the correct path for the compiler:

[doriad at daviddesktop ~]$ ~/src/gcc-4.5.2/bin/gcc/g++
g++: no input files

I tried creating a fresh build directory and nothing changed. Any
suggestions of what else to do to use this compiler?

Thanks,

David


More information about the CMake mailing list