summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-10 14:49:40 -0400
committerBrad King <brad.king@kitware.com>2015-03-10 14:49:40 -0400
commit77534e84b27701e371ccee780be5acffe7cced59 (patch)
tree922e195b897e4e3fe52d2bc65b7c377ec11d75ef /CMakeLists.txt
parent1a8e4c86921e8b018be950924dc54c532134feb5 (diff)
downloadcmake-77534e84b27701e371ccee780be5acffe7cced59.tar.gz
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1250a94775..d86ae96cc7 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()