diff --git a/CMakeLists.txt b/CMakeLists.txt index 6202498..b4a28a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,17 @@ #Minimum required CMake Version cmake_minimum_required(VERSION 2.8.12) +# Only set the cxx_standard if it is not set by someone else +if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +# strongly encouraged to enable this globally to avoid conflicts between +# -Wpedantic being enabled and -std=c++20 and -std=gnu++20 for example +# when compiling with PCH enabled +set(CMAKE_CXX_EXTENSIONS OFF) + + #Project Name PROJECT(NCXX C CXX) set(PACKAGE "netcdf-cxx4" CACHE STRING "")