I have the following content in my CMakeLists.txt:
project( Matfile ) SET ( CMAKE_CXX_FLAGS \"-std=c++0x\" ) set ( SOURCES \"foo.cpp\" \"bar.cp
This is the solution I currently use:
if(CMAKE_COMPILER_IS_GNUCXX) add_definitions(-std=c++0x) add_definitions(-std=gnu++11) endif()
Or, if you have an older version of cmake and you want to see it show up in cmake-gui:
set_property(CACHE CMAKE_CXX_FLAGS PROPERTY VALUE "-std=c++0x")