Add options to build CMake without any language dialects

If CMake_NO_<LANG>_STANDARD is set, do not set CMAKE_<LANG>_STANDARD.
This will allow users to build with their own -std= flags without
CMake adding any itself.
This commit is contained in:
Brad King 2015-03-10 14:49:40 -04:00
parent 1a8e4c8692
commit 77534e84b2
1 changed files with 2 additions and 2 deletions

View File

@ -37,10 +37,10 @@ if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
endif() endif()
# Use most-recent available language dialects with GNU and Clang # Use most-recent available language dialects with GNU and Clang
if(NOT DEFINED CMAKE_C_STANDARD) if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
endif() endif()
if(NOT DEFINED CMAKE_CXX_STANDARD) if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
endif() endif()