[CMake] cmake // how to find out compiler version in CMakeLists.txt
blinkeye
gentoo at blinkeye.ch
Sun Mar 9 06:07:02 EDT 2008
On 03/09/2008 09:18 AM, Sergey Nik wrote:
> Hi all,
>
> I'm looking information how I can determinate GCC version in my
> CMakeLists.txt script.
> After short searching mail list archive I've not found something relevant.
> Is it possible?
>
> Thank you in advance,
> Sergey
>
A combination of EXECUTE_PROCESS and 'gcc -dumpversion' is what you're
looking for. IIRC:
EXECUTE_PROCESS( COMMAND gcc -dumpversion GCC_VERSION )
where GCC_VERSION will be the variable the result is saved in. After
that you'll probably want to make a STRING operation (NOTEQUAL, LESS,
GREATER and so on) with GCC_VERSION ...
More information about the CMake
mailing list