If you are setting the CXX compiler, you should also probably be setting the C compiler.<br><br>I always use environment variables to do this:<br><br>  export CC=/home/doriad/src/gcc-4.5.2/bin/gcc/gcc<br>  export CXX=/home/doriad/src/gcc-4.5.2/bin/gcc/g++<br>
  ccmake ../../src/ITK<br>
<br>If that still doesn&#39;t work, then inspect the contents of the file CMakeFiles/CMakeError.log to see what the actual errors are, and post them here. (CMakeFiles/CMakeOutput.log may also have relevant results in it...)<br>
<br><br>HTH,<br>David C.<br><br><br><div class="gmail_quote">On Wed, Apr 20, 2011 at 7:39 AM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am trying to build ITK with a non-system-standard compiler. I did so<br>
by running:<br>
<br>
ccmake ../../src/ITK/<br>
-DCMAKE_CXX_COMPILER=/home/doriad/src/gcc-4.5.2/bin/gcc/g++<br>
<br>
However, I get:<br>
<br>
---------------<br>
 CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:45<br>
 (MESSAGE):<br>
   The C++ compiler &quot;/home/doriad/src/gcc-4.5.2/bin/gcc/g++&quot; is not able to<br>
   compile a simple test program.<br>
<br>
   It fails with the following output:<br>
<br>
    Change Dir: /home/doriad/bin/ITK/CMakeFiles/CMakeTmp<br>
<br>
<br>
<br>
   Run Build Command:/usr/bin/gmake &quot;cmTryCompileExec/fast&quot;<br>
<br>
   /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make<br>
   CMakeFiles/cmTryCompileExec.dir/build<br>
<br>
   gmake[1]: Entering directory `/home/doriad/bin/ITK/CMakeFiles/CMakeTmp&#39;<br>
<br>
---------------<br>
<br>
This is indeed the correct path for the compiler:<br>
<br>
[doriad@daviddesktop ~]$ ~/src/gcc-4.5.2/bin/gcc/g++<br>
g++: no input files<br>
<br>
I tried creating a fresh build directory and nothing changed. Any<br>
suggestions of what else to do to use this compiler?<br>
<br>
Thanks,<br>
<br>
David<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>