Setting the C++ standard directly
The simplest way to use a particular C++ standard in your project is to add the following two variable definitions before you define any targets:
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
See CXX_STANDARD help.