```cmake
# Enable C++11
if(CMAKE_COMPILER_IS_GNUCXX)
  add_definitions(-std=c++0x)
  add_definitions(-std=c++11)
endif()
```

Add compiler options to clang as well as gcc and msvc
user
```cmake
# Enable C++11
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  # using regular Clang or AppleClang
  add_definitions(-std=c++11)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
  # using GCC
  add_definitions(-std=c++0x)
  add_definitions(-std=c++11)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
  # using Intel C++
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  # using Visual Studio C++
endif()
```
assistant