[CMake] Asking CMake to setup compiler for c++11

Craig Scott audiofanatic at gmail.com
Wed Oct 21 17:18:28 EDT 2015


> ---------- Forwarded message ----------
> From: Dan Kegel <dank at kegel.com>
> To: Chris Stankevitz <chrisstankevitz at gmail.com>
> Cc: cmake <cmake at cmake.org>
> Date: Wed, 21 Oct 2015 12:54:44 -0700
> Subject: Re: [CMake] Asking CMake to setup compiler for c++11
> Something like
>
> CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
> SET(CMAKE_CXX_STANDARD 11)
>
> I think.
>
> On Wed, Oct 21, 2015 at 12:43 PM, Chris Stankevitz
> <chrisstankevitz at gmail.com> wrote:
> > Hi,
> >
> > Q: What is the "CMake way" to ask that the compiler be setup for c++11?
> >
> > FYI I could not find the answer at
> > https://cmake.org/cmake/help/v3.4/search.html?q=c%2B%2B11
> >
>
>
Dan's answer is heading down the right track. Unfortunately, there is some
unexpected behaviour in certain situations, such as when the compiler
doesn't actually support C++11. For a full explanation of how to set up for
C++11, see this article:

http://crascit.com/2015/03/28/enabling-cxx11-in-cmake/


-- 
Craig Scott
Melbourne, Australia
http://crascit.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151022/6a8aa9f4/attachment.html>


More information about the CMake mailing list