[CMake] Where to change default link line on Cmake

Bill Hoffman bill.hoffman at kitware.com
Wed May 5 09:43:06 EDT 2010


On 5/5/2010 9:19 AM, Rene Salmon wrote:

>
> Excellent point. I thought about that right after I hit send to my email.
> The whole reason we are looking at Cmake is so that we give our users more
> flexibility for building our software and not the other way around.  I will
> remove those lines from the Cmake files.
>
> On the other hand we always want to use or default to XLC or XLF on an IBM
> Power machine and not gcc or gfrotran so I can see our users seeing having
> to set CC, CXX etc every time as a bit of a pain.  Sure they can just put
> that in their .bashrs or .cshrc files and forget about it but that is not
> really what we want.
>
> Is there maybe a way to hint to cmake to only use gcc gfortran as a last
> resort or to look for xlc and xlf first and use them always if found instead
> of gcc?
>

No, no way to hint, they can specify that on the command line.

cmake -DCMAKE_CXX_COMPILER=CC

The environment vars do not be around during the build, only the first 
time that you run cmake.

So, you can do this:
CXX=CC cmake ../source

-Bill


More information about the CMake mailing list