Document CMAKE_CXX_STANDARD
This variable is a CMake community standard to set the C++
standard of a build. Document it in favor of the previous variable,
which stays as a legacy flag for existing projects.
https://cmake.org/cmake/help/v3.17/variable/CMAKE_CXX_STANDARD.html
diff --git a/docs/compiling.rst b/docs/compiling.rst
index c50c7d8..ea8d1ec 100644
--- a/docs/compiling.rst
+++ b/docs/compiling.rst
@@ -105,18 +105,14 @@
available. Note, however, that this default is subject to change: future
pybind11 releases are expected to migrate to newer C++ standards as they become
available. To override this, the standard flag can be given explicitly in
-``PYBIND11_CPP_STANDARD``:
+`CMAKE_CXX_STANDARD <https://cmake.org/cmake/help/v3.17/variable/CMAKE_CXX_STANDARD.html>`_:
.. code-block:: cmake
# Use just one of these:
- # GCC/clang:
- set(PYBIND11_CPP_STANDARD -std=c++11)
- set(PYBIND11_CPP_STANDARD -std=c++14)
- set(PYBIND11_CPP_STANDARD -std=c++1z) # Experimental C++17 support
- # MSVC:
- set(PYBIND11_CPP_STANDARD /std:c++14)
- set(PYBIND11_CPP_STANDARD /std:c++latest) # Enables some MSVC C++17 features
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD 14)
+ set(CMAKE_CXX_STANDARD 17) # Experimental C++17 support
add_subdirectory(pybind11) # or find_package(pybind11)