From 77534e84b27701e371ccee780be5acffe7cced59 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Mar 2015 14:49:40 -0400 Subject: [PATCH] Add options to build CMake without any language dialects If CMake_NO__STANDARD is set, do not set CMAKE__STANDARD. This will allow users to build with their own -std= flags without CMake adding any itself. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1250a9477..d86ae96cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,10 +37,10 @@ if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") endif() # 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) endif() -if(NOT DEFINED CMAKE_CXX_STANDARD) +if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD) set(CMAKE_CXX_STANDARD 14) endif()