[CMake] FindMPI and setting C/C++ compiler

Marcel Loose loose at astron.nl
Wed May 26 11:20:24 EDT 2010


Hi all,

I was wondering how one should use find_package(MPI) to properly set the
C/C++ compiler(s). Normally, you call find_package() after the project()
command. However, by that time the CMAKE_<LANG>_COMPILER cache variables
have already been set. Should one FORCE these cache variables to the
value of MPI_COMPILER?

I vaguely remember that setting CMAKE_<LANG>_COMPILER after the
project() statement was a definite no-no, because all kinds of tests,
executed by the project() command, are done with the default C/C++
compilers.

Best regards,
Marcel Loose.




More information about the CMake mailing list