[Cmake-commits] CMake branch, next, updated. v3.2.2-2567-gdcce21d

Stephen Kelly steveire at gmail.com
Wed May 6 02:02:03 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  dcce21d77e98066a420e28a253f112443002e8d0 (commit)
       via  6b707e196485bb00397c7152c388de64164f2c09 (commit)
      from  dd08530978146a806014c6778f472db667899378 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dcce21d77e98066a420e28a253f112443002e8d0
commit dcce21d77e98066a420e28a253f112443002e8d0
Merge: dd08530 6b707e1
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed May 6 02:02:02 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed May 6 02:02:02 2015 -0400

    Merge topic 'improve-policies-documentation' into next
    
    6b707e19 Help: Extract Policy doc subtitles from cmPolicies.h


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6b707e196485bb00397c7152c388de64164f2c09
commit 6b707e196485bb00397c7152c388de64164f2c09
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue May 5 18:45:15 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Wed May 6 08:01:36 2015 +0200

    Help: Extract Policy doc subtitles from cmPolicies.h
    
    Add a new cmake-policy directive and use it in each policy
    document.  Add API to cmPolicies to access it, and teach cmRST to
    process the new directive.
    
    Extend the data table in cmPolicies to include an optional RST formatted
    string.  The documentation used in the cmake-policies toctree must
    be unformatted so limited duplication (in one file, instead of
    spread among multiple files) seems to be the correct approach.
    
    Extend the create-policy-list.py script to extract the RST formatted
    text, and use it if present.

diff --git a/Help/policy/CMP0000.rst b/Help/policy/CMP0000.rst
index 9fbf842..e3c00e8a 100644
--- a/Help/policy/CMP0000.rst
+++ b/Help/policy/CMP0000.rst
@@ -1,7 +1,7 @@
 CMP0000
 -------
 
-A minimum required CMake version must be specified.
+.. cmake-policy:: CMP0000
 
 CMake requires that projects specify the version of CMake to which
 they have been written.  This policy has been put in place so users
diff --git a/Help/policy/CMP0001.rst b/Help/policy/CMP0001.rst
index 344f1e2..34d2f7d 100644
--- a/Help/policy/CMP0001.rst
+++ b/Help/policy/CMP0001.rst
@@ -1,7 +1,7 @@
 CMP0001
 -------
 
-CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.
+.. cmake-policy:: CMP0001
 
 The OLD behavior is to check CMAKE_BACKWARDS_COMPATIBILITY and present
 it to the user.  The NEW behavior is to ignore
diff --git a/Help/policy/CMP0002.rst b/Help/policy/CMP0002.rst
index 2c15bd4..105d1ee 100644
--- a/Help/policy/CMP0002.rst
+++ b/Help/policy/CMP0002.rst
@@ -1,7 +1,7 @@
 CMP0002
 -------
 
-Logical target names must be globally unique.
+.. cmake-policy:: CMP0002
 
 Targets names created with add_executable, add_library, or
 add_custom_target are logical build target names.  Logical target
diff --git a/Help/policy/CMP0003.rst b/Help/policy/CMP0003.rst
index 27b83f8..7c5007f 100644
--- a/Help/policy/CMP0003.rst
+++ b/Help/policy/CMP0003.rst
@@ -1,7 +1,7 @@
 CMP0003
 -------
 
-Libraries linked via full path no longer produce linker search paths.
+.. cmake-policy:: CMP0003
 
 This policy affects how libraries whose full paths are NOT known are
 found at link time, but was created due to a change in how CMake deals
diff --git a/Help/policy/CMP0004.rst b/Help/policy/CMP0004.rst
index 80045f5..b06e214 100644
--- a/Help/policy/CMP0004.rst
+++ b/Help/policy/CMP0004.rst
@@ -1,7 +1,7 @@
 CMP0004
 -------
 
-Libraries linked may not have leading or trailing whitespace.
+.. cmake-policy:: CMP0004
 
 CMake versions 2.4 and below silently removed leading and trailing
 whitespace from libraries linked with code like
diff --git a/Help/policy/CMP0005.rst b/Help/policy/CMP0005.rst
index c11a9e6..b86f550 100644
--- a/Help/policy/CMP0005.rst
+++ b/Help/policy/CMP0005.rst
@@ -1,7 +1,7 @@
 CMP0005
 -------
 
-Preprocessor definition values are now escaped automatically.
+.. cmake-policy:: CMP0005
 
 This policy determines whether or not CMake should generate escaped
 preprocessor definition values added via add_definitions.  CMake
diff --git a/Help/policy/CMP0006.rst b/Help/policy/CMP0006.rst
index 8d1e5bd..abce5c5 100644
--- a/Help/policy/CMP0006.rst
+++ b/Help/policy/CMP0006.rst
@@ -1,7 +1,7 @@
 CMP0006
 -------
 
-Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.
+.. cmake-policy:: CMP0006
 
 This policy determines whether the install(TARGETS) command must be
 given a BUNDLE DESTINATION when asked to install a target with the
diff --git a/Help/policy/CMP0007.rst b/Help/policy/CMP0007.rst
index f0d8c16..7cbc47d 100644
--- a/Help/policy/CMP0007.rst
+++ b/Help/policy/CMP0007.rst
@@ -1,7 +1,7 @@
 CMP0007
 -------
 
-list command no longer ignores empty elements.
+.. cmake-policy:: CMP0007
 
 This policy determines whether the list command will ignore empty
 elements in the list.  CMake 2.4 and below list commands ignored all
diff --git a/Help/policy/CMP0008.rst b/Help/policy/CMP0008.rst
index b118ece..a02493e 100644
--- a/Help/policy/CMP0008.rst
+++ b/Help/policy/CMP0008.rst
@@ -1,7 +1,7 @@
 CMP0008
 -------
 
-Libraries linked by full-path must have a valid library file name.
+.. cmake-policy:: CMP0008
 
 In CMake 2.4 and below it is possible to write code like
 
diff --git a/Help/policy/CMP0009.rst b/Help/policy/CMP0009.rst
index 481af1a..f0a209e 100644
--- a/Help/policy/CMP0009.rst
+++ b/Help/policy/CMP0009.rst
@@ -1,7 +1,7 @@
 CMP0009
 -------
 
-FILE GLOB_RECURSE calls should not follow symlinks by default.
+.. cmake-policy:: CMP0009
 
 In CMake 2.6.1 and below, FILE GLOB_RECURSE calls would follow through
 symlinks, sometimes coming up with unexpectedly large result sets
diff --git a/Help/policy/CMP0010.rst b/Help/policy/CMP0010.rst
index 9d2eb76..1cf549b 100644
--- a/Help/policy/CMP0010.rst
+++ b/Help/policy/CMP0010.rst
@@ -1,7 +1,7 @@
 CMP0010
 -------
 
-Bad variable reference syntax is an error.
+.. cmake-policy:: CMP0010
 
 In CMake 2.6.2 and below, incorrect variable reference syntax such as
 a missing close-brace ("${FOO") was reported but did not stop
diff --git a/Help/policy/CMP0011.rst b/Help/policy/CMP0011.rst
index 0f41fff..1ca4ff1 100644
--- a/Help/policy/CMP0011.rst
+++ b/Help/policy/CMP0011.rst
@@ -1,7 +1,7 @@
 CMP0011
 -------
 
-Included scripts do automatic cmake_policy PUSH and POP.
+.. cmake-policy:: CMP0011
 
 In CMake 2.6.2 and below, CMake Policy settings in scripts loaded by
 the include() and find_package() commands would affect the includer.
diff --git a/Help/policy/CMP0012.rst b/Help/policy/CMP0012.rst
index 7a749bf..63d1a52 100644
--- a/Help/policy/CMP0012.rst
+++ b/Help/policy/CMP0012.rst
@@ -1,7 +1,7 @@
 CMP0012
 -------
 
-if() recognizes numbers and boolean constants.
+.. cmake-policy:: CMP0012
 
 In CMake versions 2.6.4 and lower the if() command implicitly
 dereferenced arguments corresponding to variables, even those named
diff --git a/Help/policy/CMP0013.rst b/Help/policy/CMP0013.rst
index e99997b..a6ec06a 100644
--- a/Help/policy/CMP0013.rst
+++ b/Help/policy/CMP0013.rst
@@ -1,7 +1,7 @@
 CMP0013
 -------
 
-Duplicate binary directories are not allowed.
+.. cmake-policy:: CMP0013
 
 CMake 2.6.3 and below silently permitted add_subdirectory() calls to
 create the same binary directory multiple times.  During build system
diff --git a/Help/policy/CMP0014.rst b/Help/policy/CMP0014.rst
index 37178d1..8c34caa 100644
--- a/Help/policy/CMP0014.rst
+++ b/Help/policy/CMP0014.rst
@@ -1,7 +1,7 @@
 CMP0014
 -------
 
-Input directories must have CMakeLists.txt.
+.. cmake-policy:: CMP0014
 
 CMake versions before 2.8 silently ignored missing CMakeLists.txt
 files in directories referenced by add_subdirectory() or subdirs(),
diff --git a/Help/policy/CMP0015.rst b/Help/policy/CMP0015.rst
index 1b54979..5067e03 100644
--- a/Help/policy/CMP0015.rst
+++ b/Help/policy/CMP0015.rst
@@ -1,7 +1,7 @@
 CMP0015
 -------
 
-link_directories() treats paths relative to the source dir.
+.. cmake-policy:: CMP0015
 
 In CMake 2.8.0 and lower the link_directories() command passed
 relative paths unchanged to the linker.  In CMake 2.8.1 and above the
diff --git a/Help/policy/CMP0016.rst b/Help/policy/CMP0016.rst
index 743b1a9..c818da3 100644
--- a/Help/policy/CMP0016.rst
+++ b/Help/policy/CMP0016.rst
@@ -1,7 +1,7 @@
 CMP0016
 -------
 
-target_link_libraries() reports error if its only argument is not a target.
+.. cmake-policy:: CMP0016
 
 In CMake 2.8.2 and lower the target_link_libraries() command silently
 ignored if it was called with only one argument, and this argument
diff --git a/Help/policy/CMP0017.rst b/Help/policy/CMP0017.rst
index f74e6f0..01b7d93 100644
--- a/Help/policy/CMP0017.rst
+++ b/Help/policy/CMP0017.rst
@@ -1,7 +1,7 @@
 CMP0017
 -------
 
-Prefer files from the CMake module directory when including from there.
+.. cmake-policy:: CMP0017
 
 Starting with CMake 2.8.4, if a cmake-module shipped with CMake (i.e.
 located in the CMake module directory) calls include() or
diff --git a/Help/policy/CMP0018.rst b/Help/policy/CMP0018.rst
index 0f68267..1ebea5e 100644
--- a/Help/policy/CMP0018.rst
+++ b/Help/policy/CMP0018.rst
@@ -1,7 +1,7 @@
 CMP0018
 -------
 
-Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.
+.. cmake-policy:: CMP0018
 
 CMake 2.8.8 and lower compiled sources in SHARED and MODULE libraries
 using the value of the undocumented CMAKE_SHARED_LIBRARY_<Lang>_FLAGS
diff --git a/Help/policy/CMP0019.rst b/Help/policy/CMP0019.rst
index 2b37fa1..114c5fc 100644
--- a/Help/policy/CMP0019.rst
+++ b/Help/policy/CMP0019.rst
@@ -1,7 +1,7 @@
 CMP0019
 -------
 
-Do not re-expand variables in include and link information.
+.. cmake-policy:: CMP0019
 
 CMake 2.8.10 and lower re-evaluated values given to the
 include_directories, link_directories, and link_libraries commands to
diff --git a/Help/policy/CMP0020.rst b/Help/policy/CMP0020.rst
index 6767d08..4e4476c 100644
--- a/Help/policy/CMP0020.rst
+++ b/Help/policy/CMP0020.rst
@@ -1,7 +1,7 @@
 CMP0020
 -------
 
-Automatically link Qt executables to qtmain target on Windows.
+.. cmake-policy:: CMP0020
 
 CMake 2.8.10 and lower required users of Qt to always specify a link
 dependency to the qtmain.lib static library manually on Windows.
diff --git a/Help/policy/CMP0021.rst b/Help/policy/CMP0021.rst
index 3f5bd03..18f2b40 100644
--- a/Help/policy/CMP0021.rst
+++ b/Help/policy/CMP0021.rst
@@ -1,7 +1,7 @@
 CMP0021
 -------
 
-Fatal error on relative paths in INCLUDE_DIRECTORIES target property.
+.. cmake-policy:: CMP0021
 
 CMake 2.8.10.2 and lower allowed the INCLUDE_DIRECTORIES target
 property to contain relative paths.  The base path for such relative
diff --git a/Help/policy/CMP0022.rst b/Help/policy/CMP0022.rst
index 22c7c4f..b8d6ecb 100644
--- a/Help/policy/CMP0022.rst
+++ b/Help/policy/CMP0022.rst
@@ -1,7 +1,7 @@
 CMP0022
 -------
 
-INTERFACE_LINK_LIBRARIES defines the link interface.
+.. cmake-policy:: CMP0022
 
 CMake 2.8.11 constructed the 'link interface' of a target from
 properties matching ``(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?``.
diff --git a/Help/policy/CMP0023.rst b/Help/policy/CMP0023.rst
index 962b624..5063787 100644
--- a/Help/policy/CMP0023.rst
+++ b/Help/policy/CMP0023.rst
@@ -1,7 +1,7 @@
 CMP0023
 -------
 
-Plain and keyword target_link_libraries signatures cannot be mixed.
+.. cmake-policy:: CMP0023
 
 CMake 2.8.12 introduced the target_link_libraries signature using the
 PUBLIC, PRIVATE, and INTERFACE keywords to generalize the LINK_PUBLIC
diff --git a/Help/policy/CMP0024.rst b/Help/policy/CMP0024.rst
index ee53d5f..b4c4c92 100644
--- a/Help/policy/CMP0024.rst
+++ b/Help/policy/CMP0024.rst
@@ -1,7 +1,7 @@
 CMP0024
 -------
 
-Disallow include export result.
+.. cmake-policy:: CMP0024
 
 CMake 2.8.12 and lower allowed use of the include() command with the
 result of the export() command.  This relies on the assumption that
diff --git a/Help/policy/CMP0025.rst b/Help/policy/CMP0025.rst
index 8d19edf..bfc4687 100644
--- a/Help/policy/CMP0025.rst
+++ b/Help/policy/CMP0025.rst
@@ -1,7 +1,7 @@
 CMP0025
 -------
 
-Compiler id for Apple Clang is now ``AppleClang``.
+.. cmake-policy:: CMP0025
 
 CMake 3.0 and above recognize that Apple Clang is a different compiler
 than upstream Clang and that they have different version numbers.
diff --git a/Help/policy/CMP0026.rst b/Help/policy/CMP0026.rst
index 4889249..5b42a1e 100644
--- a/Help/policy/CMP0026.rst
+++ b/Help/policy/CMP0026.rst
@@ -1,7 +1,7 @@
 CMP0026
 -------
 
-Disallow use of the LOCATION property for build targets.
+.. cmake-policy:: CMP0026
 
 CMake 2.8.12 and lower allowed reading the LOCATION target
 property (and configuration-specific variants) to
diff --git a/Help/policy/CMP0027.rst b/Help/policy/CMP0027.rst
index bedaffe..f2af8ac 100644
--- a/Help/policy/CMP0027.rst
+++ b/Help/policy/CMP0027.rst
@@ -1,7 +1,7 @@
 CMP0027
 -------
 
-Conditionally linked imported targets with missing include directories.
+.. cmake-policy:: CMP0027
 
 CMake 2.8.11 introduced introduced the concept of
 INTERFACE_INCLUDE_DIRECTORIES, and a check at cmake time that the
diff --git a/Help/policy/CMP0028.rst b/Help/policy/CMP0028.rst
index 24889ec..db58231 100644
--- a/Help/policy/CMP0028.rst
+++ b/Help/policy/CMP0028.rst
@@ -1,7 +1,7 @@
 CMP0028
 -------
 
-Double colon in target name means ALIAS or IMPORTED target.
+.. cmake-policy:: CMP0028
 
 CMake 2.8.12 and lower allowed the use of targets and files with double
 colons in target_link_libraries, with some buildsystem generators.
diff --git a/Help/policy/CMP0029.rst b/Help/policy/CMP0029.rst
index 8f58a12..70a8909 100644
--- a/Help/policy/CMP0029.rst
+++ b/Help/policy/CMP0029.rst
@@ -1,7 +1,7 @@
 CMP0029
 -------
 
-The :command:`subdir_depends` command should not be called.
+.. cmake-policy:: CMP0029
 
 The implementation of this command has been empty since December 2001
 but was kept in CMake for compatibility for a long time.
diff --git a/Help/policy/CMP0030.rst b/Help/policy/CMP0030.rst
index 9e31b38..98bc070 100644
--- a/Help/policy/CMP0030.rst
+++ b/Help/policy/CMP0030.rst
@@ -1,7 +1,7 @@
 CMP0030
 -------
 
-The :command:`use_mangled_mesa` command should not be called.
+.. cmake-policy:: CMP0030
 
 This command was created in September 2001 to support VTK before
 modern CMake language and custom command capabilities.  VTK has
diff --git a/Help/policy/CMP0031.rst b/Help/policy/CMP0031.rst
index 6b89558..857eb16 100644
--- a/Help/policy/CMP0031.rst
+++ b/Help/policy/CMP0031.rst
@@ -1,7 +1,7 @@
 CMP0031
 -------
 
-The :command:`load_command` command should not be called.
+.. cmake-policy:: CMP0031
 
 This command was added in August 2002 to allow projects to add
 arbitrary commands implemented in C or C++.  However, it does
diff --git a/Help/policy/CMP0032.rst b/Help/policy/CMP0032.rst
index f394a06..e4e59d5 100644
--- a/Help/policy/CMP0032.rst
+++ b/Help/policy/CMP0032.rst
@@ -1,7 +1,7 @@
 CMP0032
 -------
 
-The :command:`output_required_files` command should not be called.
+.. cmake-policy:: CMP0032
 
 This command was added in June 2001 to expose the then-current CMake
 implicit dependency scanner.  CMake's real implicit dependency scanner
diff --git a/Help/policy/CMP0033.rst b/Help/policy/CMP0033.rst
index b420065..7709d81 100644
--- a/Help/policy/CMP0033.rst
+++ b/Help/policy/CMP0033.rst
@@ -1,7 +1,7 @@
 CMP0033
 -------
 
-The :command:`export_library_dependencies` command should not be called.
+.. cmake-policy:: CMP0033
 
 This command was added in January 2003 to export ``<tgt>_LIB_DEPENDS``
 internal CMake cache entries to a file for installation with a project.
diff --git a/Help/policy/CMP0034.rst b/Help/policy/CMP0034.rst
index 2133997..3755d08 100644
--- a/Help/policy/CMP0034.rst
+++ b/Help/policy/CMP0034.rst
@@ -1,7 +1,7 @@
 CMP0034
 -------
 
-The :command:`utility_source` command should not be called.
+.. cmake-policy:: CMP0034
 
 This command was introduced in March 2001 to help build executables used to
 generate other files.  This approach has long been replaced by
diff --git a/Help/policy/CMP0035.rst b/Help/policy/CMP0035.rst
index 7335b22..75b8189 100644
--- a/Help/policy/CMP0035.rst
+++ b/Help/policy/CMP0035.rst
@@ -1,7 +1,7 @@
 CMP0035
 -------
 
-The :command:`variable_requires` command should not be called.
+.. cmake-policy:: CMP0035
 
 This command was introduced in November 2001 to perform some conditional
 logic.  It has long been replaced by the :command:`if` command.
diff --git a/Help/policy/CMP0036.rst b/Help/policy/CMP0036.rst
index 817f156..be13726 100644
--- a/Help/policy/CMP0036.rst
+++ b/Help/policy/CMP0036.rst
@@ -1,7 +1,7 @@
 CMP0036
 -------
 
-The :command:`build_name` command should not be called.
+.. cmake-policy:: CMP0036
 
 This command was added in May 2001 to compute a name for the current
 operating system and compiler combination.  The command has long been
diff --git a/Help/policy/CMP0037.rst b/Help/policy/CMP0037.rst
index 4d485bf..3107e50 100644
--- a/Help/policy/CMP0037.rst
+++ b/Help/policy/CMP0037.rst
@@ -1,7 +1,7 @@
 CMP0037
 -------
 
-Target names should not be reserved and should match a validity pattern.
+.. cmake-policy:: CMP0037
 
 CMake 2.8.12 and lower allowed creating targets using :command:`add_library`,
 :command:`add_executable` and :command:`add_custom_target` with unrestricted
diff --git a/Help/policy/CMP0038.rst b/Help/policy/CMP0038.rst
index df5af6a..b094db3 100644
--- a/Help/policy/CMP0038.rst
+++ b/Help/policy/CMP0038.rst
@@ -1,7 +1,7 @@
 CMP0038
 -------
 
-Targets may not link directly to themselves.
+.. cmake-policy:: CMP0038
 
 CMake 2.8.12 and lower allowed a build target to link to itself directly with
 a :command:`target_link_libraries` call. This is an indicator of a bug in
diff --git a/Help/policy/CMP0039.rst b/Help/policy/CMP0039.rst
index 58ccc41..4477d2a 100644
--- a/Help/policy/CMP0039.rst
+++ b/Help/policy/CMP0039.rst
@@ -1,7 +1,7 @@
 CMP0039
 -------
 
-Utility targets may not have link dependencies.
+.. cmake-policy:: CMP0039
 
 CMake 2.8.12 and lower allowed using utility targets in the left hand side
 position of the :command:`target_link_libraries` command. This is an indicator
diff --git a/Help/policy/CMP0040.rst b/Help/policy/CMP0040.rst
index 77a3c81..7e72ee2 100644
--- a/Help/policy/CMP0040.rst
+++ b/Help/policy/CMP0040.rst
@@ -1,7 +1,7 @@
 CMP0040
 -------
 
-The target in the TARGET signature of add_custom_command() must exist.
+.. cmake-policy:: CMP0040
 
 CMake 2.8.12 and lower silently ignored a custom command created with
 the TARGET signature of :command:`add_custom_command`
diff --git a/Help/policy/CMP0041.rst b/Help/policy/CMP0041.rst
index 5a47de0..975626d 100644
--- a/Help/policy/CMP0041.rst
+++ b/Help/policy/CMP0041.rst
@@ -1,7 +1,7 @@
 CMP0041
 -------
 
-Error on relative include with generator expression.
+.. cmake-policy:: CMP0041
 
 Diagnostics in CMake 2.8.12 and lower silently ignored an entry in the
 :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of a target if it contained a generator
diff --git a/Help/policy/CMP0042.rst b/Help/policy/CMP0042.rst
index fce870c..c385e57 100644
--- a/Help/policy/CMP0042.rst
+++ b/Help/policy/CMP0042.rst
@@ -1,7 +1,7 @@
 CMP0042
 -------
 
-:prop_tgt:`MACOSX_RPATH` is enabled by default.
+.. cmake-policy:: CMP0042
 
 CMake 2.8.12 and newer has support for using ``@rpath`` in a target's install
 name.  This was enabled by setting the target property
diff --git a/Help/policy/CMP0043.rst b/Help/policy/CMP0043.rst
index 629e502..93fd911 100644
--- a/Help/policy/CMP0043.rst
+++ b/Help/policy/CMP0043.rst
@@ -1,7 +1,7 @@
 CMP0043
 -------
 
-Ignore COMPILE_DEFINITIONS_<Config> properties
+.. cmake-policy:: CMP0043
 
 CMake 2.8.12 and lower allowed setting the
 :prop_tgt:`COMPILE_DEFINITIONS_<CONFIG>` target property and
diff --git a/Help/policy/CMP0044.rst b/Help/policy/CMP0044.rst
index 4a3e215..a980c90 100644
--- a/Help/policy/CMP0044.rst
+++ b/Help/policy/CMP0044.rst
@@ -1,7 +1,7 @@
 CMP0044
 -------
 
-Case sensitive ``<LANG>_COMPILER_ID`` generator expressions
+.. cmake-policy:: CMP0044
 
 CMake 2.8.12 introduced the ``<LANG>_COMPILER_ID``
 :manual:`generator expressions <cmake-generator-expressions(7)>` to allow
diff --git a/Help/policy/CMP0045.rst b/Help/policy/CMP0045.rst
index 58c422f..a7eac7b 100644
--- a/Help/policy/CMP0045.rst
+++ b/Help/policy/CMP0045.rst
@@ -1,7 +1,7 @@
 CMP0045
 -------
 
-Error on non-existent target in get_target_property.
+.. cmake-policy:: CMP0045
 
 In CMake 2.8.12 and lower, the :command:`get_target_property` command accepted
 a non-existent target argument without issuing any error or warning.  The
diff --git a/Help/policy/CMP0046.rst b/Help/policy/CMP0046.rst
index 1a3bc65..e03b632 100644
--- a/Help/policy/CMP0046.rst
+++ b/Help/policy/CMP0046.rst
@@ -1,7 +1,7 @@
 CMP0046
 -------
 
-Error on non-existent dependency in add_dependencies.
+.. cmake-policy:: CMP0046
 
 CMake 2.8.12 and lower silently ignored non-existent dependencies
 listed in the :command:`add_dependencies` command.
diff --git a/Help/policy/CMP0047.rst b/Help/policy/CMP0047.rst
index 26ae439..86e6a89 100644
--- a/Help/policy/CMP0047.rst
+++ b/Help/policy/CMP0047.rst
@@ -1,7 +1,7 @@
 CMP0047
 -------
 
-Use ``QCC`` compiler id for the qcc drivers on QNX.
+.. cmake-policy:: CMP0047
 
 CMake 3.0 and above recognize that the QNX qcc compiler driver is
 different from the GNU compiler.
diff --git a/Help/policy/CMP0048.rst b/Help/policy/CMP0048.rst
index a54205e..25e23bd 100644
--- a/Help/policy/CMP0048.rst
+++ b/Help/policy/CMP0048.rst
@@ -1,7 +1,7 @@
 CMP0048
 -------
 
-The :command:`project` command manages VERSION variables.
+.. cmake-policy:: CMP0048
 
 CMake version 3.0 introduced the ``VERSION`` option of the :command:`project`
 command to specify a project version as well as the name.  In order to keep
diff --git a/Help/policy/CMP0049.rst b/Help/policy/CMP0049.rst
index 5c8d4a8..b95d811 100644
--- a/Help/policy/CMP0049.rst
+++ b/Help/policy/CMP0049.rst
@@ -1,7 +1,7 @@
 CMP0049
 -------
 
-Do not expand variables in target source entries.
+.. cmake-policy:: CMP0049
 
 CMake 2.8.12 and lower performed and extra layer of variable expansion
 when evaluating source file names:
diff --git a/Help/policy/CMP0050.rst b/Help/policy/CMP0050.rst
index 76ae0aa..e4c6735 100644
--- a/Help/policy/CMP0050.rst
+++ b/Help/policy/CMP0050.rst
@@ -1,7 +1,7 @@
 CMP0050
 -------
 
-Disallow add_custom_command SOURCE signatures.
+.. cmake-policy:: CMP0050
 
 CMake 2.8.12 and lower allowed a signature for :command:`add_custom_command`
 which specified an input to a command.  This was undocumented behavior.
diff --git a/Help/policy/CMP0051.rst b/Help/policy/CMP0051.rst
index 1b56cb0..19e1b37 100644
--- a/Help/policy/CMP0051.rst
+++ b/Help/policy/CMP0051.rst
@@ -1,7 +1,7 @@
 CMP0051
 -------
 
-List TARGET_OBJECTS in SOURCES target property.
+.. cmake-policy:: CMP0051
 
 CMake 3.0 and lower did not include the ``TARGET_OBJECTS``
 :manual:`generator expression <cmake-generator-expressions(7)>` when
diff --git a/Help/policy/CMP0052.rst b/Help/policy/CMP0052.rst
index 48cfc9c..5a86f8a 100644
--- a/Help/policy/CMP0052.rst
+++ b/Help/policy/CMP0052.rst
@@ -1,7 +1,7 @@
 CMP0052
 -------
 
-Reject source and build dirs in installed INTERFACE_INCLUDE_DIRECTORIES.
+.. cmake-policy:: CMP0052
 
 CMake 3.0 and lower allowed subdirectories of the source directory or build
 directory to be in the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` of
diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst
index bb0ff8b..5d1bb34 100644
--- a/Help/policy/CMP0053.rst
+++ b/Help/policy/CMP0053.rst
@@ -1,7 +1,7 @@
 CMP0053
 -------
 
-Simplify variable reference and escape sequence evaluation.
+.. cmake-policy:: CMP0053
 
 CMake 3.1 introduced a much faster implementation of evaluation of the
 :ref:`Variable References` and :ref:`Escape Sequences` documented in the
diff --git a/Help/policy/CMP0054.rst b/Help/policy/CMP0054.rst
index 3754fda..6e72b1c 100644
--- a/Help/policy/CMP0054.rst
+++ b/Help/policy/CMP0054.rst
@@ -1,7 +1,7 @@
 CMP0054
 -------
 
-Only interpret :command:`if` arguments as variables or keywords when unquoted.
+.. cmake-policy:: CMP0054
 
 CMake 3.1 and above no longer implicitly dereference variables or
 interpret keywords in an :command:`if` command argument when
diff --git a/Help/policy/CMP0055.rst b/Help/policy/CMP0055.rst
index fe7ab6f..a64f85b 100644
--- a/Help/policy/CMP0055.rst
+++ b/Help/policy/CMP0055.rst
@@ -1,7 +1,7 @@
 CMP0055
 -------
 
-Strict checking for the :command:`break` command.
+.. cmake-policy:: CMP0055
 
 CMake 3.1 and lower allowed calls to the :command:`break` command
 outside of a loop context and also ignored any given arguments.
diff --git a/Help/policy/CMP0056.rst b/Help/policy/CMP0056.rst
index 3c75ff4..3fa0889 100644
--- a/Help/policy/CMP0056.rst
+++ b/Help/policy/CMP0056.rst
@@ -1,7 +1,7 @@
 CMP0056
 -------
 
-Honor link flags in :command:`try_compile` source-file signature.
+.. cmake-policy:: CMP0056
 
 The :command:`try_compile` command source-file signature generates a
 ``CMakeLists.txt`` file to build the source file into an executable.
diff --git a/Help/policy/CMP0057.rst b/Help/policy/CMP0057.rst
index 1298a16..ef18ac4 100644
--- a/Help/policy/CMP0057.rst
+++ b/Help/policy/CMP0057.rst
@@ -1,7 +1,7 @@
 CMP0057
 -------
 
-Support new :command:`if` IN_LIST operator.
+.. cmake-policy:: CMP0057
 
 CMake 3.3 adds support for the new IN_LIST operator.
 
diff --git a/Help/policy/CMP0058.rst b/Help/policy/CMP0058.rst
index 0f20383..1d0c0a9 100644
--- a/Help/policy/CMP0058.rst
+++ b/Help/policy/CMP0058.rst
@@ -1,7 +1,7 @@
 CMP0058
 -------
 
-Ninja requires custom command byproducts to be explicit.
+.. cmake-policy:: CMP0058
 
 When an intermediate file generated during the build is consumed
 by an expensive operation or a large tree of dependents, one may
diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst
index e40f450..cc717a5 100644
--- a/Help/policy/CMP0059.rst
+++ b/Help/policy/CMP0059.rst
@@ -1,7 +1,7 @@
 CMP0059
 -------
 
-Don't treat ``DEFINITIONS`` as a built-in directory property.
+.. cmake-policy:: CMP0059
 
 CMake 3.3 and above no longer make a list of definitions available through
 the :prop_dir:`DEFINITIONS` directory property.  The
diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst
index cc37b1b..b249f84 100644
--- a/Help/policy/CMP0060.rst
+++ b/Help/policy/CMP0060.rst
@@ -1,7 +1,7 @@
 CMP0060
 -------
 
-Link libraries by full path even in implicit directories.
+.. cmake-policy:: CMP0060
 
 Policy :policy:`CMP0003` was introduced with the intention of always
 linking library files by full path when a full path is given to the
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index f8d61db..599c174 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -45,14 +45,18 @@ static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
   return true;
 }
 
-#define CM_SELECT_ID_VERSION(F, A1, A2, A3, A4, A5, A6) F(A1, A3, A4, A5)
+#define CM_SELECT_ID_VERSION(F, A1, A2, A3, A4, A5, A6, A7) F(A1, A4, A5, A6)
 #define CM_FOR_EACH_POLICY_ID_VERSION(POLICY) \
   CM_FOR_EACH_POLICY_TABLE(POLICY, CM_SELECT_ID_VERSION)
 
-#define CM_SELECT_ID_DOC(F, A1, A2, A3, A4, A5, A6) F(A1, A2)
+#define CM_SELECT_ID_DOC(F, A1, A2, A3, A4, A5, A6, A7) F(A1, A2)
 #define CM_FOR_EACH_POLICY_ID_DOC(POLICY) \
   CM_FOR_EACH_POLICY_TABLE(POLICY, CM_SELECT_ID_DOC)
 
+#define CM_SELECT_ID_RST(F, A1, A2, A3, A4, A5, A6, A7) F(A1, A3)
+#define CM_FOR_EACH_POLICY_ID_RST(POLICY) \
+  CM_FOR_EACH_POLICY_TABLE(POLICY, CM_SELECT_ID_RST)
+
 static const char* idToString(cmPolicies::PolicyID id)
 {
   switch(id)
@@ -343,6 +347,21 @@ cmPolicies::GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id)
   return e.str();
 }
 
+std::string cmPolicies::GetPolicyDocTitle(cmPolicies::PolicyID id)
+{
+  switch(id)
+    {
+#define POLICY_CASE(ID, DOC_TITLE) \
+    case cmPolicies::ID: \
+      return DOC_TITLE;
+  CM_FOR_EACH_POLICY_ID_RST(POLICY_CASE)
+#undef POLICY_CASE
+    case cmPolicies::CMPCOUNT:
+      return 0;
+    }
+  return 0;
+}
+
 cmPolicies::PolicyMap::PolicyMap()
 {
   this->UNDEFINED.set();
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 63376dd..04d5f10 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -21,196 +21,261 @@ class cmPolicy;
 
 #define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT) \
   SELECT(POLICY, CMP0000, \
-    "A minimum required CMake version must be specified.", \
+    "A minimum required CMake version must be specified.", 0, \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0001, \
     "CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", \
+    ":variable:`CMAKE_BACKWARDS_COMPATIBILITY` should no longer be used.", \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0002, \
-  "Logical target names must be globally unique.", \
+  "Logical target names must be globally unique.", 0, \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0003, \
     "Libraries linked via full path no longer produce linker search paths.", \
+    0, \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0004, \
-    "Libraries linked may not have leading or trailing whitespace.", \
+    "Libraries linked may not have leading or trailing whitespace.", 0, \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0005, \
-    "Preprocessor definition values are now escaped automatically.", \
+    "Preprocessor definition values are now escaped automatically.", 0, \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0006, \
     "Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.", \
+    "Installing :prop_tgt:`MACOSX_BUNDLE` targets requires a " \
+    ":command:`BUNDLE DESTINATION <install()>`.", \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0007, \
     "list command no longer ignores empty elements.", \
+    ":command:`list()` command no longer ignores empty elements.", \
     2, 6, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0008, \
-    "Libraries linked by full-path must have a valid library file name.", \
+    "Libraries linked by full-path must have a valid library file name.", 0, \
     2, 6, 1, cmPolicies::WARN) \
   SELECT(POLICY, CMP0009, \
     "FILE GLOB_RECURSE calls should not follow symlinks by default.", \
+    ":command:`file(GLOB_RECURSE)` calls should not follow symlinks by " \
+    "default.", \
     2, 6, 2, cmPolicies::WARN) \
   SELECT(POLICY, CMP0010, \
-    "Bad variable reference syntax is an error.", \
+    "Bad variable reference syntax is an error.", 0, \
     2, 6, 3, cmPolicies::WARN) \
   SELECT(POLICY, CMP0011, \
     "Included scripts do automatic cmake_policy PUSH and POP.", \
+    ":command:`Included <include()>` scripts do automatic " \
+    ":command:`cmake_policy` ``PUSH`` and ``POP``.", \
     2, 6, 3, cmPolicies::WARN) \
   SELECT(POLICY, CMP0012, \
     "if() recognizes numbers and boolean constants.", \
+    ":command:`if()` recognizes numbers and boolean constants.", \
     2, 8, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0013, \
-    "Duplicate binary directories are not allowed.", \
+    "Duplicate binary directories are not allowed.", 0, \
     2, 8, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0014, \
-    "Input directories must have CMakeLists.txt.", \
+    "Input directories must have CMakeLists.txt.", 0, \
     2, 8, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0015, \
     "link_directories() treats paths relative to the source dir.", \
+    ":command:`link_directories()` treats paths relative to the " \
+    ":variable:`CMAKE_CURRENT_SOURCE_DIR`.", \
     2, 8, 1, cmPolicies::WARN) \
   SELECT(POLICY, CMP0016, \
     "target_link_libraries() reports error if its only argument " \
     "is not a target.", \
+    ":command:`target_link_libraries()` reports error if its only argument " \
+    "is not a target.", \
     2, 8, 3, cmPolicies::WARN) \
   SELECT(POLICY, CMP0017, \
     "Prefer files from the CMake module directory when including from " \
-    "there.", \
+    "there.", 0, \
     2, 8, 4, cmPolicies::WARN) \
   SELECT(POLICY, CMP0018, \
-    "Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.", \
+    "Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.", 0, \
     2, 8, 9, cmPolicies::WARN) \
   SELECT(POLICY, CMP0019, \
-    "Do not re-expand variables in include and link information.", \
+    "Do not re-expand variables in include and link information.", 0, \
     2, 8, 11, cmPolicies::WARN) \
   SELECT(POLICY, CMP0020, \
     "Automatically link Qt executables to qtmain target on Windows.", \
+    "Automatically link :manual:`Qt executables <cmake-qt(7)>` to qtmain " \
+    "target on Windows.", \
     2, 8, 11, cmPolicies::WARN) \
   SELECT(POLICY, CMP0021, \
     "Fatal error on relative paths in INCLUDE_DIRECTORIES target property.", \
+    "Fatal error on relative paths in :prop_tgt:`INCLUDE_DIRECTORIES` " \
+    "target property.", \
     2, 8, 12, cmPolicies::WARN) \
   SELECT(POLICY, CMP0022, \
     "INTERFACE_LINK_LIBRARIES defines the link interface.", \
+    ":prop_tgt:`INTERFACE_LINK_LIBRARIES` defines the link interface.", \
     2, 8, 12, cmPolicies::WARN) \
   SELECT(POLICY, CMP0023, \
     "Plain and keyword target_link_libraries signatures cannot be mixed.", \
+    "Plain and keyword :command:`target_link_libraries()` signatures cannot " \
+    "be mixed.", \
     2, 8, 12, cmPolicies::WARN) \
   SELECT(POLICY, CMP0024, \
-    "Disallow include export result.", \
+    "Disallow include() of export() result.", \
+    "Disallow :command:`include()` of :command:`export()` result.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0025, \
     "Compiler id for Apple Clang is now AppleClang.", \
+    ":variable:`Compiler id <CMAKE_<LANG>_COMPILER_ID>` for Apple Clang is " \
+    "now ``AppleClang``.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0026, \
     "Disallow use of the LOCATION target property.", \
+    "Disallow use of the :prop_tgt:`LOCATION` target property.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0027, \
-    "Conditionally linked imported targets with missing include " \
+    "Conditionally linked IMPORTED targets with missing include " \
+    "directories.", \
+    "Conditionally linked :prop_tgt:`IMPORTED` targets with missing include " \
     "directories.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0028, \
     "Double colon in target name means ALIAS or IMPORTED target.", \
+    "Double colon in target name means :ref:`ALIAS <Alias Targets>` or " \
+    ":ref:`IMPORTED <Imported targets>` target.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0029, \
     "The subdir_depends command should not be called.", \
+    "The :command:`subdir_depends()` command should not be called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0030, \
     "The use_mangled_mesa command should not be called.", \
+    "The :command:`use_mangled_mesa()` command should not be called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0031, \
     "The load_command command should not be called.", \
+    "The :command:`load_command()` command should not be called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0032, \
     "The output_required_files command should not be called.", \
+    "The :command:`output_required_files()` command should not be called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0033, \
     "The export_library_dependencies command should not be called.", \
+    "The :command:`export_library_dependencies()` command should not be " \
+    "called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0034, \
     "The utility_source command should not be called.", \
+    "The :command:`utility_source()` command should not be called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0035, \
     "The variable_requires command should not be called.", \
+    "The :command:`variable_requires()` command should not be called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0036, \
     "The build_name command should not be called.", \
+    "The :command:`build_name()` command should not be called.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0037, \
     "Target names should not be reserved and should match a validity " \
     "pattern.", \
+    "Target :prop_tgt:`names <NAME>` should not be reserved and should " \
+    "match a validity pattern.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0038, \
-    "Targets may not link directly to themselves.", \
+    "Targets may not link directly to themselves.", 0, \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0039, \
-    "Utility targets may not have link dependencies.", \
+    "Utility targets may not have link dependencies.", 0, \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0040, \
     "The target in the TARGET signature of add_custom_command() must " \
     "exist.", \
+    "The target in the ``TARGET`` signature of " \
+    ":command:`add_custom_command()` must exist.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0041, \
     "Error on relative include with generator expression.", \
+    "Error on relative include with " \
+    ":manual:`generator expression <cmake-generator-expressions(7)>`.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0042, \
     "MACOSX_RPATH is enabled by default.", \
+    ":prop_tgt:`MACOSX_RPATH` is enabled by default.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0043, \
     "Ignore COMPILE_DEFINITIONS_<Config> properties.", \
+    "Ignore ``COMPILE_DEFINITIONS_<Config>`` properties.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0044, \
     "Case sensitive <LANG>_COMPILER_ID generator expressions.", \
+    "Case sensitive ``<LANG>_COMPILER_ID`` " \
+    ":manual:`generator expression <cmake-generator-expressions(7)>`", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0045, \
     "Error on non-existent target in get_target_property.", \
+    "Error on non-existent target in :command:`get_target_property()`.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0046, \
     "Error on non-existent dependency in add_dependencies.", \
+    "Error on non-existent dependency in :command:`add_dependencies()`.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0047, \
     "Use QCC compiler id for the qcc drivers on QNX.", \
+    "Use ``QCC`` :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` for " \
+    "the qcc drivers on QNX.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0048, \
     "project() command manages VERSION variables.", \
+    ":command:`project()` command manages ``VERSION`` variables.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0049, \
-    "Do not expand variables in target source entries.", \
+    "Do not expand variables in target source entries.", 0, \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0050, \
     "Disallow add_custom_command SOURCE signatures.", \
+    "Disallow :command:`add_custom_command(SOURCE)` signatures.", \
     3, 0, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0051, \
     "List TARGET_OBJECTS in SOURCES target property.", \
+    "List :manual:`TARGET_OBJECTS <cmake-generator-expressions(7)>` " \
+    "in :prop_tgt:`SOURCES` target property.", \
     3, 1, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0052, \
     "Reject source and build dirs in installed " \
     "INTERFACE_INCLUDE_DIRECTORIES.", \
+    "Reject source and build dirs in installed " \
+    ":prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`.", \
     3, 1, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0053, \
-    "Simplify variable reference and escape sequence evaluation.", \
+    "Simplify variable reference and escape sequence evaluation.", 0, \
     3, 1, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0054, \
     "Only interpret if() arguments as variables or keywords when unquoted.", \
+    "Only interpret :command:`if()` arguments as variables or keywords " \
+    "when unquoted.", \
     3, 1, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0055, \
     "Strict checking for break() command.", \
+    "Strict checking for :command:`break()` command.", \
     3, 2, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0056, \
     "Honor link flags in try_compile() source-file signature.", \
+    "Honor link flags in :command:`try_compile()` source-file signature.", \
     3, 2, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0057, \
     "Support new IN_LIST if() operator.", \
+    "Support new ``IN_LIST`` :command:`if()` operator.", \
     3, 3, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0058, \
-    "Ninja requires custom command byproducts to be explicit.", \
+    "Ninja requires custom command byproducts to be explicit.", 0, \
     3, 3, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0059, \
-    "Do no treat DEFINITIONS as a built-in directory property.", \
+    "Do not treat DEFINITIONS as a built-in directory property.", \
+    "Do not treat :prop_dir:`DEFINITIONS` as a built-in directory " \
+    "property.", \
     3, 3, 0, cmPolicies::WARN) \
   SELECT(POLICY, CMP0060, \
-    "Link libraries by full path even in implicit directories.", \
+    "Link libraries by full path even in implicit directories.", 0, \
     3, 3, 0, cmPolicies::WARN)
 
-#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
+#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6, A7) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY) \
   CM_FOR_EACH_POLICY_TABLE(POLICY, CM_SELECT_ID)
 
@@ -269,6 +334,8 @@ public:
   ///! return an error string for when a required policy is unspecified
   static std::string GetRequiredAlwaysPolicyError(cmPolicies::PolicyID id);
 
+  static std::string GetPolicyDocTitle(cmPolicies::PolicyID id);
+
   /** Represent a set of policy values.  */
   struct PolicyMap
   {
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index cb61ed9..ff54621 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -14,6 +14,7 @@
 #include "cmSystemTools.h"
 #include "cmAlgorithms.h"
 #include "cmVersion.h"
+#include "cmPolicies.h"
 #include <cmsys/FStream.hxx>
 #include <ctype.h>
 
@@ -30,6 +31,7 @@ cmRST::cmRST(std::ostream& os, std::string const& docroot):
                  "command|variable"
                  ")::[ \t]+([^ \t\n]+)$"),
   CMakeModuleDirective("^.. cmake-module::[ \t]+([^ \t\n]+)$"),
+  CMakePolicyDirective("^.. cmake-policy::[ \t]+(.+)$"),
   ParsedLiteralDirective("^.. parsed-literal::[ \t]*(.*)$"),
   CodeBlockDirective("^.. code-block::[ \t]*(.*)$"),
   ReplaceDirective("^.. (\\|[^|]+\\|) replace::[ \t]*(.*)$"),
@@ -195,6 +197,27 @@ void cmRST::ProcessLine(std::string const& line)
         this->NormalLine(line);
         }
       }
+    else if(this->CMakePolicyDirective.find(line))
+      {
+      std::string policy = this->CMakePolicyDirective.match(1);
+      if(policy.empty())
+        {
+        this->NormalLine(line);
+        }
+      else
+        {
+        cmPolicies::PolicyID id;
+        bool b = cmPolicies::GetPolicyID(policy.c_str(), id);
+        if (!b)
+          {
+          this->NormalLine(line);
+          }
+        else
+          {
+          this->OutputLine(cmPolicies::GetPolicyDocTitle(id) + "\n", true);
+          }
+        }
+      }
     else if(this->ParsedLiteralDirective.find(line))
       {
       // Record the literal lines to output after whole block.
diff --git a/Source/cmRST.h b/Source/cmRST.h
index b9b2366..52c9f2e 100644
--- a/Source/cmRST.h
+++ b/Source/cmRST.h
@@ -79,6 +79,7 @@ private:
   DirectiveType Directive;
   cmsys::RegularExpression CMakeDirective;
   cmsys::RegularExpression CMakeModuleDirective;
+  cmsys::RegularExpression CMakePolicyDirective;
   cmsys::RegularExpression ParsedLiteralDirective;
   cmsys::RegularExpression CodeBlockDirective;
   cmsys::RegularExpression ReplaceDirective;
diff --git a/Tests/RunCMake/CMP0027/CMP0027-WARN-stderr.txt b/Tests/RunCMake/CMP0027/CMP0027-WARN-stderr.txt
index 9bcec3c..984d9c1 100644
--- a/Tests/RunCMake/CMP0027/CMP0027-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0027/CMP0027-WARN-stderr.txt
@@ -1,5 +1,5 @@
 CMake Warning \(dev\) in CMakeLists.txt:
-  Policy CMP0027 is not set: Conditionally linked imported targets with
+  Policy CMP0027 is not set: Conditionally linked IMPORTED targets with
   missing include directories.  Run "cmake --help-policy CMP0027" for policy
   details.  Use the cmake_policy command to set the policy and suppress this
   warning.
diff --git a/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
index 4e04d15..06c7be3 100644
--- a/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0059/CMP0059-WARN-stderr.txt
@@ -1,5 +1,5 @@
 CMake Warning \(dev\) at CMP0059-WARN.cmake:6 \(get_property\):
-  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+  Policy CMP0059 is not set: Do not treat DEFINITIONS as a built-in directory
   property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
 Call Stack \(most recent call first\):
@@ -8,7 +8,7 @@ This warning is for project developers.  Use -Wno-dev to suppress it.
 
 DEFS: -DSOME_DEF
 CMake Warning \(dev\) at CMP0059-WARN.cmake:14 \(get_property\):
-  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
+  Policy CMP0059 is not set: Do not treat DEFINITIONS as a built-in directory
   property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
 Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/include/CMP0024-WARN-stderr.txt b/Tests/RunCMake/include/CMP0024-WARN-stderr.txt
index 9c79007..ae57674 100644
--- a/Tests/RunCMake/include/CMP0024-WARN-stderr.txt
+++ b/Tests/RunCMake/include/CMP0024-WARN-stderr.txt
@@ -1,7 +1,7 @@
 CMake Warning \(dev\) at subdir2/CMakeLists.txt:2 \(include\):
-  Policy CMP0024 is not set: Disallow include export result.  Run "cmake
-  --help-policy CMP0024" for policy details.  Use the cmake_policy command to
-  set the policy and suppress this warning.
+  Policy CMP0024 is not set: Disallow include\(\) of export\(\) result.  Run
+  "cmake --help-policy CMP0024" for policy details.  Use the cmake_policy
+  command to set the policy and suppress this warning.
 
   The file
 
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index fe60033..26094b2 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -150,6 +150,21 @@ class CMakePolicyList(Directive):
             self.state_machine.insert_input(include_lines, "")
         return []
 
+class CMakePolicy(Directive):
+    required_arguments = 1
+    def run(self):
+
+        env = self.state.document.settings.env
+        with open("PolicyList.json", "r") as f:
+            policies = json.load(f)
+
+            for policy in policies:
+              if policy["id"] == self.arguments[0]:
+                include_lines = statemachine.string2lines(policy["rst"])
+                self.state_machine.insert_input(include_lines, "")
+                break
+        return []
+
 class _cmake_index_entry:
     def __init__(self, desc):
         self.desc = desc
@@ -411,6 +426,7 @@ class CMakeDomain(Domain):
 
 def setup(app):
     app.add_directive('cmake-module', CMakeModule)
+    app.add_directive('cmake-policy', CMakePolicy)
     app.add_directive('cmake-policy-list', CMakePolicyList)
     app.add_transform(CMakeTransform)
     app.add_transform(CMakeXRefTransform)
diff --git a/Utilities/Sphinx/create-policy-list.py b/Utilities/Sphinx/create-policy-list.py
index d825c66..6b0f10e 100755
--- a/Utilities/Sphinx/create-policy-list.py
+++ b/Utilities/Sphinx/create-policy-list.py
@@ -7,6 +7,10 @@ def collectString(s):
 
   result = ""
   idx = s.find('"')
+  nullptr = s.find('0')
+  if (nullptr < idx):
+    return (None, None)
+
   oldIdx = idx + 1
   i = 0
   while idx != -1:
@@ -41,13 +45,19 @@ with open(sys.argv[2]) as policyHeader:
     policyId, content = content.split(",", 1)
     docString, docLength = collectString(content)
     content = content[docLength:]
+    rstString, rstLength = collectString(content)
+    if (rstString is None):
+      rstString = docString
+    else:
+      content = content[rstLength:]
     versionMajor, versionMinor, versionPatch, content = content.split(",", 3)
     versionMajor = cleanString(versionMajor)
     versionMinor = cleanString(versionMinor)
     versionPatch = cleanString(versionPatch)
     version = versionMajor + "." + versionMinor + "." + versionPatch
 
-    policies.append({"id": policyId, "doc": docString, "version": version})
+    policies.append({"id": policyId, "doc": docString,
+                     "rst": rstString, "version": version})
 
     start = content.find("SELECT(POLICY, ")
 

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list