Am Samstag, 17. Januar 2015, 19:09:38 schrieb Robert Dailey:
> I'm running a custom built CMake 3.1 on Ubuntu Server 12. I have Clang
> 3.4 installed. At the top of my root CMakeLists.txt, I have enabled
> C++11 like so:
> 
> cmake_minimum_required( VERSION 3.1 )
> if( UNIX )
>     set( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++" )
> endif()
> project( FrontEnd )

[…]

> How do I get C++11 working?

Set the compiler flags after project(). The compiler is detected in project(), 
and then CMake initializes all the flag variables, so you changes will get 
overwritten.

If you just want to enable C++11 with CMake 3.1 then do

 set(CMAKE_CXX_STANDARD 11)

after the project call and CMake will take care of the rest.

Greetings,

Eike

Attachment: signature.asc
Description: This is a digitally signed message part.

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to