cmake-examples/01-basic/L-cpp-standard
2020-01-17 19:48:14 -05:00
..
i-common-method spelling fixes 2020-01-17 19:48:14 -05:00
ii-cxx-standard add examples for setting C++ standard 2016-09-04 23:23:28 +01:00
iii-compile-features spelling fixes 2020-01-17 19:48:14 -05:00
README.adoc add examples for setting C++ standard 2016-09-04 23:23:28 +01:00

= C++ Standard

Since the release of C+\+11 and C++14 a common use case is to invoke the compiler to use these standards. As CMake has evolved, it has added features to make this easier and new versions of CMake have changed how this is achieved.

The following examples show different methods of setting the C++ standard and what versions of CMake they are available from.

The examples include:

  - link:i-common-method[common-method]. A simple version that should work with most versions of CMake.
  - link:ii-cxx-standard[cxx-standard]. Using the `CMAKE_CXX_STANDARD` variable introduced in CMake v3.1.
  - link:iii-compile-features[compile-features]. Using the `target_compile_features` function introduced in CMake v3.1.