[CMake] GCC: -std=g++14 vs -std=c++14

Sylvain Joubert joubert.sy at gmail.com
Mon Jun 13 12:40:59 EDT 2016


Le 13/06/2016 11:36, Patrick Boettcher a écrit :
> Hi list,
>
> I'm using gcc for a c++14-based project.
>
> To have cmake add the corresponding -std=-flag I'm setting
>
>    set_property(TARGET <tgt> PROPERTY CXX_STANDARD 14)
>
> This makes that when gcc is used cmake adds -std=gnu++14 .
>
> How can I make it set -std=c++14 instead?

Hi,

You also need to correctly set the CXX_EXTENSIONS properties to get a 
standard standard.
You might also want to take a look at the CXX_STANDARD_REQUIRED property.

Sylvain


More information about the CMake mailing list