[CMake] infinite loop when trying to change the compiler in CMakeLists.txt

Eric Noulard eric.noulard at gmail.com
Thu Nov 5 16:00:55 EST 2009


2009/11/5  <bthomas at nexus.hu>:
> Dear All,
>
> I am managing a CFD code where wish to set the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to openmpi
> wrappers.
>
> So far i was using cmake 2.4.7 and in the CMakeLists.txt the following lines were working perfectly:
> SET(CMAKE_C_COMPILER ${MPI_INSTALL_ROOT}/bin/mpicc )
> SET(CMAKE_CXX_COMPILER ${MPI_INSTALL_ROOT}/bin/mpic++ )

You usually should not do it that way but let CMake discover them, from
a typical command line:

CC=/path/to/mpicc CXX=/path/to/mpic++ cmake /to/build/tree

see:
http://www.cmake.org/Wiki/CMake_Useful_Variables#Compilers_and_Tools
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list