[CMake] Clang not using C++11 on Linux

Robert Dailey rcdailey.lists at gmail.com
Sat Jan 17 20:09:38 EST 2015


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 )

However when I build, it fails:

fe at BLD01:~/frontend/build$ make
[  0%] Copying third party binaries
[  0%] Built target copy_dlls
[  0%] Building CXX object
Core/UI/CMakeFiles/UI.dir/Source/Animations/AnimationManager.cpp.o
In file included from
/home/fe/frontend/Core/UI/Source/Animations/AnimationManager.cpp:27:
In file included from /home/fe/frontend/Core/UI/Source/Main/stdinc.h:292:
In file included from /home/fe/frontend/Core/UI/Source/Logs/ErrorLog.h:18:
/home/fe/frontend/Core/UI/Source/Logs/LogLevels.h:18:9: warning:
scoped enumerations are a C++11 extension [-Wc++11-extensions]

How do I get C++11 working?


More information about the CMake mailing list