[CMake] Using try_compile before project() command

Bill Hoffman bill.hoffman at kitware.com
Wed Jul 16 08:20:30 EDT 2008


Carminati Federico wrote:
> Hello,
>    my use case is similar. My package depends on another one that can be 
> installed with different compiler choices. So the first action I take is 
> always to check the compiler used to install the other package and then 
> to use the same. I could obviously do
> 
> export CXX=`root-config --cxx` ; export CC=`root-config -cc` ;  cmake .
> 
> but I would really prefer to do everything inside the CMakeLists.txt. 
> This is easy to do with the Fortran compiler, as I enable Fortran after 
> having chosen the compiler. For the moment i set also the c and cxx 
> compilers and it works, but this is explicitly "deprecated" by the CMake 
> doc. BEst,

You might want to wrap cmake into a script of some sort for that machine.

-Bill


More information about the CMake mailing list