[CMake] Avoid cmake forcing CMAKE_CXX_COMPILER

Arunachalam Narayanaswamy naraya3 at rpi.edu
Sat Apr 5 14:12:50 EDT 2008


Hi,
    Is there a way to avoid cmake forcing CMAKE_CXX_COMPILER? Here is my 
problem.

I have a compiler and I have an MPI Wrapper written around this 
compiler. I would want to compile ITK with the naked compiler because 
the wrapper has too many optimization flags which would be inappropriate 
for compiling the whole of ITK. But I would want to use the wrapper for 
compiling future projects which use ITK. Whenever I do this, CMake 
forces the compiler to be the compiler used for building ITK. The "dirty 
hack" that I use right now to get around this, is to keep a local copy 
of the wrapper/compiler and rename them as needed to satisfy CMake's 
needs. Is there a better way around this? I'm sure there must be, I just 
dont know what. Also, it seems too naive for CMake to force the exact 
compiler path. It should be using a combination of compiler 
identification string and build system type right?

best
Arun



More information about the CMake mailing list