[CMake] 2.8/3.0: CMAKE_FORCE_C_COMPILER semantics

Alexander Neundorf a.neundorf-work at gmx.net
Sun Apr 13 11:56:33 EDT 2014


On Sunday, April 13, 2014 12:12:10 Rolf Eike Beer wrote:
> > include (CMakeForceCompiler)
> > CMAKE_FORCE_C_COMPILER (gcc gcc)
> > CMAKE_FORCE_CXX_COMPILER (g++ g++)
> 
> A more general question: is there any reason one would have to force a
> compiler in a toolchain file? Just set CMAKE_*_COMPILER to the path, that
> should be all that is needed, no? I've seen this multiple times and I wonder
> if that makes any sense at all.

sometimes there is a lot of stuff needed, especially when crosscompiling, just 
to get the compiler compile a source file. In these cases this is useful.
But this should be very rare IMO, usually it is not needed.

Alex



More information about the CMake mailing list