[CMake] How to use non-default compiler in building a project
Kris Thielemans
kris.thielemans at csc.mrc.ac.uk
Wed Sep 21 12:14:39 EDT 2005
Hi
I'm trying to install ITK on Linux but seem to have a cmake related problem.
However, it might have something to the with how ITK uses cmake, so I
apologise in advance if that's the case.
I do not want to use the default compiler that cmake finds (gcc,c++), but
another version (gcc-3.3, g++-3.3). There are the relevant options
CMAKE_C_COMPILER, CMAKE_CXX_COMPILER that can be set in cmake. However, at
least in ITK, I can reset those only after a first configure, which then
obviously has got it wrong.
I run 'ccmake ../InsightToolkit-2.2.0', and get presented with the question:
CMAKE_BACKWARDS_COMPATIBILITY 2.0
If I then press 'c', a first configuration starts before I get the next
menu. If I stop this process now, I can see that in my CMakeCache.txt, the
above variables are set to gcc and c++. Moreover, it has lots of variables
regarding the capabilities of these compilers, which are potentially
inappropriate for the compilers I later want to use, e.g. in my case
VNL_COMPILER_IS_GNUCXX_2XX:INTERNAL=1
I then get the next 'screen' of options where I can then toggle to advanced
mode. This allows me to reset CMAKE_C_COMPILER etc. However, I now press 'c'
again, at the end of that configure, the CMakeCache.txt still says
VNL_COMPILER_IS_GNUCXX_2XX:INTERNAL=1
I can't correct this even when doing a 'make rebuild_cache' after generation
of the makefiles. (Of course, I can correct it by hand, but who knows what
other variables are incorrect).
Is there anything I can do to get this to work?
Many thanks
Kris Thielemans
Hammersmith Imanet, part of GE Healthcare
London, United Kingdom
More information about the CMake
mailing list