[CMake] Compiler identification?

Nils Gladitz nilsgladitz at gmail.com
Fri Jun 7 09:14:43 EDT 2013


Try ${CMAKE_C_COMPILER_VERSION}.

In the Documentation you can find it as CMAKE_<LANG>_COMPILER_VERSION.

Nils

On 06/07/2013 02:57 PM, Bradley Lowekamp wrote:
> Hello,
>
> I need to detect if MS Visual Studio 9 (2008) has SP1 applied. During configuration I see lines like:
>
> -- The C compiler identification is MSVC 15.0.30729.1
> or
> -- The C compiler identification is MSVC 15.0.21022.8
>
>
> I am wondering if this information is available as a cmake variable. Or is there some other standard module I should be using? Know I can do a try_run to get it... But that seems excessive.
>
> Thanks,
> Brad
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list