summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-08 15:27:53 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-08 15:27:53 (GMT)
commit7b3def93b630ee7964b1d33b2b601e07c7797438 (patch)
tree574eca7299af0b5a5898d6aff6b83dc5aef66311 /Help
parent6eafe843ca632eadd896cca95c42420b48e2a9a2 (diff)
parent205215fb8a8aa950026d914377a54ae358a1c02a (diff)
downloadCMake-7b3def93b630ee7964b1d33b2b601e07c7797438.zip
CMake-7b3def93b630ee7964b1d33b2b601e07c7797438.tar.gz
CMake-7b3def93b630ee7964b1d33b2b601e07c7797438.tar.bz2
Merge topic 'decay-language-version'
205215fb cmTarget: Add CXX_STANDARD_REQUIRED to control decay. 1df2116b Features: Decay language flag if requested is not available. c4f4dac2 Project: Fix exit-on-error with compile feature tests. 5bb7ce72 Project: Use nullary form of main for compile feature tests. 64254e7a Project: Remove extern from static string in feature tests. 0d9c99bf Help: Fix order of help entries. dc7639bd Tests: Fix name of cache variable.
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-properties.7.rst3
-rw-r--r--Help/manual/cmake-variables.7.rst3
-rw-r--r--Help/prop_tgt/CXX_STANDARD.rst17
-rw-r--r--Help/prop_tgt/CXX_STANDARD_REQUIRED.rst14
-rw-r--r--Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst8
5 files changed, 41 insertions, 4 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index da21e29..14d2e7f 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -108,8 +108,9 @@ Properties on Targets
/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/CONFIG_OUTPUT_NAME
/prop_tgt/CONFIG_POSTFIX
- /prop_tgt/CXX_STANDARD
/prop_tgt/CXX_EXTENSIONS
+ /prop_tgt/CXX_STANDARD
+ /prop_tgt/CXX_STANDARD_REQUIRED
/prop_tgt/DEBUG_POSTFIX
/prop_tgt/DEFINE_SYMBOL
/prop_tgt/EchoString
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 82242f5..7313cd1 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -258,8 +258,9 @@ Variables for Languages
/variable/CMAKE_COMPILER_IS_GNULANG
/variable/CMAKE_CXX_COMPILE_FEATURES
- /variable/CMAKE_CXX_STANDARD
/variable/CMAKE_CXX_EXTENSIONS
+ /variable/CMAKE_CXX_STANDARD
+ /variable/CMAKE_CXX_STANDARD_REQUIRED
/variable/CMAKE_Fortran_MODDIR_DEFAULT
/variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG
diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst
index e1b6e78..fdd5aac 100644
--- a/Help/prop_tgt/CXX_STANDARD.rst
+++ b/Help/prop_tgt/CXX_STANDARD.rst
@@ -1,14 +1,27 @@
CXX_STANDARD
------------
-The C++ standard whose features are required to build this target.
+The C++ standard whose features are requested to build this target.
-This property specifies the C++ standard whose features are required
+This property specifies the C++ standard whose features are requested
to build this target. For some compilers, this results in adding a
flag such as ``-std=c++11`` to the compile line.
Supported values are ``98`` and ``11``.
+If the value requested does not result in a compile flag being added for
+the compiler in use, a previous standard flag will be added instead. This
+means that using:
+
+.. code-block:: cmake
+
+ set_property(TARGET tgt PROPERTY CXX_STANDARD 11)
+
+with a compiler which does not support ``-std=c++11`` or an equivalent
+flag will not result in an error or warning, but will instead add the
+``-std=c++98`` flag if supported. This "decay" behavior may be controlled
+with the :prop_tgt:`CXX_STANDARD_REQUIRED` target property.
+
This property is initialized by the value of
the :variable:`CMAKE_CXX_STANDARD` variable if it is set when a target
is created.
diff --git a/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
new file mode 100644
index 0000000..f082805
--- /dev/null
+++ b/Help/prop_tgt/CXX_STANDARD_REQUIRED.rst
@@ -0,0 +1,14 @@
+CXX_STANDARD_REQUIRED
+---------------------
+
+Boolean describing whether the value of :prop_tgt:`CXX_STANDARD` is a requirement.
+
+If this property is set to ``ON``, then the value of the
+:prop_tgt:`CXX_STANDARD` target property is treated as a requirement. If this
+property is ``OFF`` or unset, the :prop_tgt:`CXX_STANDARD` target property is
+treated as optional and may "decay" to a previous standard if the requested is
+not available.
+
+This property is initialized by the value of
+the :variable:`CMAKE_CXX_STANDARD_REQUIRED` variable if it is set when a
+target is created.
diff --git a/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst
new file mode 100644
index 0000000..ff005da
--- /dev/null
+++ b/Help/variable/CMAKE_CXX_STANDARD_REQUIRED.rst
@@ -0,0 +1,8 @@
+CMAKE_CXX_STANDARD_REQUIRED
+---------------------------
+
+Default value for ``CXX_STANDARD_REQUIRED`` property of targets.
+
+This variable is used to initialize the :prop_tgt:`CXX_STANDARD_REQUIRED`
+property on all targets. See that target property for additional
+information.