[CMake] detecting if c++11 available

Todd Greer TGreer at affinegy.com
Thu Feb 21 11:28:39 EST 2013


You might consider using code from Boost's config subsystem. There's a list of dozens of macros they define to set what features are available in what compilers here: http://www.boost.org/doc/libs/1_53_0/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_c__11_features_not_supported

--
Todd Greer
Principal Scientist, Affinegy, Inc.

-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Theodore Papadopoulo
Sent: Wednesday, February 20, 2013 4:16 AM
To: Benjamin Eikel
Cc: cmake at cmake.org
Subject: Re: [CMake] detecting if c++11 available

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nowadays, asking for c++-11 is probably too coarse as implementations are usually uncomplete. So you have a stdc++-11 switch and still missing some features on which you rely.

Another technique is to test features instead of the whole standard, that would be more robust...

I did something like that to get a cmake build of a library used to build with automake/autoconf (which have such a facility). It might not be very complicated to extend to new features....

	Theo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlEkolIACgkQEr8WrU8nPV2AGgCgoXf6NcHIltBs2RuF4XLDcIgk
k0EAn3XVl5xsgaAw6SU2ZUugnj7OdKQL
=YSl4
-----END PGP SIGNATURE-----


More information about the CMake mailing list