Merge branch 'release-3.16'
diff --git a/.clang-format b/.clang-format
index 0c7d6b0..a7f049a 100644
--- a/.clang-format
+++ b/.clang-format
@@ -22,7 +22,7 @@
 IncludeCategories:
   - Regex:           '^[<"]cmConfigure\.h'
     Priority:        -1
-  - Regex:           '^(<|")cm/'
+  - Regex:           '^(<|")cm(ext)?/'
     Priority:        2
   - Regex:           '^(<|")windows\.h'
     Priority:        3
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 823ee3c..af4bb2d 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -71,6 +71,7 @@
   "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto
   "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto
   "IPA warning: function.*multiply defined in"
+  "LICENSE WARNING" # PGI license expiry.  Not useful in nightly testing.
 
   # Ignore compiler summary warning, assuming prior text has matched some
   # other warning expression:
diff --git a/Help/command/ctest_test.rst b/Help/command/ctest_test.rst
index 7a3393b..5c67b2c 100644
--- a/Help/command/ctest_test.rst
+++ b/Help/command/ctest_test.rst
@@ -23,6 +23,7 @@
              [STOP_TIME <time-of-day>]
              [RETURN_VALUE <result-var>]
              [CAPTURE_CMAKE_ERROR <result-var>]
+             [REPEAT <mode>:<n>]
              [QUIET]
              )
 
@@ -95,6 +96,25 @@
   and then the ``--test-load`` command-line argument to :manual:`ctest(1)`.
   See also the ``TestLoad`` setting in the :ref:`CTest Test Step`.
 
+``REPEAT <mode>:<n>``
+  Run tests repeatedly based on the given ``<mode>`` up to ``<n>`` times.
+  The modes are:
+
+  ``UNTIL_FAIL``
+    Require each test to run ``<n>`` times without failing in order to pass.
+    This is useful in finding sporadic failures in test cases.
+
+  ``UNTIL_PASS``
+    Allow each test to run up to ``<n>`` times in order to pass.
+    Repeats tests if they fail for any reason.
+    This is useful in tolerating sporadic failures in test cases.
+
+  ``AFTER_TIMEOUT``
+    Allow each test to run up to ``<n>`` times in order to pass.
+    Repeats tests only if they timeout.
+    This is useful in tolerating sporadic timeouts in test cases
+    on busy machines.
+
 ``SCHEDULE_RANDOM <ON|OFF>``
   Launch tests in a random order.  This may be useful for detecting
   implicit test dependencies.
diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst
index ae2afb2..a01a104 100644
--- a/Help/command/foreach.rst
+++ b/Help/command/foreach.rst
@@ -47,7 +47,7 @@
 
 .. code-block:: cmake
 
-  foreach(loop_var IN [LISTS [<lists>]] [ITEMS [<items>]])
+  foreach(<loop_var> IN [LISTS [<lists>]] [ITEMS [<items>]])
 
 In this variant, ``<lists>`` is a whitespace or semicolon
 separated list of list-valued variables. The ``foreach``
@@ -82,3 +82,46 @@
   -- X=6
   -- X=7
   -- X=8
+
+
+.. code-block:: cmake
+
+  foreach(<loop_var>... IN ZIP_LISTS <lists>)
+
+In this variant, ``<lists>`` is a whitespace or semicolon
+separated list of list-valued variables. The ``foreach``
+command iterates over each list simultaneously setting the
+iteration variables as follows:
+
+- if the only ``loop_var`` given, then it sets a series of
+  ``loop_var_N`` variables to the current item from the
+  corresponding list;
+- if multiple variable names passed, their count should match
+  the lists variables count;
+- if any of the lists are shorter, the corresponding iteration
+  variable is not defined for the current iteration.
+
+.. code-block:: cmake
+
+  list(APPEND English one two three four)
+  list(APPEND Bahasa satu dua tiga)
+
+  foreach(num IN ZIP_LISTS English Bahasa)
+      message(STATUS "num_0=${num_0}, num_1=${num_1}")
+  endforeach()
+
+  foreach(en ba IN ZIP_LISTS English Bahasa)
+      message(STATUS "en=${en}, ba=${ba}")
+  endforeach()
+
+yields
+::
+
+  -- num_0=one, num_1=satu
+  -- num_0=two, num_1=dua
+  -- num_0=three, num_1=tiga
+  -- num_0=four, num_1=
+  -- en=one, ba=satu
+  -- en=two, ba=dua
+  -- en=three, ba=tiga
+  -- en=four, ba=
diff --git a/Help/command/message.rst b/Help/command/message.rst
index c614286..6bc0e4c 100644
--- a/Help/command/message.rst
+++ b/Help/command/message.rst
@@ -1,13 +1,33 @@
 message
 -------
 
-Display a message to the user.
+Log a message.
+
+Synopsis
+^^^^^^^^
+
+.. parsed-literal::
+
+  `General messages`_
+    message([<mode>] "message text" ...)
+
+  `Reporting checks`_
+    message(<checkState> "message text" ...)
+
+
+General messages
+^^^^^^^^^^^^^^^^
 
 .. code-block:: cmake
 
-  message([<mode>] "message to display" ...)
+  message([<mode>] "message text" ...)
 
-The optional ``<mode>`` keyword determines the type of message:
+Record the specified message text in the log.  If more than one message
+string is given, they are concatenated into a single message with no
+separator between the strings.
+
+The optional ``<mode>`` keyword determines the type of message, which
+influences the way the message is handled:
 
 ``FATAL_ERROR``
   CMake Error, stop processing and generation.
@@ -59,12 +79,104 @@
 messages one at a time on a status line and other messages in an
 interactive pop-up box.  The ``--log-level`` command-line option to each of
 these tools can be used to control which messages will be shown.
+To make a log level persist between CMake runs, the
+:variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can be set instead.
+Note that the command line option takes precedence over the cache variable.
 
-Messages of log levels ``NOTICE`` and below will also have each line preceded
+Messages of log levels ``NOTICE`` and below will have each line preceded
 by the content of the :variable:`CMAKE_MESSAGE_INDENT` variable (converted to
 a single string by concatenating its list items).  For ``STATUS`` to ``TRACE``
 messages, this indenting content will be inserted after the hyphens.
 
+Messages of log levels ``NOTICE`` and below can also have each line preceded
+with context of the form ``[some.context.example]``.  The content between the
+square brackets is obtained by converting the :variable:`CMAKE_MESSAGE_CONTEXT`
+list variable to a dot-separated string.  The message context will always
+appear before any indenting content but after any automatically added leading
+hyphens. By default, message context is not shown, it has to be explicitly
+enabled by giving the :manual:`cmake <cmake(1)>` ``--log-context``
+command-line option or by setting the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW`
+variable to true.  See the :variable:`CMAKE_MESSAGE_CONTEXT` documentation for
+usage examples.
+
 CMake Warning and Error message text displays using a simple markup
 language.  Non-indented text is formatted in line-wrapped paragraphs
 delimited by newlines.  Indented text is considered pre-formatted.
+
+
+Reporting checks
+^^^^^^^^^^^^^^^^
+
+A common pattern in CMake output is a message indicating the start of some
+sort of check, followed by another message reporting the result of that check.
+For example:
+
+.. code-block:: cmake
+
+  message(STATUS "Looking for someheader.h")
+  #... do the checks, set checkSuccess with the result
+  if(checkSuccess)
+    message(STATUS "Looking for someheader.h - found")
+  else()
+    message(STATUS "Looking for someheader.h - not found")
+  endif()
+
+This can be more robustly and conveniently expressed using the ``CHECK_...``
+keyword form of the ``message()`` command:
+
+.. code-block:: cmake
+
+  message(<checkState> "message" ...)
+
+where ``<checkState>`` must be one of the following:
+
+  ``CHECK_START``
+    Record a concise message about the check about to be performed.
+
+  ``CHECK_PASS``
+    Record a successful result for a check.
+
+  ``CHECK_FAIL``
+    Record an unsuccessful result for a check.
+
+When recording a check result, the command repeats the message from the most
+recently started check for which no result has yet been reported, then some
+separator characters and then the message text provided after the
+``CHECK_PASS`` or ``CHECK_FAIL`` keyword.  Check messages are always reported
+at ``STATUS`` log level.
+
+Checks may be nested and every ``CHECK_START`` should have exactly one
+matching ``CHECK_PASS`` or ``CHECK_FAIL``.
+The :variable:`CMAKE_MESSAGE_INDENT` variable can also be used to add
+indenting to nested checks if desired.  For example:
+
+.. code-block:: cmake
+
+  message(CHECK_START "Finding my things")
+  list(APPEND CMAKE_MESSAGE_INDENT "  ")
+  unset(missingComponents)
+
+  message(CHECK_START "Finding partA")
+  # ... do check, assume we find A
+  message(CHECK_PASS "found")
+
+  message(CHECK_START "Finding partB")
+  # ... do check, assume we don't find B
+  list(APPEND missingComponents B)
+  message(CHECK_FAIL "not found")
+
+  list(POP_BACK CMAKE_MESSAGE_INDENT)
+  if(missingComponents)
+    message(CHECK_FAIL "missing components: ${missingComponents}")
+  else()
+    message(CHECK_PASS "all components found")
+  endif()
+
+Output from the above would appear something like the following::
+
+  -- Finding my things
+  --   Finding partA
+  --   Finding partA - found
+  --   Finding partB
+  --   Finding partB - not found
+  -- Finding my things - missing components: B
diff --git a/Help/command/project.rst b/Help/command/project.rst
index 3951456..b6093d3 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -102,9 +102,12 @@
 Code Injection
 ^^^^^^^^^^^^^^
 
-If the :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variable is set, the file
-pointed to by that variable will be included as the first step of the
+If the :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` or
+:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE` variables are set,
+the files they point to will be included as the first step of the
 ``project()`` command.
+If both are set, then :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` will be
+included before :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE`.
 
 If the :variable:`CMAKE_PROJECT_INCLUDE` or
 :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` variables are set, the files
diff --git a/Help/cpack_gen/nsis.rst b/Help/cpack_gen/nsis.rst
index cd2aea6..dc65249 100644
--- a/Help/cpack_gen/nsis.rst
+++ b/Help/cpack_gen/nsis.rst
@@ -128,3 +128,24 @@
   set(CPACK_NSIS_MENU_LINKS
       "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html"
       "CMake Help" "https://cmake.org" "CMake Web Site")
+
+.. variable:: CPACK_NSIS_UNINSTALL_NAME
+
+ Specify the name of the program to uninstall the version.
+ Default is ``Uninstall``.
+
+.. variable:: CPACK_NSIS_WELCOME_TITLE
+
+  The title to display on the top of the page for the welcome page.
+
+.. variable:: CPACK_NSIS_WELCOME_TITLE_3LINES
+
+ Display the title in the welcome page on 3 lines instead of 2.
+
+.. variable:: CPACK_NSIS_FINISH_TITLE
+
+ The title to display on the top of the page for the finish page.
+
+.. variable:: CPACK_NSIS_FINISH_TITLE_3LINES
+
+ Display the title in the finish page on 3 lines instead of 2.
diff --git a/Help/cpack_gen/packagemaker.rst b/Help/cpack_gen/packagemaker.rst
index e9464b7..81acb9d 100644
--- a/Help/cpack_gen/packagemaker.rst
+++ b/Help/cpack_gen/packagemaker.rst
@@ -15,9 +15,60 @@
  compatible with. Different versions of macOS support different
  features. For example, CPack can only build component-based installers for
  macOS 10.4 or newer, and can only build installers that download
- component son-the-fly for macOS 10.5 or newer. If left blank, this value
+ components on-the-fly for macOS 10.5 or newer. If left blank, this value
  will be set to the minimum version of macOS that supports the requested
  features. Set this variable to some value (e.g., 10.4) only if you want to
  guarantee that your installer will work on that version of macOS, and
  don't mind missing extra features available in the installer shipping with
  later versions of macOS.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND
+
+ Adds a background to Distribtion XML if specified. The value contains the
+ path to image in ``Resources`` directory.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT
+
+ Adds an ``alignment`` attribute to the background in Distribution XML.
+ Refer to Apple documentation for valid values.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_SCALING
+
+ Adds a ``scaling`` attribute to the background in Distribution XML.
+ Refer to Apple documentation for valid values.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE
+
+ Adds a ``mime-type`` attribute to the background in Distribution XML.
+ The option contains MIME type of an image.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_UTI
+
+ Adds an ``uti`` attribute to the background in Distribution XML.
+ The option contains UTI type of an image.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA
+
+ Adds a background for the Dark Aqua theme to Distribution XML if
+ specified. The value contains the path to image in ``Resources``
+ directory.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_ALIGNMENT
+
+ Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_ALIGNMENT` option,
+ but for the dark theme.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_SCALING
+
+ Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_SCALING` option,
+ but for the dark theme.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_MIME_TYPE
+
+ Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_MIME_TYPE` option,
+ but for the dark theme.
+
+.. variable:: CPACK_PACKAGEMAKER_BACKGROUND_DARKAQUA_UTI
+
+ Does the same as :variable:`CPACK_PACKAGEMAKER_BACKGROUND_UTI` option,
+ but for the dark theme.
diff --git a/Help/cpack_gen/productbuild.rst b/Help/cpack_gen/productbuild.rst
index d22fcd4..82b79ae 100644
--- a/Help/cpack_gen/productbuild.rst
+++ b/Help/cpack_gen/productbuild.rst
@@ -58,7 +58,6 @@
  component name.  No ``postinstall`` script is added if this variable is not
  defined for a given component.
 
-
 .. variable:: CPACK_PRODUCTBUILD_RESOURCES_DIR
 
  If specified the productbuild generator copies files from this directory
@@ -66,3 +65,54 @@
  before the :variable:`CPACK_RESOURCE_FILE_WELCOME`,
  :variable:`CPACK_RESOURCE_FILE_README`, and
  :variable:`CPACK_RESOURCE_FILE_LICENSE` files are copied.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND
+
+ Adds a background to Distribtion XML if specified. The value contains the
+ path to image in ``Resources`` directory.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT
+
+ Adds an ``alignment`` attribute to the background in Distribution XML.
+ Refer to Apple documentation for valid values.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_SCALING
+
+ Adds a ``scaling`` attribute to the background in Distribution XML.
+ Refer to Apple documentation for valid values.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE
+
+ Adds a ``mime-type`` attribute to the background in Distribution XML.
+ The option contains MIME type of an image.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_UTI
+
+ Adds an ``uti`` attribute to the background in Distribution XML.
+ The option contains UTI type of an image.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA
+
+ Adds a background for the Dark Aqua theme to Distribution XML if
+ specified. The value contains the path to image in ``Resources``
+ directory.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_ALIGNMENT
+
+ Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_ALIGNMENT` option,
+ but for the dark theme.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_SCALING
+
+ Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_SCALING` option,
+ but for the dark theme.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_MIME_TYPE
+
+ Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_MIME_TYPE` option,
+ but for the dark theme.
+
+.. variable:: CPACK_PRODUCTBUILD_BACKGROUND_DARKAQUA_UTI
+
+ Does the same as :variable:`CPACK_PRODUCTBUILD_BACKGROUND_UTI` option,
+ but for the dark theme.
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index 44e2273..a1c1a6f 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -14,6 +14,11 @@
 The `CMake Review Process`_ requires a maintainer to issue the ``Do: merge``
 command to integrate a merge request.  Please check at least the following:
 
+* If the MR source branch (or part of it) should be backported
+  to the ``release`` branch (and is already based on a commit
+  contained in the ``release`` branch), add a ``Backport: release`` or
+  ``Backport: release:<commit-ish>`` trailing line to the MR description.
+
 * If the MR source branch is not named well for the change it makes
   (e.g. it is just ``master`` or the patch changed during review),
   add a ``Topic-rename: <topic>`` trailing line to the MR description
@@ -38,9 +43,10 @@
   of various nightly builders.)
 
 * Ensure that the MR targets the ``master`` branch.  A MR intended for
-  the ``release`` branch should be based on ``release`` but still merged
-  to ``master`` first (via ``Do: merge``).  A maintainer may then merge
-  the MR topic to ``release`` manually.
+  the ``release`` branch should be based on ``release`` but still target
+  ``master``.  Use the above-mentioned ``Backport: release`` line to tell
+  ``Do: merge`` to merge to both.  If a MR is merged without the backport
+  line, a maintainer may still merge the MR topic to ``release`` manually.
 
 Maintain Current Release
 ========================
@@ -51,6 +57,12 @@
 number of the current release in the form ``$major.$minor``.  It is always
 merged into ``master`` before publishing.
 
+To merge an open MR to the ``release`` branch, edit its description to
+use the ``Backport: release`` line mentioned above and then ``Do: merge``
+normally.  To update the ``release`` branch manually (e.g. to merge a
+``$topic`` branch that was merged without the backport line), use the
+following procedure.
+
 Before merging a ``$topic`` branch into ``release``, verify that the
 ``$topic`` branch has already been merged to ``master`` via the usual
 ``Do: merge`` process.  Then, to merge the ``$topic`` branch into
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index cbde6fe..8ec41d2 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -53,6 +53,10 @@
   to a period of inactivity.  See the `Expire`_ step.  Use this label
   after closing a MR for this reason.
 
+* ``workflow:external-discussion`` indicates that the MR has been closed
+  pending discussion elsewhere.  See the `External Discussion`_ step.
+  Use this label after closing a MR for this reason.
+
 The workflow status labels are intended to be mutually exclusive,
 so please remove any existing workflow label when adding one.
 
@@ -429,6 +433,21 @@
 in the MR description (the following have no effect if used in a MR
 comment instead):
 
+* ``Backport: release[:<commit-ish>]``: merge the topic branch into
+  the ``release`` branch to backport the change.  This is allowed
+  only if the topic branch is based on a commit in ``release`` already.
+  If only part of the topic branch should be backported, specify it as
+  ``:<commit-ish>``.  The ``<commit-ish>`` may use `git rev-parse`_
+  syntax to reference commits relative to the topic ``HEAD``.
+  See additional `backport instructions`_ for details.
+  For example:
+
+  ``Backport: release``
+    Merge the topic branch head into both ``release`` and ``master``.
+  ``Backport: release:HEAD~1^2``
+    Merge the topic branch head's parent's second parent commit into
+    the ``release`` branch.  Merge the topic branch head to ``master``.
+
 * ``Topic-rename: <topic>``: substitute ``<topic>`` for the name of
   the MR topic branch in the constructed merge commit message.
   It is also used in merge commits constructed by ``Do: stage``.
@@ -436,6 +455,8 @@
   rename set in the MR description.
 
 .. _`CMake GitLab Project Masters`: https://gitlab.kitware.com/cmake/cmake/settings/members
+.. _`backport instructions`: https://gitlab.kitware.com/utils/git-workflow/wikis/Backport-topics
+.. _`git rev-parse`: https://git-scm.com/docs/git-rev-parse
 
 Close
 -----
diff --git a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
new file mode 100644
index 0000000..e9e0810
--- /dev/null
+++ b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -0,0 +1,9 @@
+CMAKE_EXPORT_COMPILE_COMMANDS
+-----------------------------
+
+.. include:: ENV_VAR.txt
+
+The default value for :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` when there
+is no explicit configuration given on the first run while creating a new
+build tree.  On later runs in an existing build tree the value persists in
+the cache as :variable:`CMAKE_EXPORT_COMPILE_COMMANDS`.
diff --git a/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
new file mode 100644
index 0000000..4f91e9a
--- /dev/null
+++ b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
@@ -0,0 +1,10 @@
+CMAKE_<LANG>_COMPILER_LAUNCHER
+------------------------------
+
+.. include:: ENV_VAR.txt
+
+Default compiler launcher to use for the specified language. Will only be used
+by CMake to initialize the variable on the first configuration. Afterwards, it
+is available through the cache setting of the variable of the same name. For
+any configuration run (including the first), the environment variable will be
+ignored if the :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable is defined.
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 96ceb94..adfc39e 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -23,10 +23,12 @@
 
    /envvar/CMAKE_BUILD_PARALLEL_LEVEL
    /envvar/CMAKE_CONFIG_TYPE
+   /envvar/CMAKE_EXPORT_COMPILE_COMMANDS
    /envvar/CMAKE_GENERATOR
    /envvar/CMAKE_GENERATOR_INSTANCE
    /envvar/CMAKE_GENERATOR_PLATFORM
    /envvar/CMAKE_GENERATOR_TOOLSET
+   /envvar/CMAKE_LANG_COMPILER_LAUNCHER
    /envvar/CMAKE_MSVCIDE_RUN_PATH
    /envvar/CMAKE_NO_VERBOSE
    /envvar/CMAKE_OSX_ARCHITECTURES
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index 04b6ed2..12eecd9 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -199,6 +199,7 @@
         "root": "/prefix/share/cmake-3.14"
       },
       "generator": {
+        "multiConfig": false,
         "name": "Unix Makefiles"
       }
     },
@@ -267,6 +268,9 @@
     A JSON object describing the CMake generator used for the build.
     It has members:
 
+    ``multiConfig``
+      A boolean specifying whether the generator supports multiple output
+      configurations.
     ``name``
       A string specifying the name of the generator.
     ``platform``
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 75f4bd4..691481b 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -596,7 +596,8 @@
   requirement.
 ``$<INSTALL_PREFIX>``
   Content of the install prefix when the target is exported via
-  :command:`install(EXPORT)` and empty otherwise.
+  :command:`install(EXPORT)`, or when evaluated in
+  :prop_tgt:`INSTALL_NAME_DIR`, and empty otherwise.
 
 Output-Related Expressions
 --------------------------
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 44ea1a8..2118031 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -51,6 +51,15 @@
 to determine whether to report an error on use of deprecated macros or
 functions.
 
+Policies Introduced by CMake 3.17
+=================================
+
+.. toctree::
+   :maxdepth: 1
+
+   CMP0099: Link properties are transitive over private dependency on static libraries. </policy/CMP0099>
+   CMP0098: FindFLEX runs flex in CMAKE_CURRENT_BINARY_DIR when executing. </policy/CMP0098>
+
 Policies Introduced by CMake 3.16
 =================================
 
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index e704371..c5ef09a 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -348,6 +348,7 @@
    /prop_tgt/VS_DOTNET_REFERENCES
    /prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL
    /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION
+   /prop_tgt/VS_DOTNET_DOCUMENTATION_FILE
    /prop_tgt/VS_DPI_AWARE
    /prop_tgt/VS_GLOBAL_KEYWORD
    /prop_tgt/VS_GLOBAL_PROJECT_TYPES
@@ -380,6 +381,7 @@
    /prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER
    /prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
    /prop_tgt/XCODE_SCHEME_ARGUMENTS
+   /prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY
    /prop_tgt/XCODE_SCHEME_DEBUG_AS_ROOT
    /prop_tgt/XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
    /prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 53b7f8d..0c1d510 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -70,7 +70,6 @@
    /variable/CMAKE_MAKE_PROGRAM
    /variable/CMAKE_MATCH_COUNT
    /variable/CMAKE_MATCH_n
-   /variable/CMAKE_MESSAGE_INDENT
    /variable/CMAKE_MINIMUM_REQUIRED_VERSION
    /variable/CMAKE_MINOR_VERSION
    /variable/CMAKE_NETRC
@@ -206,6 +205,10 @@
    /variable/CMAKE_LINK_DIRECTORIES_BEFORE
    /variable/CMAKE_MFC_FLAG
    /variable/CMAKE_MAXIMUM_RECURSION_DEPTH
+   /variable/CMAKE_MESSAGE_CONTEXT
+   /variable/CMAKE_MESSAGE_CONTEXT_SHOW
+   /variable/CMAKE_MESSAGE_INDENT
+   /variable/CMAKE_MESSAGE_LOG_LEVEL
    /variable/CMAKE_MODULE_PATH
    /variable/CMAKE_POLICY_DEFAULT_CMPNNNN
    /variable/CMAKE_POLICY_WARNING_CMPNNNN
@@ -214,6 +217,7 @@
    /variable/CMAKE_PROJECT_INCLUDE
    /variable/CMAKE_PROJECT_INCLUDE_BEFORE
    /variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE
+   /variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE
    /variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
    /variable/CMAKE_STAGING_PREFIX
    /variable/CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS
@@ -235,10 +239,12 @@
    /variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY
    /variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
    /variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
+   /variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY
    /variable/CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
    /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
    /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
    /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+   /variable/CMAKE_XCODE_SCHEME_ENVIRONMENT
    /variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC
    /variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
    /variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 4ab55a0..6f33866 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -206,9 +206,24 @@
  The :command:`message` command will only output messages of the specified
  log level or higher.  The default log level is ``STATUS``.
 
+ To make a log level persist between CMake runs, set
+ :variable:`CMAKE_MESSAGE_LOG_LEVEL` as a cache variable instead.
+ If both the command line option and the variable are given, the command line
+ option takes precedence.
+
  For backward compatibility reasons, ``--loglevel`` is also accepted as a
  synonym for this option.
 
+``--log-context``
+ Enable the :command:`message` command outputting context attached to each
+ message.
+
+ This option turns on showing context for the current CMake run only.
+ To make showing the context persistent for all subsequent CMake runs, set
+ :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` as a cache variable instead.
+ When this command line option is given, :variable:`CMAKE_MESSAGE_CONTEXT_SHOW`
+ is ignored.
+
 ``--debug-trycompile``
  Do not delete the :command:`try_compile` build tree.
  Only useful on one :command:`try_compile` at a time.
@@ -539,22 +554,38 @@
      7a0b54896fe5e70cca6dd643ad6f672614b189bf26f8153061c4d219474b05dad08c4e729af9f4b009f1a1a280cb625454bf587c690f4617c27e3aebdf3b7a2d  file2.txt
 
 ``remove [-f] <file>...``
-  Remove the file(s). If any of the listed files already do not
-  exist, the command returns a non-zero exit code, but no message
-  is logged. The ``-f`` option changes the behavior to return a
+  .. deprecated:: 3.17
+
+  Remove the file(s). The planned behaviour was that if any of the
+  listed files already do not exist, the command returns a non-zero exit code,
+  but no message is logged. The ``-f`` option changes the behavior to return a
   zero exit code (i.e. success) in such situations instead.
   ``remove`` does not follow symlinks. That means it remove only symlinks
   and not files it point to.
 
+  The implementation was buggy and always returned 0. It cannot be fixed without
+  breaking backwards compatibility. Use ``rm`` instead.
+
 ``remove_directory <dir>...``
-  Remove ``<dir>`` directories and their contents.  If a directory does
+  .. deprecated:: 3.17
+
+  Remove ``<dir>`` directories and their contents. If a directory does
   not exist it will be silently ignored.  If ``<dir>`` is a symlink to
   a directory, just the symlink will be removed.
+  Use ``rm`` instead.
 
 ``rename <oldname> <newname>``
   Rename a file or directory (on one volume). If file with the ``<newname>`` name
   already exists, then it will be silently replaced.
 
+``rm [-rRf] <file> <dir>...``
+  Remove the files ``<file>`` or directories ``dir``.
+  Use ``-r`` or ``-R`` to remove directories and their contents recursively.
+  If any of the listed files/directories do not exist, the command returns a
+  non-zero exit code, but no message is logged. The ``-f`` option changes
+  the behavior to return a zero exit code (i.e. success) in such
+  situations instead.
+
 ``server``
   Launch :manual:`cmake-server(7)` mode.
 
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index e29ebca..17bddb6 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -261,10 +261,27 @@
  fail, subsequent calls to CTest with the ``--rerun-failed`` option will run
  the set of tests that most recently failed (if any).
 
-``--repeat-until-fail <n>``
- Require each test to run ``<n>`` times without failing in order to pass.
+``--repeat <mode>:<n>``
+  Run tests repeatedly based on the given ``<mode>`` up to ``<n>`` times.
+  The modes are:
 
- This is useful in finding sporadic failures in test cases.
+  ``until-fail``
+    Require each test to run ``<n>`` times without failing in order to pass.
+    This is useful in finding sporadic failures in test cases.
+
+  ``until-pass``
+    Allow each test to run up to ``<n>`` times in order to pass.
+    Repeats tests if they fail for any reason.
+    This is useful in tolerating sporadic failures in test cases.
+
+  ``after-timeout``
+    Allow each test to run up to ``<n>`` times in order to pass.
+    Repeats tests only if they timeout.
+    This is useful in tolerating sporadic timeouts in test cases
+    on busy machines.
+
+``--repeat-until-fail <n>``
+ Equivalent to ``--repeat until-fail:<n>``.
 
 ``--max-width <width>``
  Set the max width for a test name to output.
diff --git a/Help/policy/CMP0098.rst b/Help/policy/CMP0098.rst
new file mode 100644
index 0000000..6d1443b
--- /dev/null
+++ b/Help/policy/CMP0098.rst
@@ -0,0 +1,30 @@
+CMP0098
+-------
+
+:module:`FindFLEX` runs ``flex`` in directory
+:variable:`CMAKE_CURRENT_BINARY_DIR` when executing.
+
+The module provides a ``FLEX_TARGET`` macro which generates FLEX output.
+In CMake 3.16 and below the macro would generate a custom command that runs
+``flex`` in the current source directory.  CMake 3.17 and later prefer to
+run it in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR`
+as the ``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation.
+This ensures that any implicitly generated file is written relative to the
+build tree rather than the source tree, unless the generated file is
+provided as absolute path.
+
+This policy provides compatibility for projects that have not been updated
+to expect the new behavior.
+
+The ``OLD`` behavior for this policy is for ``FLEX_TARGET`` to use
+the current source directory for the ``WORKING_DIRECTORY`` and where
+to generate implicit files. The ``NEW`` behavior of this policy is to
+use the current binary directory for the ``WORKING_DIRECTORY`` relative to
+which implicit files are generated unless provided as absolute path.
+
+This policy was introduced in CMake version 3.17.  Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0099.rst b/Help/policy/CMP0099.rst
new file mode 100644
index 0000000..c897e7b
--- /dev/null
+++ b/Help/policy/CMP0099.rst
@@ -0,0 +1,24 @@
+CMP0099
+-------
+
+Target link properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
+:prop_tgt:`INTERFACE_LINK_DIRECTORIES` and :prop_tgt:`INTERFACE_LINK_DEPENDS`
+are now transitive over private dependencies of static libraries.
+
+In CMake 3.16 and below the interface link properties attached to libraries
+are not propagated for private dependencies of static libraries.
+Only the libraries themselves are propagated to link the dependent binary.
+CMake 3.17 and later prefer to propagate all interface link properties.
+This policy provides compatibility for projects that have not been updated
+to expect the new behavior.
+
+The ``OLD`` behavior for this policy is to not propagate interface link
+properties. The ``NEW`` behavior of this policy is to propagate interface link
+properties.
+
+This policy was introduced in CMake version 3.17.  Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_tgt/INSTALL_NAME_DIR.rst b/Help/prop_tgt/INSTALL_NAME_DIR.rst
index 2216072..747615a 100644
--- a/Help/prop_tgt/INSTALL_NAME_DIR.rst
+++ b/Help/prop_tgt/INSTALL_NAME_DIR.rst
@@ -10,3 +10,7 @@
 This property is initialized by the value of the variable
 :variable:`CMAKE_INSTALL_NAME_DIR` if it is set when a target is
 created.
+
+This property supports :manual:`generator expressions <cmake-generator-expressions(7)>`.
+In particular, the ``$<INSTALL_PREFIX>`` generator expression can be used to set the
+directory relative to the install-time prefix.
diff --git a/Help/prop_tgt/INSTALL_RPATH_USE_LINK_PATH.rst b/Help/prop_tgt/INSTALL_RPATH_USE_LINK_PATH.rst
index d8be954..d16a7a1 100644
--- a/Help/prop_tgt/INSTALL_RPATH_USE_LINK_PATH.rst
+++ b/Help/prop_tgt/INSTALL_RPATH_USE_LINK_PATH.rst
@@ -3,8 +3,12 @@
 
 Add paths to linker search and installed rpath.
 
-``INSTALL_RPATH_USE_LINK_PATH`` is a boolean that if set to ``True`` will
-append directories in the linker search path and outside the project
-to the :prop_tgt:`INSTALL_RPATH`.  This property is initialized by the value of
-the variable ``CMAKE_INSTALL_RPATH_USE_LINK_PATH`` if it is set when a
-target is created.
+``INSTALL_RPATH_USE_LINK_PATH`` is a boolean that if set to ``True``
+will append to the runtime search path (rpath) of installed binaries
+any directories outside the project that are in the linker search path or
+contain linked library files.  The directories are appended after the
+value of the :prop_tgt:`INSTALL_RPATH` target property.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_INSTALL_RPATH_USE_LINK_PATH` if it is set when a target is
+created.
diff --git a/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst
new file mode 100644
index 0000000..1bc361c
--- /dev/null
+++ b/Help/prop_tgt/VS_DOTNET_DOCUMENTATION_FILE.rst
@@ -0,0 +1,6 @@
+VS_DOTNET_DOCUMENTATION_FILE
+----------------------------
+
+Visual Studio managed project .NET documentation output
+
+Sets the target XML documentation file output.
diff --git a/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst
new file mode 100644
index 0000000..7ffa74b
--- /dev/null
+++ b/Help/prop_tgt/XCODE_SCHEME_WORKING_DIRECTORY.rst
@@ -0,0 +1,13 @@
+XCODE_SCHEME_WORKING_DIRECTORY
+------------------------------
+
+Specify the ``Working Directory`` a of the `Run` and `Profile`
+action in the generated Xcode scheme. In case the value contains
+generator expressions those are evaluated.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_XCODE_SCHEME_WORKING_DIRECTORY` if it is set
+when a target is created.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst
new file mode 100644
index 0000000..e4cc01e
--- /dev/null
+++ b/Help/release/dev/0-sample-topic.rst
@@ -0,0 +1,7 @@
+0-sample-topic
+--------------
+
+* This is a sample release note for the change in a topic.
+  Developers should add similar notes for each topic branch
+  making a noteworthy change.  Each document should be named
+  and titled to match the topic name to avoid merge conflicts.
diff --git a/Help/release/dev/ExternalProject-git-no-recurse.rst b/Help/release/dev/ExternalProject-git-no-recurse.rst
new file mode 100644
index 0000000..b9e09d3
--- /dev/null
+++ b/Help/release/dev/ExternalProject-git-no-recurse.rst
@@ -0,0 +1,7 @@
+ExternalProject-git-no-recurse
+------------------------------
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add`
+  command gained a ``GIT_SUBMODULES_RECURSE`` option to specify whether
+  Git submodules should be updated recursively.  The default is on to
+  preserve existing behavior.
diff --git a/Help/release/dev/FindCURL-cmake-package.rst b/Help/release/dev/FindCURL-cmake-package.rst
new file mode 100644
index 0000000..67c5bbc
--- /dev/null
+++ b/Help/release/dev/FindCURL-cmake-package.rst
@@ -0,0 +1,7 @@
+FindCURL-cmake-package
+----------------------
+
+* The :module:`FindCURL` module learned to find CURL using
+  the ``CURLConfig.cmake`` package configuration file generated by
+  CURL's cmake buildsystem.  It also gained a new ``CURL_NO_CURL_CMAKE``
+  option to disable this behavior.
diff --git a/Help/release/dev/FindFLEX-work-dir.rst b/Help/release/dev/FindFLEX-work-dir.rst
new file mode 100644
index 0000000..3569185
--- /dev/null
+++ b/Help/release/dev/FindFLEX-work-dir.rst
@@ -0,0 +1,6 @@
+FindFLEX-work-dir
+-----------------
+
+* The :module:`FindFLEX` module's ``FLEX_TARGET`` command now runs ``flex``
+  with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
+  See policy :policy:`CMP0098`.
diff --git a/Help/release/dev/FindLibArchive-target.rst b/Help/release/dev/FindLibArchive-target.rst
new file mode 100644
index 0000000..8998dae
--- /dev/null
+++ b/Help/release/dev/FindLibArchive-target.rst
@@ -0,0 +1,5 @@
+FindLibArchive-target
+---------------------
+
+* The :module:`FindLibArchive` module now returns an ``IMPORTED`` target
+  for libarchive.
diff --git a/Help/release/dev/Link-properties-transitive.rst b/Help/release/dev/Link-properties-transitive.rst
new file mode 100644
index 0000000..535b40c
--- /dev/null
+++ b/Help/release/dev/Link-properties-transitive.rst
@@ -0,0 +1,8 @@
+Link-properties-transitive
+--------------------------
+
+* Target link properties :prop_tgt:`INTERFACE_LINK_OPTIONS`,
+  :prop_tgt:`INTERFACE_LINK_DIRECTORIES` and
+  :prop_tgt:`INTERFACE_LINK_DEPENDS` are now transitive over private
+  dependency on static libraries.
+  See policy :policy:`CMP0099`.
diff --git a/Help/release/dev/ccmake-colored-values.rst b/Help/release/dev/ccmake-colored-values.rst
new file mode 100644
index 0000000..b00885d
--- /dev/null
+++ b/Help/release/dev/ccmake-colored-values.rst
@@ -0,0 +1,5 @@
+ccmake-colored-values
+---------------------
+
+* :manual:`ccmake(1)` now displays cache values using colors
+  based on the entry type if the terminal supports color.
diff --git a/Help/release/dev/ccmake_progress_bar_and_log_display.rst b/Help/release/dev/ccmake_progress_bar_and_log_display.rst
new file mode 100644
index 0000000..5c67c7d
--- /dev/null
+++ b/Help/release/dev/ccmake_progress_bar_and_log_display.rst
@@ -0,0 +1,6 @@
+ccmake_progress_bar_and_log_display
+-----------------------------------
+
+* :manual:`ccmake(1)` now displays messages and a progress bar during
+  configure and generate.  It will keep the output displayed if any
+  errors or warnings occurred.
diff --git a/Help/release/dev/command_rm.rst b/Help/release/dev/command_rm.rst
new file mode 100644
index 0000000..a58362e
--- /dev/null
+++ b/Help/release/dev/command_rm.rst
@@ -0,0 +1,12 @@
+Command-Line
+--------------------
+
+* :manual:`cmake(1)` gained a ``rm`` command line
+  option that can be used to remove directories (with ``-r`` or ``-R`` flag)
+  and files.
+  If the ``-f`` flag is not specified, attempting to remove a file that
+  doesn't exist returns an non-zero error code.
+  This command deprecates ``remove`` and ``remove_directory``.
+  The ``remove`` implementation was buggy and always returned 0 when ``force``
+  flag was not present and a file didn't exist. It cannot be fixed without
+  breaking backwards compatibility so we introduced ``rm``.
diff --git a/Help/release/dev/compiler-launcher-env.rst b/Help/release/dev/compiler-launcher-env.rst
new file mode 100644
index 0000000..58519d9
--- /dev/null
+++ b/Help/release/dev/compiler-launcher-env.rst
@@ -0,0 +1,5 @@
+compiler-launcher-env
+---------------------
+
+* The :envvar:`CMAKE_<LANG>_COMPILER_LAUNCHER` environment variable may now be
+  used to initialize the :variable:`CMAKE_<LANG>_COMPILER_LAUNCHER` variable.
diff --git a/Help/release/dev/cpack-nsis-uninstaller-name.rst b/Help/release/dev/cpack-nsis-uninstaller-name.rst
new file mode 100644
index 0000000..b7ceb4c
--- /dev/null
+++ b/Help/release/dev/cpack-nsis-uninstaller-name.rst
@@ -0,0 +1,6 @@
+cpack-nsis-uninstaller-name
+---------------------------
+
+* The :cpack_gen:`CPack NSIS Generator` now supports
+  :variable:`CPACK_NSIS_UNINSTALL_NAME`.
+  This can be used to specify the name of the Uninstall program.
diff --git a/Help/release/dev/cpack-nsis-welcome-finish-page-title.rst b/Help/release/dev/cpack-nsis-welcome-finish-page-title.rst
new file mode 100644
index 0000000..8091d31
--- /dev/null
+++ b/Help/release/dev/cpack-nsis-welcome-finish-page-title.rst
@@ -0,0 +1,10 @@
+cpack-nsis-welcome-finish-page-title
+------------------------------------
+
+* The :cpack_gen:`CPack NSIS Generator` now supports
+  :variable:`CPACK_NSIS_WELCOME_TITLE` and :variable:`CPACK_NSIS_WELCOME_TITLE_3LINES`.
+  These can be used to specify the welcome page title and display it in 3 lines.
+
+* The :cpack_gen:`CPack NSIS Generator` now supports
+  :variable:`CPACK_NSIS_FINISH_TITLE` and :variable:`CPACK_NSIS_FINISH_TITLE_3LINES`.
+  These can be used to specify the finish page title and display it in 3 lines.
diff --git a/Help/release/dev/cpack-pkg-background.rst b/Help/release/dev/cpack-pkg-background.rst
new file mode 100644
index 0000000..796f5d6
--- /dev/null
+++ b/Help/release/dev/cpack-pkg-background.rst
@@ -0,0 +1,8 @@
+cpack-pkg-background
+--------------------
+
+* The :cpack_gen:`CPack productbuild Generator` and
+  :cpack_gen:`CPack PackageMaker Generator` gained options
+  :variable:`CPACK_PRODUCTBUILD_BACKGROUND` and
+  :variable:`CPACK_PACKAGEMAKER_BACKGROUND`, respectively,
+  to specify a background image for the macOS installer.
diff --git a/Help/release/dev/ctest-repeat.rst b/Help/release/dev/ctest-repeat.rst
new file mode 100644
index 0000000..b1ff59b
--- /dev/null
+++ b/Help/release/dev/ctest-repeat.rst
@@ -0,0 +1,10 @@
+ctest-repeat
+------------
+
+* The :manual:`ctest(1)` tool gained a ``--repeat <mode>:<n>`` option
+  to specify conditions in which to repeat tests.  This generalizes
+  the existing ``--repeat-until-fail <n>`` option to add modes for
+  ``until-pass`` and ``after-timeout``.
+
+* The :command:`ctest_test` command gained a ``REPEAT <mode>:<n>`` option
+  to specify conditions in which to repeat tests.
diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst
new file mode 100644
index 0000000..401f4b2
--- /dev/null
+++ b/Help/release/dev/deprecate-policy-old.rst
@@ -0,0 +1,8 @@
+deprecate-policy-old
+--------------------
+
+* An explicit deprecation diagnostic was added for policy ``CMP0068``
+  and policy ``CMP0069`` (``CMP0067`` and below were already deprecated).
+  The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
+  of all policies are deprecated and that projects should port to the
+  NEW behaviors.
diff --git a/Help/release/dev/export-compile-commands-environment-variable.rst b/Help/release/dev/export-compile-commands-environment-variable.rst
new file mode 100644
index 0000000..da9d66b
--- /dev/null
+++ b/Help/release/dev/export-compile-commands-environment-variable.rst
@@ -0,0 +1,6 @@
+export-compile-commands-environment-variable
+--------------------------------------------
+
+* The :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` variable now takes its
+  initial value from the :envvar:`CMAKE_EXPORT_COMPILE_COMMANDS` environment
+  variable if no explicit configuration is given.
diff --git a/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT.rst b/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT.rst
new file mode 100644
index 0000000..a6a5c71
--- /dev/null
+++ b/Help/release/dev/feature-CMAKE_MESSAGE_CONTEXT.rst
@@ -0,0 +1,11 @@
+feature-CMAKE_MESSAGE_CONTEXT
+-----------------------------
+
+* The :variable:`CMAKE_MESSAGE_LOG_LEVEL` variable can now be used
+  to persist a log level between CMake runs, unlike the ``--log-level``
+  command line option which only applies to that particular run.
+
+* The :command:`message` command learned to output context provided in
+  the :variable:`CMAKE_MESSAGE_CONTEXT` variable for log levels
+  ``NOTICE`` and below.  Enable this output with the new ``--log-context``
+  command-line option or :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable.
diff --git a/Help/release/dev/fileapi-multi-config.rst b/Help/release/dev/fileapi-multi-config.rst
new file mode 100644
index 0000000..e0e2e16
--- /dev/null
+++ b/Help/release/dev/fileapi-multi-config.rst
@@ -0,0 +1,6 @@
+fileapi-multi-config
+--------------------
+
+* The :manual:`file API <cmake-file-api(7)>` index file now emits a
+  ``multiConfig`` flag specifying whether or not the generator supports
+  multiple output configurations.
diff --git a/Help/release/dev/foreach-ZIP_LISTS.rst b/Help/release/dev/foreach-ZIP_LISTS.rst
new file mode 100644
index 0000000..d45d9b9
--- /dev/null
+++ b/Help/release/dev/foreach-ZIP_LISTS.rst
@@ -0,0 +1,5 @@
+foreach-ZIP_LISTS
+-----------------
+
+* The :command:`foreach` learned a new option ``ZIP_LISTS`` to iterate
+  over multiple lists simultaneously.
diff --git a/Help/release/dev/install-name-dir-genex.rst b/Help/release/dev/install-name-dir-genex.rst
new file mode 100644
index 0000000..0cb41f0
--- /dev/null
+++ b/Help/release/dev/install-name-dir-genex.rst
@@ -0,0 +1,7 @@
+install-name-dir-genex
+----------------------
+
+* The :prop_tgt:`INSTALL_NAME_DIR` target property now supports
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+  In particular, the ``$<INSTALL_PREFIX>`` generator expression can
+  be used to set the directory relative to the install-time prefix.
diff --git a/Help/release/dev/load_cache-script-mode.rst b/Help/release/dev/load_cache-script-mode.rst
new file mode 100644
index 0000000..d84b08a
--- /dev/null
+++ b/Help/release/dev/load_cache-script-mode.rst
@@ -0,0 +1,5 @@
+load_cache-script-mode
+----------------------
+
+* The :command:`load_cache(READ_WITH_PREFIX)` command mode is now allowed
+  when using ``cmake -P`` to :ref:`Run a Script <Script Processing Mode>`.
diff --git a/Help/release/dev/mingw_no_sh.rst b/Help/release/dev/mingw_no_sh.rst
new file mode 100644
index 0000000..7008865
--- /dev/null
+++ b/Help/release/dev/mingw_no_sh.rst
@@ -0,0 +1,5 @@
+mingw-no-sh
+-----------
+
+* The :generator:`MinGW Makefiles` generator no longer issues an error if
+  ``sh.exe`` is present in the environment's ``PATH``.
diff --git a/Help/release/dev/new-message-types.rst b/Help/release/dev/new-message-types.rst
new file mode 100644
index 0000000..8f164b9
--- /dev/null
+++ b/Help/release/dev/new-message-types.rst
@@ -0,0 +1,5 @@
+new-message-types
+-----------------
+
+* The :command:`message` command gained new keywords ``CHECK_START``,
+  ``CHECK_PASS`` and ``CHECK_FAIL``.
diff --git a/Help/release/dev/ninja-tool.rst b/Help/release/dev/ninja-tool.rst
new file mode 100644
index 0000000..aa0292e
--- /dev/null
+++ b/Help/release/dev/ninja-tool.rst
@@ -0,0 +1,7 @@
+ninja-tool
+----------
+
+* The :generator:`Ninja` generator now prefers the first ninja build
+  tool to appear in the ``PATH`` no matter whether it is called
+  ``ninja-build``, ``ninja``, or ``samu``.  Previously the first
+  of those names to appear anywhere in the ``PATH`` would be preferred.
diff --git a/Help/release/dev/sdcc-new-librarian.rst b/Help/release/dev/sdcc-new-librarian.rst
new file mode 100644
index 0000000..93961ce
--- /dev/null
+++ b/Help/release/dev/sdcc-new-librarian.rst
@@ -0,0 +1,6 @@
+sdcc-new-librarian
+------------------
+
+* Since sdcc 3.2.0, sdcclib has been deprecated in favor of sdar as librarian.
+  Since sdcc 3.8.6, it has been removed from the distribution.
+  Use sdar if found, else use sdcclib to keep older compatibility.
diff --git a/Help/release/dev/vs-per-config-sources.rst b/Help/release/dev/vs-per-config-sources.rst
new file mode 100644
index 0000000..bf7572b
--- /dev/null
+++ b/Help/release/dev/vs-per-config-sources.rst
@@ -0,0 +1,5 @@
+vs-per-config-sources
+---------------------
+
+* :ref:`Visual Studio Generators` learned to support per-config sources.
+  Previously only :ref:`Command-Line Build Tool Generators` supported them.
diff --git a/Help/release/dev/vs-vctargetspath.rst b/Help/release/dev/vs-vctargetspath.rst
new file mode 100644
index 0000000..d40af34
--- /dev/null
+++ b/Help/release/dev/vs-vctargetspath.rst
@@ -0,0 +1,10 @@
+vs-vctargetspath
+----------------
+
+* With :ref:`Visual Studio Generators` for VS 2010 and above,
+  the :variable:`CMAKE_GENERATOR_TOOLSET` setting gained an option
+  to specify the ``VCTargetsPath`` value for project files.
+
+* The :variable:`CMAKE_VS_GLOBALS` variable value now applies during
+  compiler identification and in targets created by the
+  :command:`add_custom_target` command.
diff --git a/Help/release/dev/vs_dotnet_documentation_file.rst b/Help/release/dev/vs_dotnet_documentation_file.rst
new file mode 100644
index 0000000..fdffb1c
--- /dev/null
+++ b/Help/release/dev/vs_dotnet_documentation_file.rst
@@ -0,0 +1,6 @@
+vs_dotnet_documentation_file
+----------------------------
+
+* The :prop_tgt:`VS_DOTNET_DOCUMENTATION_FILE` target property was added
+  to tell :ref:`Visual Studio Generators` to generate a ``DocumentationFile``
+  reference in ``.csproj`` files.
diff --git a/Help/release/dev/xcode-scheme-env.rst b/Help/release/dev/xcode-scheme-env.rst
new file mode 100644
index 0000000..238cb61
--- /dev/null
+++ b/Help/release/dev/xcode-scheme-env.rst
@@ -0,0 +1,5 @@
+xcode-scheme-env
+----------------
+
+* The :variable:`CMAKE_XCODE_SCHEME_ENVIRONMENT` variable was added
+  to initialize the :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` target property.
diff --git a/Help/release/dev/xcode-scheme-workdir.rst b/Help/release/dev/xcode-scheme-workdir.rst
new file mode 100644
index 0000000..8eb5ed8
--- /dev/null
+++ b/Help/release/dev/xcode-scheme-workdir.rst
@@ -0,0 +1,7 @@
+xcode-scheme-workdir
+--------------------
+
+* The Xcode generator learnt to set the value of the
+  ``Custom Working Directory`` schema
+  option with the :prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY`
+  target property.
diff --git a/Help/release/dev/xlf-ninja.rst b/Help/release/dev/xlf-ninja.rst
new file mode 100644
index 0000000..916e713
--- /dev/null
+++ b/Help/release/dev/xlf-ninja.rst
@@ -0,0 +1,5 @@
+xlf-ninja
+---------
+
+* The IBM XL Fortran compiler is now supported by the :generator:`Ninja`
+  generator.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index 0cc3f97..a4585a5 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -7,6 +7,8 @@
   This file should include the adjacent "dev.txt" file
   in development versions but not in release versions.
 
+.. include:: dev.txt
+
 Releases
 ========
 
diff --git a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
index 4548abc..6d2450b 100644
--- a/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
+++ b/Help/variable/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -25,6 +25,9 @@
     }
   ]
 
+This is initialized by the :envvar:`CMAKE_EXPORT_COMPILE_COMMANDS` environment
+variable.
+
 .. note::
   This option is implemented only by :ref:`Makefile Generators`
   and the :generator:`Ninja`.  It is ignored on other generators.
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index 222824f..53ad2f3 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -58,3 +58,8 @@
   Specify the toolset version to use.  Supported by VS 2017
   and above with the specified toolset installed.
   See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_VERSION` variable.
+
+``VCTargetsPath=<path>``
+  Specify an alternative ``VCTargetsPath`` value for Visual Studio
+  project files.  This allows use of VS platform extension configuration
+  files (``.props`` and ``.targets``) that are not installed with VS.
diff --git a/Help/variable/CMAKE_HOST_SYSTEM_PROCESSOR.rst b/Help/variable/CMAKE_HOST_SYSTEM_PROCESSOR.rst
index ba8a850..5f08728 100644
--- a/Help/variable/CMAKE_HOST_SYSTEM_PROCESSOR.rst
+++ b/Help/variable/CMAKE_HOST_SYSTEM_PROCESSOR.rst
@@ -3,6 +3,13 @@
 
 The name of the CPU CMake is running on.
 
-On systems that support ``uname``, this variable is set to the output of
-``uname -p``.  On Windows it is set to the value of the environment variable
-``PROCESSOR_ARCHITECTURE``.
+On Windows, this variable is set to the value of the environment variable
+``PROCESSOR_ARCHITECTURE``. On systems that support ``uname``, this variable is
+set to the output of:
+
+- ``uname -m`` on GNU, Linux, Cygwin, Darwin, Android, or
+- ``arch`` on OpenBSD, or
+- on other systems,
+
+  * ``uname -p`` if its exit code is nonzero, or
+  * ``uname -m`` otherwise.
diff --git a/Help/variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH.rst b/Help/variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH.rst
index 78148d5..a99c108 100644
--- a/Help/variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH.rst
+++ b/Help/variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH.rst
@@ -3,7 +3,11 @@
 
 Add paths to linker search and installed rpath.
 
-``CMAKE_INSTALL_RPATH_USE_LINK_PATH`` is a boolean that if set to ``true``
-will append directories in the linker search path and outside the
-project to the :prop_tgt:`INSTALL_RPATH`.  This is used to initialize the
-target property :prop_tgt:`INSTALL_RPATH_USE_LINK_PATH` for all targets.
+``CMAKE_INSTALL_RPATH_USE_LINK_PATH`` is a boolean that if set to ``True``
+will append to the runtime search path (rpath) of installed binaries
+any directories outside the project that are in the linker search path or
+contain linked library files.  The directories are appended after the
+value of the :prop_tgt:`INSTALL_RPATH` target property.
+
+This varibale is used to initialize the target property
+:prop_tgt:`INSTALL_RPATH_USE_LINK_PATH` for all targets.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
index e6c8bb5..e5dda60 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_LAUNCHER.rst
@@ -5,3 +5,6 @@
 This variable is used to initialize the property on each target as it is
 created.  This is done only when ``<LANG>`` is ``C``, ``CXX``, ``Fortran``,
 or ``CUDA``.
+
+This variable is initialized to the :envvar:`CMAKE_<LANG>_COMPILER_LAUNCHER`
+environment variable if it is set.
diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
new file mode 100644
index 0000000..6b4ca40
--- /dev/null
+++ b/Help/variable/CMAKE_MESSAGE_CONTEXT.rst
@@ -0,0 +1,62 @@
+CMAKE_MESSAGE_CONTEXT
+---------------------
+
+When enabled by the :manual:`cmake <cmake(1)>` ``--log-context`` command line
+option or the :variable:`CMAKE_MESSAGE_CONTEXT_SHOW` variable, the
+:command:`message` command converts the ``CMAKE_MESSAGE_CONTEXT`` list into a
+dot-separated string surrounded by square brackets and prepends it to each line
+for messages of log levels ``NOTICE`` and below.
+
+For logging contexts to work effectively, projects should generally
+``APPEND`` and ``POP_BACK`` an item to the current value of
+``CMAKE_MESSAGE_CONTEXT`` rather than replace it.
+Projects should not assume the message context at the top of the source tree
+is empty, as there are scenarios where the context might have already been set
+(e.g. hierarchical projects).
+
+.. warning::
+
+  Valid context names are restricted to anything that could be used
+  as a CMake variable name.  All names that begin with an underscore
+  or the string ``cmake_`` are also reserved for use by CMake and
+  should not be used by projects.
+
+Example:
+
+.. code-block:: cmake
+
+  function(bar)
+    list(APPEND CMAKE_MESSAGE_CONTEXT "bar")
+    message(VERBOSE "bar VERBOSE message")
+  endfunction()
+
+  function(baz)
+    list(APPEND CMAKE_MESSAGE_CONTEXT "baz")
+    message(DEBUG "baz DEBUG message")
+  endfunction()
+
+  function(foo)
+    list(APPEND CMAKE_MESSAGE_CONTEXT "foo")
+    bar()
+    message(TRACE "foo TRACE message")
+    baz()
+  endfunction()
+
+  list(APPEND CMAKE_MESSAGE_CONTEXT "top")
+
+  message(VERBOSE "Before `foo`")
+  foo()
+  message(VERBOSE "After `foo`")
+
+  list(POP_BACK CMAKE_MESSAGE_CONTEXT)
+
+
+Which results in the following output:
+
+.. code-block:: none
+
+  -- [top] Before `foo`
+  -- [top.foo.bar] bar VERBOSE message
+  -- [top.foo] foo TRACE message
+  -- [top.foo.baz] baz DEBUG message
+  -- [top] After `foo`
diff --git a/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst
new file mode 100644
index 0000000..7ec218e
--- /dev/null
+++ b/Help/variable/CMAKE_MESSAGE_CONTEXT_SHOW.rst
@@ -0,0 +1,15 @@
+CMAKE_MESSAGE_CONTEXT_SHOW
+--------------------------
+
+Setting this variable to true enables showing a context with each line
+logged by the :command:`message` command (see :variable:`CMAKE_MESSAGE_CONTEXT`
+for how the context itself is specified).
+
+This variable is an alternative to providing the ``--log-context`` option
+on the :manual:`cmake <cmake(1)>` command line.  Whereas the command line
+option will apply only to that one CMake run, setting
+``CMAKE_MESSAGE_CONTEXT_SHOW`` to true as a cache variable will ensure that
+subsequent CMake runs will continue to show the message context.
+
+Projects should not set ``CMAKE_MESSAGE_CONTEXT_SHOW``.  It is intended for
+users so that they may control whether or not to include context with messages.
diff --git a/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
new file mode 100644
index 0000000..1d4cfe6
--- /dev/null
+++ b/Help/variable/CMAKE_MESSAGE_LOG_LEVEL.rst
@@ -0,0 +1,15 @@
+CMAKE_MESSAGE_LOG_LEVEL
+-----------------------
+
+When set, this variable specifies the logging level used by the
+:command:`message` command.  Valid values are the same as those for the
+``--log-level`` command line option of the :manual:`cmake(1)` program.
+If this variable is set and the ``--log-level`` command line option is
+given, the command line option takes precedence.
+
+The main advantage to using this variable is to make a log level persist
+between CMake runs.  Setting it as a cache variable will ensure that
+subsequent CMake runs will continue to use the chosen log level.
+
+Projects should not set this variable, it is intended for users so that
+they may control the log level according to their own needs.
diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE.rst
index 965c94e..5835264 100644
--- a/Help/variable/CMAKE_PROJECT_INCLUDE.rst
+++ b/Help/variable/CMAKE_PROJECT_INCLUDE.rst
@@ -5,5 +5,6 @@
 :command:`project` command calls.  This is intended for injecting custom code
 into project builds without modifying their source.
 
-See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` and
+See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
+:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE` and
 :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variables.
diff --git a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
index 70b15e6..280c14a 100644
--- a/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
+++ b/Help/variable/CMAKE_PROJECT_INCLUDE_BEFORE.rst
@@ -5,5 +5,6 @@
 :command:`project` command calls.  This is intended for injecting custom code
 into project builds without modifying their source.
 
-See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` and
+See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
+:variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE` and
 :variable:`CMAKE_PROJECT_INCLUDE` variables.
diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst
index 3485c38..74247f1 100644
--- a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst
+++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE.rst
@@ -6,5 +6,6 @@
 name.  This is intended for injecting custom code into project builds without
 modifying their source.
 
-See also the :variable:`CMAKE_PROJECT_INCLUDE` and
+See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE`,
+:variable:`CMAKE_PROJECT_INCLUDE` and
 :variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variables.
diff --git a/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
new file mode 100644
index 0000000..db1432d
--- /dev/null
+++ b/Help/variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE_BEFORE.rst
@@ -0,0 +1,11 @@
+CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFORE
+-------------------------------------------
+
+A CMake language file or module to be included as the first step of any
+:command:`project` command calls that specify ``<PROJECT-NAME>`` as the project
+name.  This is intended for injecting custom code into project builds without
+modifying their source.
+
+See also the :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
+:variable:`CMAKE_PROJECT_INCLUDE` and
+:variable:`CMAKE_PROJECT_INCLUDE_BEFORE` variables.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst
new file mode 100644
index 0000000..4832659
--- /dev/null
+++ b/Help/variable/CMAKE_XCODE_SCHEME_ENVIRONMENT.rst
@@ -0,0 +1,15 @@
+CMAKE_XCODE_SCHEME_ENVIRONMENT
+------------------------------
+
+Specify environment variables that should be added to the Arguments
+section of the generated Xcode scheme.
+
+If set to a list of environment variables and values of the form
+``MYVAR=value`` those environment variables will be added to the
+scheme.
+
+This variable initializes the :prop_tgt:`XCODE_SCHEME_ENVIRONMENT`
+property on all targets.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst
new file mode 100644
index 0000000..cc690f7
--- /dev/null
+++ b/Help/variable/CMAKE_XCODE_SCHEME_WORKING_DIRECTORY.rst
@@ -0,0 +1,12 @@
+CMAKE_XCODE_SCHEME_WORKING_DIRECTORY
+------------------------------------
+
+Specify the ``Working Directory`` a of the `Run` and `Profile`
+action in the generated Xcode scheme.
+
+This variable initializes the
+:prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY`
+property on all targets.
+
+Please refer to the :prop_tgt:`XCODE_GENERATE_SCHEME` target property
+documentation to see all Xcode schema related properties.
diff --git a/Modules/CMakeAddFortranSubdirectory.cmake b/Modules/CMakeAddFortranSubdirectory.cmake
index 2613569..09e739d 100644
--- a/Modules/CMakeAddFortranSubdirectory.cmake
+++ b/Modules/CMakeAddFortranSubdirectory.cmake
@@ -155,7 +155,7 @@
   # make the external project always run make with each build
   externalproject_add_step(${project_name}_build forcebuild
     COMMAND ${CMAKE_COMMAND}
-    -E remove
+    -E rm -f
     ${CMAKE_CURRENT_BUILD_DIR}/${project_name}-prefix/src/${project_name}-stamp/${project_name}-build
     DEPENDEES configure
     DEPENDERS build
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index df43559..1e08bb7 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -110,6 +110,11 @@
   mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
 endif()
 
+if(NOT CMAKE_C_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_C_COMPILER_LAUNCHER})
+  set(CMAKE_C_COMPILER_LAUNCHER "$ENV{CMAKE_C_COMPILER_LAUNCHER}"
+    CACHE STRING "Compiler launcher for C.")
+endif()
+
 include(CMakeCommonLanguageInclude)
 
 # now define the following rule variables
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 711129a..e012abf 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -17,6 +17,11 @@
 set(CMAKE_CUDA_LINKER_PREFERENCE 15)
 set(CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES 1)
 
+set(CMAKE_CUDA_LIBRARY_ARCHITECTURE "@CMAKE_CUDA_LIBRARY_ARCHITECTURE@")
+if(CMAKE_CUDA_LIBRARY_ARCHITECTURE)
+  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CUDA_LIBRARY_ARCHITECTURE@")
+endif()
+
 set(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "@CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES@")
 
 set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES@")
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index b0d80d1..974f5fa 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -82,6 +82,11 @@
   mark_as_advanced(CMAKE_CUDA_STANDARD_LIBRARIES)
 endif()
 
+if(NOT CMAKE_CUDA_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_CUDA_COMPILER_LAUNCHER})
+  set(CMAKE_CUDA_COMPILER_LAUNCHER "$ENV{CMAKE_CUDA_COMPILER_LAUNCHER}"
+    CACHE STRING "Compiler launcher for CUDA.")
+endif()
+
 include(CMakeCommonLanguageInclude)
 
 # now define the following rules:
@@ -93,9 +98,7 @@
 # CMAKE_CUDA_LINK_EXECUTABLE
 
 if(CMAKE_CUDA_HOST_COMPILER)
-  set(CMAKE_CUDA_HOST_FLAGS "-ccbin=<CMAKE_CUDA_HOST_COMPILER>")
-else()
-  set(CMAKE_CUDA_HOST_FLAGS "")
+  string(APPEND _CMAKE_CUDA_EXTRA_FLAGS " -ccbin=<CMAKE_CUDA_HOST_COMPILER>")
 endif()
 
 set(__IMPLICT_LINKS )
@@ -135,26 +138,26 @@
 #Specify how to compile when ptx has been requested
 if(NOT CMAKE_CUDA_COMPILE_PTX_COMPILATION)
   set(CMAKE_CUDA_COMPILE_PTX_COMPILATION
-    "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -ptx <SOURCE> -o <OBJECT>")
+    "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -ptx <SOURCE> -o <OBJECT>")
 endif()
 
 #Specify how to compile when separable compilation has been requested
 if(NOT CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION)
   set(CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
-    "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -dc <SOURCE> -o <OBJECT>")
+    "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -dc <SOURCE> -o <OBJECT>")
 endif()
 
 #Specify how to compile when whole compilation has been requested
 if(NOT CMAKE_CUDA_COMPILE_WHOLE_COMPILATION)
   set(CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
-    "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -c <SOURCE> -o <OBJECT>")
+    "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -c <SOURCE> -o <OBJECT>")
 endif()
 
-if(CMAKE_GENERATOR STREQUAL "Ninja")
+if(CMAKE_GENERATOR STREQUAL "Ninja" AND NOT CMAKE_DEPFILE_FLAGS_CUDA )
   set(CMAKE_CUDA_COMPILE_DEPENDENCY_DETECTION
-    "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -M <SOURCE> -MT <OBJECT> -o $DEP_FILE")
+    "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -M <SOURCE> -MT <OBJECT> -o $DEP_FILE")
   #The Ninja generator uses the make file dependency files to determine what
-  #files need to be recompiled. Unfortunately, nvcc doesn't support building
+  #files need to be recompiled. Unfortunately, nvcc < 10.2 doesn't support building
   #a source file and generating the dependencies of said file in a single
   #invocation. Instead we have to state that you need to chain two commands.
   #
@@ -171,13 +174,6 @@
     "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
 endif()
 
-if( CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND
-    CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
-  set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets")
-else()
-  set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "")
-endif()
-
 # Add implicit host link directories that contain device libraries
 # to the device link line.
 set(__IMPLICT_DLINK_DIRS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
@@ -192,14 +188,15 @@
 endforeach()
 unset(__IMPLICT_DLINK_DIRS)
 
+
 #These are used when linking relocatable (dc) cuda code
 if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
   set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
-    "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_DLINK_FLAGS}")
+    "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_DLINK_FLAGS}")
 endif()
 if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
   set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
-    "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_DLINK_FLAGS}")
+    "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_DLINK_FLAGS}")
 endif()
 
 unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS)
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index a896b99..da7440a 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -207,6 +207,11 @@
   mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
 endif()
 
+if(NOT CMAKE_CXX_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_CXX_COMPILER_LAUNCHER})
+  set(CMAKE_CXX_COMPILER_LAUNCHER "$ENV{CMAKE_CXX_COMPILER_LAUNCHER}"
+    CACHE STRING "Compiler launcher for CXX.")
+endif()
+
 include(CMakeCommonLanguageInclude)
 
 # now define the following rules:
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
index 01a81a1..6adebae 100644
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ b/Modules/CMakeDetermineCompileFeatures.cmake
@@ -5,7 +5,7 @@
 function(cmake_determine_compile_features lang)
 
   if(lang STREQUAL C AND COMMAND cmake_record_c_compile_features)
-    message(STATUS "Detecting ${lang} compile features")
+    message(CHECK_START "Detecting ${lang} compile features")
 
     set(CMAKE_C90_COMPILE_FEATURES)
     set(CMAKE_C99_COMPILE_FEATURES)
@@ -16,7 +16,7 @@
     cmake_record_c_compile_features()
 
     if(NOT _result EQUAL 0)
-      message(STATUS "Detecting ${lang} compile features - failed")
+      message(CHECK_FAIL "failed")
       return()
     endif()
 
@@ -40,10 +40,10 @@
     set(CMAKE_C99_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES} PARENT_SCOPE)
     set(CMAKE_C11_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES} PARENT_SCOPE)
 
-    message(STATUS "Detecting ${lang} compile features - done")
+    message(CHECK_PASS "done")
 
   elseif(lang STREQUAL CXX AND COMMAND cmake_record_cxx_compile_features)
-    message(STATUS "Detecting ${lang} compile features")
+    message(CHECK_START "Detecting ${lang} compile features")
 
     set(CMAKE_CXX98_COMPILE_FEATURES)
     set(CMAKE_CXX11_COMPILE_FEATURES)
@@ -56,7 +56,7 @@
     cmake_record_cxx_compile_features()
 
     if(NOT _result EQUAL 0)
-      message(STATUS "Detecting ${lang} compile features - failed")
+      message(CHECK_FAIL "failed")
       return()
     endif()
 
@@ -90,7 +90,7 @@
     set(CMAKE_CXX17_COMPILE_FEATURES ${CMAKE_CXX17_COMPILE_FEATURES} PARENT_SCOPE)
     set(CMAKE_CXX20_COMPILE_FEATURES ${CMAKE_CXX20_COMPILE_FEATURES} PARENT_SCOPE)
 
-    message(STATUS "Detecting ${lang} compile features - done")
+    message(CHECK_PASS "done")
   endif()
 
 endfunction()
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 06f3ba2..c5611b5 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -12,7 +12,7 @@
 
 function(CMAKE_DETERMINE_COMPILER_ABI lang src)
   if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED)
-    message(STATUS "Detecting ${lang} compiler ABI info")
+    message(CHECK_START "Detecting ${lang} compiler ABI info")
 
     # Compile the ABI identification source.
     set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin")
@@ -66,7 +66,7 @@
 
     # Load the resulting information strings.
     if(CMAKE_${lang}_ABI_COMPILED AND NOT _copy_error)
-      message(STATUS "Detecting ${lang} compiler ABI info - done")
+      message(CHECK_PASS "done")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
       file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
@@ -124,8 +124,7 @@
       # a try-compile
       if("${lang}" MATCHES "Fortran"
           AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
-        set(_desc "Determine Intel Fortran Compiler Implicit Link Path")
-        message(STATUS "${_desc}")
+        message(CHECK_START "Determine Intel Fortran Compiler Implicit Link Path")
         # Build a sample project which reports symbols.
         try_compile(IFORT_LIB_PATH_COMPILED
           ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
@@ -138,8 +137,7 @@
           "${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
           "${_output}")
         include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
-        set(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
-        message(STATUS "${_desc}")
+        message(CHECK_PASS "done")
       endif()
 
       # Implicit link libraries cannot be used explicitly for multiple
@@ -166,7 +164,7 @@
       endif()
 
     else()
-      message(STATUS "Detecting ${lang} compiler ABI info - failed")
+      message(CHECK_FAIL "failed")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n${_copy_error}\n\n")
     endif()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 908e530..002fe21 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -182,6 +182,10 @@
     message(STATUS "The ${lang} compiler identification is unknown")
   endif()
 
+  if(lang STREQUAL "Fortran" AND CMAKE_${lang}_COMPILER_ID STREQUAL "XL")
+    set(CMAKE_${lang}_XL_CPP "${CMAKE_${lang}_COMPILER_ID_CPP}" PARENT_SCOPE)
+  endif()
+
   set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
   set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
   set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}" PARENT_SCOPE)
@@ -242,7 +246,7 @@
     set(id_platform ${CMAKE_VS_PLATFORM_NAME})
     set(id_lang "${lang}")
     set(id_PostBuildEvent_Command "")
-    if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$")
+    if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^([Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?|[Cc][Ll][Aa][Nn][Gg][Cc][Ll])$")
       set(id_cl_var "ClangClExecutable")
     elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
       set(id_cl clang.exe)
@@ -317,6 +321,15 @@
     if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
       set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>")
     endif()
+    if(CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR)
+      set(id_ToolsetVCTargetsDir "<VCTargetsPath>${CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR}</VCTargetsPath>")
+    endif()
+    set(id_CustomGlobals "")
+    foreach(pair IN LISTS CMAKE_VS_GLOBALS)
+      if("${pair}" MATCHES "([^=]+)=(.*)$")
+        string(APPEND id_CustomGlobals "<${CMAKE_MATCH_1}>${CMAKE_MATCH_2}</${CMAKE_MATCH_1}>\n    ")
+      endif()
+    endforeach()
     if(id_platform STREQUAL ARM64)
       set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>")
     elseif(id_platform STREQUAL ARM)
@@ -533,6 +546,12 @@
       ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
       RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
       )
+    if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "exec: [^\n]*\\((/[^,\n]*/cpp),CMakeFortranCompilerId.F")
+      set(_cpp "${CMAKE_MATCH_1}")
+      if(EXISTS "${_cpp}")
+        set(CMAKE_${lang}_COMPILER_ID_CPP "${_cpp}" PARENT_SCOPE)
+      endif()
+    endif()
   endif()
 
   # Check the result of compilation.
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 5ddd64f..e850541 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -271,6 +271,11 @@
 include(Compiler/${CMAKE_Fortran_COMPILER_ID}-FindBinUtils OPTIONAL)
 unset(_CMAKE_PROCESSING_LANGUAGE)
 
+if(CMAKE_Fortran_XL_CPP)
+  set(_SET_CMAKE_Fortran_XL_CPP
+    "set(CMAKE_Fortran_XL_CPP \"${CMAKE_Fortran_XL_CPP}\")")
+endif()
+
 if(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID)
   set(_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID
     "set(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID ${CMAKE_Fortran_COMPILER_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index dc208c6..f3ec4da 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -43,7 +43,7 @@
     else()
       exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
     endif()
-    if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$")
+    if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$|Android")
       exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
         RETURN_VALUE val)
       if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" AND
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index ae7b73a..34f44aa 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -6,6 +6,7 @@
 set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
 set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@")
 set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
+@_SET_CMAKE_Fortran_XL_CPP@
 @_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID@
 @SET_MSVC_Fortran_ARCHITECTURE_ID@
 set(CMAKE_AR "@CMAKE_AR@")
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index ffa6a24..e80716b 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -163,6 +163,11 @@
 
 cmake_initialize_per_config_variable(CMAKE_Fortran_FLAGS "Flags used by the Fortran compiler")
 
+if(NOT CMAKE_Fortran_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_Fortran_COMPILER_LAUNCHER})
+  set(CMAKE_Fortran_COMPILER_LAUNCHER "$ENV{CMAKE_Fortran_COMPILER_LAUNCHER}"
+    CACHE STRING "Compiler launcher for Fortran.")
+endif()
+
 include(CMakeCommonLanguageInclude)
 
 # now define the following rule variables
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 77d8cfd..7efe5c4 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -51,16 +51,16 @@
     set_property(GLOBAL PROPERTY TARGET_MESSAGES ${CMAKE_TARGET_MESSAGES})
   endif()
   if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
-    set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
-      "Enable/Disable output of compile commands during generation."
+    set(CMAKE_EXPORT_COMPILE_COMMANDS "$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}"
+      CACHE BOOL "Enable/Disable output of compile commands during generation."
       )
     mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
   endif()
 endif()
 
 if(CMAKE_GENERATOR MATCHES "Ninja")
-  set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
-    "Enable/Disable output of compile commands during generation."
+  set(CMAKE_EXPORT_COMPILE_COMMANDS "$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}"
+    CACHE BOOL "Enable/Disable output of compile commands during generation."
     )
   mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
 endif()
diff --git a/Modules/CMakeGraphVizOptions.cmake b/Modules/CMakeGraphVizOptions.cmake
index 1911e73..be4a3be 100644
--- a/Modules/CMakeGraphVizOptions.cmake
+++ b/Modules/CMakeGraphVizOptions.cmake
@@ -5,119 +5,145 @@
 CMakeGraphVizOptions
 --------------------
 
-The builtin graphviz support of CMake.
+The builtin Graphviz support of CMake.
 
-Variables specific to the graphviz support
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Generating Graphviz files
+^^^^^^^^^^^^^^^^^^^^^^^^^
 
-CMake
-can generate `graphviz <http://www.graphviz.org/>`_ files, showing the dependencies between the
-targets in a project and also external libraries which are linked
-against.  When CMake is run with the ``--graphviz=foo.dot`` option, it will
-produce:
+CMake can generate `Graphviz <https://www.graphviz.org/>`_ files showing the
+dependencies between the targets in a project, as well as external libraries
+which are linked against.
 
-* a ``foo.dot`` file showing all dependencies in the project
-* a ``foo.dot.<target>`` file for each target, file showing on which other targets the respective target depends
-* a ``foo.dot.<target>.dependers`` file, showing which other targets depend on the respective target
+When running CMake with the ``--graphviz=foo.dot`` option, it produces:
 
-The different dependency types ``PUBLIC``, ``PRIVATE`` and ``INTERFACE``
+* a ``foo.dot`` file, showing all dependencies in the project
+* a ``foo.dot.<target>`` file for each target, showing on which other targets
+  it depends
+* a ``foo.dot.<target>.dependers`` file for each target, showing which other
+  targets depend on it
+
+Those .dot files can be converted to images using the *dot* command from the
+Graphviz package:
+
+.. code-block:: shell
+
+  dot -Tpng -o foo.png foo.dot
+
+The different dependency types ``PUBLIC``, ``INTERFACE`` and ``PRIVATE``
 are represented as solid, dashed and dotted edges.
 
-This can result in huge graphs.  Using the file
-``CMakeGraphVizOptions.cmake`` the look and content of the generated
-graphs can be influenced.  This file is searched first in
-:variable:`CMAKE_BINARY_DIR` and then in :variable:`CMAKE_SOURCE_DIR`.  If found, it is
-read and the variables set in it are used to adjust options for the
-generated graphviz files.
+Variables specific to the Graphviz support
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-.. variable:: GRAPHVIZ_GRAPH_TYPE
-
- The graph type.
-
- * Mandatory : NO
- * Default   : "digraph"
-
- Valid graph types are:
-
- * "graph" : Nodes are joined with lines
- * "digraph" : Nodes are joined with arrows showing direction
- * "strict graph" : Like "graph" but max one line between each node
- * "strict digraph" : Like "graph" but max one line between each node in each direction
+The resulting graphs can be huge.  The look and content of the generated graphs
+can be controlled using the file ``CMakeGraphVizOptions.cmake``.  This file is
+first searched in :variable:`CMAKE_BINARY_DIR`, and then in
+:variable:`CMAKE_SOURCE_DIR`.  If found, the variables set in it are used to
+adjust options for the generated Graphviz files.
 
 .. variable:: GRAPHVIZ_GRAPH_NAME
 
  The graph name.
 
- * Mandatory : NO
- * Default   : "GG"
+ * Mandatory: NO
+ * Default: value of :variable:`CMAKE_PROJECT_NAME`
 
 .. variable:: GRAPHVIZ_GRAPH_HEADER
 
- The header written at the top of the graphviz file.
+ The header written at the top of the Graphviz files.
 
- * Mandatory : NO
- * Default   : "node [n  fontsize = "12"];"
+ * Mandatory: NO
+ * Default: "node [ fontsize = "12" ];"
 
 .. variable:: GRAPHVIZ_NODE_PREFIX
 
- The prefix for each node in the graphviz file.
+ The prefix for each node in the Graphviz files.
 
- * Mandatory : NO
- * Default   : "node"
+ * Mandatory: NO
+ * Default: "node"
 
 .. variable:: GRAPHVIZ_EXECUTABLES
 
- Set this to FALSE to exclude executables from the generated graphs.
+ Set to FALSE to exclude executables from the generated graphs.
 
- * Mandatory : NO
- * Default   : TRUE
+ * Mandatory: NO
+ * Default: TRUE
 
 .. variable:: GRAPHVIZ_STATIC_LIBS
 
- Set this to FALSE to exclude static libraries from the generated graphs.
+ Set to FALSE to exclude static libraries from the generated graphs.
 
- * Mandatory : NO
- * Default   : TRUE
+ * Mandatory: NO
+ * Default: TRUE
 
 .. variable:: GRAPHVIZ_SHARED_LIBS
 
- Set this to FALSE to exclude shared libraries from the generated graphs.
+ Set to FALSE to exclude shared libraries from the generated graphs.
 
- * Mandatory : NO
- * Default   : TRUE
+ * Mandatory: NO
+ * Default: TRUE
 
 .. variable:: GRAPHVIZ_MODULE_LIBS
 
- Set this to FALSE to exclude module libraries from the generated graphs.
+ Set to FALSE to exclude module libraries from the generated graphs.
 
- * Mandatory : NO
- * Default   : TRUE
+ * Mandatory: NO
+ * Default: TRUE
+
+.. variable:: GRAPHVIZ_INTERFACE_LIBS
+
+ Set to FALSE to exclude interface libraries from the generated graphs.
+
+ * Mandatory: NO
+ * Default: TRUE
+
+.. variable:: GRAPHVIZ_OBJECT_LIBS
+
+ Set to FALSE to exclude object libraries from the generated graphs.
+
+ * Mandatory: NO
+ * Default: TRUE
+
+.. variable:: GRAPHVIZ_UNKNOWN_LIBS
+
+ Set to FALSE to exclude unknown libraries from the generated graphs.
+
+ * Mandatory: NO
+ * Default: TRUE
 
 .. variable:: GRAPHVIZ_EXTERNAL_LIBS
 
- Set this to FALSE to exclude external libraries from the generated graphs.
+ Set to FALSE to exclude external libraries from the generated graphs.
 
- * Mandatory : NO
- * Default   : TRUE
+ * Mandatory: NO
+ * Default: TRUE
+
+.. variable:: GRAPHVIZ_CUSTOM_TARGETS
+
+ Set to TRUE to include custom targets in the generated graphs.
+
+ * Mandatory: NO
+ * Default: FALSE
 
 .. variable:: GRAPHVIZ_IGNORE_TARGETS
 
- A list of regular expressions for ignoring targets.
+ A list of regular expressions for names of targets to exclude from the
+ generated graphs.
 
- * Mandatory : NO
- * Default   : empty
+ * Mandatory: NO
+ * Default: empty
 
 .. variable:: GRAPHVIZ_GENERATE_PER_TARGET
 
- Set this to FALSE to exclude per target graphs ``foo.dot.<target>``.
+ Set to FALSE to not generate per-target graphs ``foo.dot.<target>``.
 
- * Mandatory : NO
- * Default   : TRUE
+ * Mandatory: NO
+ * Default: TRUE
 
 .. variable:: GRAPHVIZ_GENERATE_DEPENDERS
 
- Set this to FALSE to exclude depender graphs ``foo.dot.<target>.dependers``.
+ Set to FALSE to not generate depender graphs ``foo.dot.<target>.dependers``.
 
- * Mandatory : NO
- * Default   : TRUE
+ * Mandatory: NO
+ * Default: TRUE
 #]=======================================================================]
diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake
index 523f00c..f026e9a 100644
--- a/Modules/CMakeMinGWFindMake.cmake
+++ b/Modules/CMakeMinGWFindMake.cmake
@@ -7,10 +7,5 @@
   c:/MinGW/bin /MinGW/bin
   "[HKEY_CURRENT_USER\\Software\\CodeBlocks;Path]/MinGW/bin"
   )
-find_program(CMAKE_SH sh.exe )
-if(CMAKE_SH)
-  message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
-  set(CMAKE_MAKE_PROGRAM NOTFOUND)
-endif()
 
-mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH)
+mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeNinjaFindMake.cmake b/Modules/CMakeNinjaFindMake.cmake
index 702af13..32f78da 100644
--- a/Modules/CMakeNinjaFindMake.cmake
+++ b/Modules/CMakeNinjaFindMake.cmake
@@ -4,5 +4,6 @@
 
 find_program(CMAKE_MAKE_PROGRAM
   NAMES ninja-build ninja samu
+  NAMES_PER_DIR
   DOC "Program used to build from build.ninja files.")
 mark_as_advanced(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 7bf6fde..eadea89 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -27,7 +27,7 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_C_COMPILER_WORKS)
-  PrintTestCompilerStatus("C" "")
+  PrintTestCompilerStatus("C")
   __TestCompiler_setTryCompileTargetType()
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
     "#ifdef __cplusplus\n"
@@ -52,7 +52,7 @@
 endif()
 
 if(NOT CMAKE_C_COMPILER_WORKS)
-  PrintTestCompilerStatus("C" " -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the C compiler works failed with "
     "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
@@ -63,7 +63,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(C_TEST_WAS_RUN)
-    PrintTestCompilerStatus("C" " -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the C compiler works passed with "
       "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CMakeTestCSharpCompiler.cmake b/Modules/CMakeTestCSharpCompiler.cmake
index 6715c30..1119a45 100644
--- a/Modules/CMakeTestCSharpCompiler.cmake
+++ b/Modules/CMakeTestCSharpCompiler.cmake
@@ -20,7 +20,9 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_CSharp_COMPILER_WORKS)
-  PrintTestCompilerStatus("C#" "${CMAKE_CSharp_COMPILER}")
+  # Don't call PrintTestCompilerStatus() because the "C#" we want to pass
+  # as the LANG doesn't match with the variable name "CMAKE_CSharp_COMPILER"
+  message(CHECK_START "Check for working C# compiler: ${CMAKE_CSharp_COMPILER}")
   file(WRITE "${test_compile_file}"
     "namespace Test {"
     "   public class CSharp {"
@@ -38,7 +40,7 @@
 endif()
 
 if(NOT CMAKE_CSharp_COMPILER_WORKS)
-  PrintTestCompilerStatus("C#" "${CMAKE_CSharp_COMPILER} -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the C# compiler works failed with "
     "the following output:\n${__CMAKE_CSharp_COMPILER_OUTPUT}\n\n")
@@ -49,7 +51,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(CSharp_TEST_WAS_RUN)
-    PrintTestCompilerStatus("C#" "${CMAKE_CSharp_COMPILER} -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the C# compiler works passed with "
       "the following output:\n${__CMAKE_CSharp_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake
index f0454da..c145813 100644
--- a/Modules/CMakeTestCUDACompiler.cmake
+++ b/Modules/CMakeTestCUDACompiler.cmake
@@ -20,7 +20,7 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_CUDA_COMPILER_WORKS)
-  PrintTestCompilerStatus("CUDA" "")
+  PrintTestCompilerStatus("CUDA")
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.cu
     "#ifndef __CUDACC__\n"
     "# error \"The CMAKE_CUDA_COMPILER is set to an invalid CUDA compiler\"\n"
@@ -38,7 +38,7 @@
 endif()
 
 if(NOT CMAKE_CUDA_COMPILER_WORKS)
-  PrintTestCompilerStatus("CUDA" " -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the CUDA compiler works failed with "
     "the following output:\n${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n")
@@ -49,7 +49,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(CUDA_TEST_WAS_RUN)
-    PrintTestCompilerStatus("CUDA" " -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CUDA compiler works passed with "
       "the following output:\n${__CMAKE_CUDA_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 7e595b7..bd42153 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -27,7 +27,7 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_CXX_COMPILER_WORKS)
-  PrintTestCompilerStatus("CXX" "")
+  PrintTestCompilerStatus("CXX")
   __TestCompiler_setTryCompileTargetType()
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
     "#ifndef __cplusplus\n"
@@ -45,7 +45,7 @@
 endif()
 
 if(NOT CMAKE_CXX_COMPILER_WORKS)
-  PrintTestCompilerStatus("CXX" " -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the CXX compiler works failed with "
     "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
@@ -56,7 +56,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(CXX_TEST_WAS_RUN)
-    PrintTestCompilerStatus("CXX" " -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler works passed with "
       "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
index 6ee5175..da7c007 100644
--- a/Modules/CMakeTestCompilerCommon.cmake
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -2,8 +2,15 @@
 # file Copyright.txt or https://cmake.org/licensing for details.
 
 
-function(PrintTestCompilerStatus LANG MSG)
-  message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
+function(PrintTestCompilerStatus LANG)
+  # ARGN shouldn't be needed now, but it is there to preserve backward
+  # compatibility in case this function is called from project code or
+  # custom toolchains (they shouldn't, but we can easily support it)
+  message(CHECK_START "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${ARGN}")
+endfunction()
+
+function(PrintTestCompilerResult TYPE MSG)
+  message(${TYPE} "${MSG}")
 endfunction()
 
 # if required set the target type if not already explicitly set
diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake
index e9860e9..7461f9c 100644
--- a/Modules/CMakeTestFortranCompiler.cmake
+++ b/Modules/CMakeTestFortranCompiler.cmake
@@ -21,7 +21,7 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_Fortran_COMPILER_WORKS)
-  PrintTestCompilerStatus("Fortran" "")
+  PrintTestCompilerStatus("Fortran")
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
         PROGRAM TESTFortran
         PRINT *, 'Hello'
@@ -37,7 +37,7 @@
 endif()
 
 if(NOT CMAKE_Fortran_COMPILER_WORKS)
-  PrintTestCompilerStatus("Fortran" "  -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the Fortran compiler works failed with "
     "the following output:\n${OUTPUT}\n\n")
@@ -48,7 +48,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(FORTRAN_TEST_WAS_RUN)
-    PrintTestCompilerStatus("Fortran" "  -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the Fortran compiler works passed with "
       "the following output:\n${OUTPUT}\n\n")
@@ -60,7 +60,7 @@
 
   # Test for Fortran 90 support by using an f90-specific construct.
   if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
-    message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
+    message(CHECK_START "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
     file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
       PROGRAM TESTFortran90
       integer stop ; stop = 1 ; do while ( stop .eq. 0 ) ; end do
@@ -70,13 +70,13 @@
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
       OUTPUT_VARIABLE OUTPUT)
     if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
-      message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
+      message(CHECK_PASS "yes")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the Fortran compiler supports Fortran 90 passed with "
         "the following output:\n${OUTPUT}\n\n")
       set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
     else()
-      message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
+      message(CHECK_FAIL "no")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the Fortran compiler supports Fortran 90 failed with "
         "the following output:\n${OUTPUT}\n\n")
diff --git a/Modules/CMakeTestOBJCCompiler.cmake b/Modules/CMakeTestOBJCCompiler.cmake
index 0030683..bcc6fae 100644
--- a/Modules/CMakeTestOBJCCompiler.cmake
+++ b/Modules/CMakeTestOBJCCompiler.cmake
@@ -27,7 +27,7 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_OBJC_COMPILER_WORKS)
-  PrintTestCompilerStatus("OBJC" "")
+  PrintTestCompilerStatus("OBJC")
   __TestCompiler_setTryCompileTargetType()
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCCompiler.m
     "#ifdef __cplusplus\n"
@@ -49,7 +49,7 @@
 endif()
 
 if(NOT CMAKE_OBJC_COMPILER_WORKS)
-  PrintTestCompilerStatus("OBJC" " -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the Objective-C compiler works failed with "
     "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n")
@@ -60,7 +60,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(OBJC_TEST_WAS_RUN)
-    PrintTestCompilerStatus("OBJC" " -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the Objective-C compiler works passed with "
       "the following output:\n${__CMAKE_OBJC_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CMakeTestOBJCXXCompiler.cmake b/Modules/CMakeTestOBJCXXCompiler.cmake
index bcce2f1..83227d5 100644
--- a/Modules/CMakeTestOBJCXXCompiler.cmake
+++ b/Modules/CMakeTestOBJCXXCompiler.cmake
@@ -27,7 +27,7 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
-  PrintTestCompilerStatus("OBJCXX" "")
+  PrintTestCompilerStatus("OBJCXX")
   __TestCompiler_setTryCompileTargetType()
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testOBJCXXCompiler.mm
     "#ifndef __cplusplus\n"
@@ -48,7 +48,7 @@
 endif()
 
 if(NOT CMAKE_OBJCXX_COMPILER_WORKS)
-  PrintTestCompilerStatus("OBJCXX" " -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the Objective-C++ compiler works failed with "
     "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n")
@@ -59,7 +59,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(OBJCXX_TEST_WAS_RUN)
-    PrintTestCompilerStatus("OBJCXX" " -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the Objective-C++ compiler works passed with "
       "the following output:\n${__CMAKE_OBJCXX_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CMakeTestSwiftCompiler.cmake b/Modules/CMakeTestSwiftCompiler.cmake
index 841aee6..3e4ff95 100644
--- a/Modules/CMakeTestSwiftCompiler.cmake
+++ b/Modules/CMakeTestSwiftCompiler.cmake
@@ -20,7 +20,7 @@
 # is set and cmake stops processing commands and will not generate
 # any makefiles or projects.
 if(NOT CMAKE_Swift_COMPILER_WORKS)
-  PrintTestCompilerStatus("Swift" "")
+  PrintTestCompilerStatus("Swift")
   file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/main.swift
     "print(\"CMake\")\n")
   try_compile(CMAKE_Swift_COMPILER_WORKS ${CMAKE_BINARY_DIR}
@@ -33,7 +33,7 @@
 endif()
 
 if(NOT CMAKE_Swift_COMPILER_WORKS)
-  PrintTestCompilerStatus("Swift" " -- broken")
+  PrintTestCompilerResult(CHECK_FAIL "broken")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the Swift compiler works failed with "
     "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n")
@@ -44,7 +44,7 @@
     "CMake will not be able to correctly generate this project.")
 else()
   if(Swift_TEST_WAS_RUN)
-    PrintTestCompilerStatus("Swift" " -- works")
+    PrintTestCompilerResult(CHECK_PASS "works")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the Swift compiler works passed with "
       "the following output:\n${__CMAKE_Swift_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 8a6a712..cbb5323 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -681,6 +681,8 @@
 # value of CPACK_NSIS_PACKAGE_NAME  instead
 # of CPACK_PACKAGE_INSTALL_DIRECTORY
 _cpack_set_default(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+# Specify the name of the Uninstall file in NSIS
+_cpack_set_default(CPACK_NSIS_UNINSTALL_NAME "Uninstall")
 
 if(CPACK_NSIS_DISPLAY_NAME_SET)
   _cpack_set_default(CPACK_NSIS_PACKAGE_NAME "${CPACK_NSIS_DISPLAY_NAME}")
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index a3e2da3..6d65313 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -36,28 +36,23 @@
 include(CheckCSourceCompiles)
 include(CMakeCheckCompilerFlagCommonPatterns)
 
-macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
-  set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-  set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+function(check_c_compiler_flag _flag _var)
+  set(CMAKE_REQUIRED_DEFINITIONS "${_flag}")
 
-   # Normalize locale during test compilation.
-  set(_CheckCCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
-  foreach(v ${_CheckCCompilerFlag_LOCALE_VARS})
-    set(_CheckCCompilerFlag_SAVED_${v} "$ENV{${v}}")
+  # Normalize locale during test compilation.
+  set(_locale_vars LC_ALL LC_MESSAGES LANG)
+  foreach(v IN LISTS _locale_vars)
+    set(_locale_vars_saved_${v} "$ENV{${v}}")
     set(ENV{${v}} C)
   endforeach()
-  CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCCompilerFlag_COMMON_PATTERNS)
-  CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
+  check_compiler_flag_common_patterns(_common_patterns)
+  check_c_source_compiles("int main(void) { return 0; }" ${_var}
     # Some compilers do not fail with a bad flag
     FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
-    ${_CheckCCompilerFlag_COMMON_PATTERNS}
+    ${_common_patterns}
     )
-  foreach(v ${_CheckCCompilerFlag_LOCALE_VARS})
-    set(ENV{${v}} ${_CheckCCompilerFlag_SAVED_${v}})
-    unset(_CheckCCompilerFlag_SAVED_${v})
+  foreach(v IN LISTS _locale_vars)
+    set(ENV{${v}} ${_locale_vars_saved_${v}})
   endforeach()
-  unset(_CheckCCompilerFlag_LOCALE_VARS)
-  unset(_CheckCCompilerFlag_COMMON_PATTERNS)
-
-  set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-endmacro ()
+  set(${_var} "${${_var}}" PARENT_SCOPE)
+endfunction()
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 77ba0cc..67fc993 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -104,7 +104,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
@@ -125,7 +125,7 @@
     if(${VAR})
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -133,7 +133,7 @@
         "Source file was:\n${SOURCE}\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index eba70f2..7d116db 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -92,7 +92,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
@@ -113,7 +113,7 @@
     if("${${VAR}_EXITCODE}" EQUAL 0)
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C SOURCE FILE Test ${VAR} succeeded with the following compile output:\n"
@@ -130,7 +130,7 @@
       endif()
 
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C SOURCE FILE Test ${VAR} failed with the following compile output:\n"
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 5729843..5e07c25 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -36,28 +36,23 @@
 include(CheckCXXSourceCompiles)
 include(CMakeCheckCompilerFlagCommonPatterns)
 
-macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
-  set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-  set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+function(check_cxx_compiler_flag _flag _var)
+  set(CMAKE_REQUIRED_DEFINITIONS "${_flag}")
 
   # Normalize locale during test compilation.
-  set(_CheckCXXCompilerFlag_LOCALE_VARS LC_ALL LC_MESSAGES LANG)
-  foreach(v ${_CheckCXXCompilerFlag_LOCALE_VARS})
-    set(_CheckCXXCompilerFlag_SAVED_${v} "$ENV{${v}}")
+  set(_locale_vars LC_ALL LC_MESSAGES LANG)
+  foreach(v IN LISTS _locale_vars)
+    set(_locale_vars_saved_${v} "$ENV{${v}}")
     set(ENV{${v}} C)
   endforeach()
-  CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCXXCompilerFlag_COMMON_PATTERNS)
-  CHECK_CXX_SOURCE_COMPILES("int main() { return 0; }" ${_RESULT}
+  check_compiler_flag_common_patterns(_common_patterns)
+  check_cxx_source_compiles("int main() { return 0; }" ${_var}
     # Some compilers do not fail with a bad flag
     FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
-    ${_CheckCXXCompilerFlag_COMMON_PATTERNS}
+    ${_common_patterns}
     )
-  foreach(v ${_CheckCXXCompilerFlag_LOCALE_VARS})
-    set(ENV{${v}} ${_CheckCXXCompilerFlag_SAVED_${v}})
-    unset(_CheckCXXCompilerFlag_SAVED_${v})
+  foreach(v IN LISTS _locale_vars)
+    set(ENV{${v}} ${_locale_vars_saved_${v}})
   endforeach()
-  unset(_CheckCXXCompilerFlag_LOCALE_VARS)
-  unset(_CheckCXXCompilerFlag_COMMON_PATTERNS)
-
-  set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-endmacro ()
+  set(${_var} "${${_var}}" PARENT_SCOPE)
+endfunction()
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index cc457a5..c693d32 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -105,7 +105,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
@@ -126,7 +126,7 @@
     if(${VAR})
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -134,7 +134,7 @@
         "Source file was:\n${SOURCE}\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 5e3f195..408e183 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -92,7 +92,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
@@ -114,7 +114,7 @@
     if("${${VAR}_EXITCODE}" EQUAL 0)
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -131,7 +131,7 @@
       endif()
 
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index 7ca205a..d06203f 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -38,7 +38,7 @@
 
 macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
   if(NOT DEFINED ${VARIABLE})
-    message(STATUS "Looking for Fortran ${FUNCTION}")
+    message(CHECK_START "Looking for Fortran ${FUNCTION}")
     if(CMAKE_REQUIRED_LINK_OPTIONS)
       set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS
         LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
@@ -61,21 +61,20 @@
     "
     )
     try_compile(${VARIABLE}
-    ${CMAKE_BINARY_DIR}
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
-    ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
-    ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
-    OUTPUT_VARIABLE OUTPUT
+      ${CMAKE_BINARY_DIR}
+      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
+      ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
+      ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
+      OUTPUT_VARIABLE OUTPUT
     )
-#    message(STATUS "${OUTPUT}")
     if(${VARIABLE})
       set(${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}")
-      message(STATUS "Looking for Fortran ${FUNCTION} - found")
+      message(CHECK_PASS "found")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     else()
-      message(STATUS "Looking for Fortran ${FUNCTION} - not found")
+      message(CHECK_FAIL "not found")
       set(${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index f94b254..f0fde8d 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -127,7 +127,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
@@ -148,7 +148,7 @@
     if(${VAR})
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -156,7 +156,7 @@
         "Source file was:\n${SOURCE}\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index a80c13d..a3e5d5d 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -122,7 +122,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
@@ -144,7 +144,7 @@
     if("${${VAR}_EXITCODE}" EQUAL 0)
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -161,7 +161,7 @@
       endif()
 
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index c39144f..136da89 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -57,7 +57,7 @@
     set(MACRO_CHECK_FUNCTION_DEFINITIONS
       "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Looking for ${FUNCTION}")
+      message(CHECK_START "Looking for ${FUNCTION}")
     endif()
     if(CMAKE_REQUIRED_LINK_OPTIONS)
       set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS
@@ -101,14 +101,14 @@
     if(${VARIABLE})
       set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${FUNCTION} - found")
+        message(CHECK_PASS "found")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the function ${FUNCTION} exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${FUNCTION} - not found")
+        message(CHECK_FAIL "not found")
       endif()
       set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index d7b9481..3a10473 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -55,7 +55,7 @@
     configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c)
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Looking for ${INCLUDE}")
+      message(CHECK_START "Looking for ${INCLUDE}")
     endif()
     if(${ARGC} EQUAL 3)
       set(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
@@ -109,7 +109,7 @@
 
     if(${VARIABLE})
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${INCLUDE} - found")
+        message(CHECK_PASS "found")
       endif()
       set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -118,7 +118,7 @@
         "${OUTPUT}\n\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${INCLUDE} - not found")
+        message(CHECK_FAIL "not found")
       endif()
       set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index de5a83b..496550f 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -54,7 +54,7 @@
     configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Looking for C++ include ${INCLUDE}")
+      message(CHECK_START "Looking for C++ include ${INCLUDE}")
     endif()
     if(${ARGC} EQUAL 3)
       set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
@@ -108,7 +108,7 @@
 
     if(${VARIABLE})
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for C++ include ${INCLUDE} - found")
+        message(CHECK_PASS "found")
       endif()
       set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -117,7 +117,7 @@
         "${OUTPUT}\n\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for C++ include ${INCLUDE} - not found")
+        message(CHECK_FAIL "not found")
       endif()
       set(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index f52ab55..8e10cd6 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -131,7 +131,7 @@
     endif()
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Looking for ${_description}")
+      message(CHECK_START "Looking for ${_description}")
     endif()
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
@@ -147,7 +147,7 @@
     unset(_CIF_LINK_LIBRARIES)
     if(${VARIABLE})
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${_description} - found")
+        message(CHECK_PASS "found")
       endif()
       set(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -156,7 +156,7 @@
         "${OUTPUT}\n\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${_description} - not found")
+        message(CHECK_FAIL "not found")
       endif()
       set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake
index a1a3a7a..a337926 100644
--- a/Modules/CheckLanguage.cmake
+++ b/Modules/CheckLanguage.cmake
@@ -39,7 +39,7 @@
 macro(check_language lang)
   if(NOT DEFINED CMAKE_${lang}_COMPILER)
     set(_desc "Looking for a ${lang} compiler")
-    message(STATUS ${_desc})
+    message(CHECK_START "${_desc}")
     file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang})
 
     set(extra_compiler_variables)
@@ -78,13 +78,15 @@
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "${_desc} passed with the following output:\n"
         "${output}\n")
+      set(_CHECK_COMPILER_STATUS CHECK_PASS)
     else()
       set(CMAKE_${lang}_COMPILER NOTFOUND)
+      set(_CHECK_COMPILER_STATUS CHECK_FAIL)
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "${_desc} failed with the following output:\n"
         "${output}\n")
     endif()
-    message(STATUS "${_desc} - ${CMAKE_${lang}_COMPILER}")
+    message(${_CHECK_COMPILER_STATUS} "${CMAKE_${lang}_COMPILER}")
     set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE FILEPATH "${lang} compiler")
     mark_as_advanced(CMAKE_${lang}_COMPILER)
 
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 6504df5..6470dfd 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -42,7 +42,7 @@
     set(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
       "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
+      message(CHECK_START "Looking for ${FUNCTION} in ${LIBRARY}")
     endif()
     set(CHECK_LIBRARY_EXISTS_LINK_OPTIONS)
     if(CMAKE_REQUIRED_LINK_OPTIONS)
@@ -78,7 +78,7 @@
 
     if(${VARIABLE})
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - found")
+        message(CHECK_PASS "found")
       endif()
       set(${VARIABLE} 1 CACHE INTERNAL "Have library ${LIBRARY}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -87,7 +87,7 @@
         "${OUTPUT}\n\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${FUNCTION} in ${LIBRARY} - not found")
+        message(CHECK_FAIL "not found")
       endif()
       set(${VARIABLE} "" CACHE INTERNAL "Have library ${LIBRARY}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake
index a4676ad..601f1fa 100644
--- a/Modules/CheckOBJCSourceCompiles.cmake
+++ b/Modules/CheckOBJCSourceCompiles.cmake
@@ -104,7 +104,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
@@ -125,7 +125,7 @@
     if(${VAR})
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Objective-C SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -133,7 +133,7 @@
         "Source file was:\n${SOURCE}\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake
index 00a1ebd..6684693 100644
--- a/Modules/CheckOBJCSourceRuns.cmake
+++ b/Modules/CheckOBJCSourceRuns.cmake
@@ -92,7 +92,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
@@ -113,7 +113,7 @@
     if("${${VAR}_EXITCODE}" EQUAL 0)
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Objective-C SOURCE FILE Test ${VAR} succeeded with the following compile output:\n"
@@ -130,7 +130,7 @@
       endif()
 
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing Objective-C SOURCE FILE Test ${VAR} failed with the following compile output:\n"
diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake
index 4c0fdd0..2ee79f4 100644
--- a/Modules/CheckOBJCXXSourceCompiles.cmake
+++ b/Modules/CheckOBJCXXSourceCompiles.cmake
@@ -105,7 +105,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
@@ -126,7 +126,7 @@
     if(${VAR})
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Objective-C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -134,7 +134,7 @@
         "Source file was:\n${SOURCE}\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake
index a3d5923..7f7e04f 100644
--- a/Modules/CheckOBJCXXSourceRuns.cmake
+++ b/Modules/CheckOBJCXXSourceRuns.cmake
@@ -92,7 +92,7 @@
       "${SOURCE}\n")
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Performing Test ${VAR}")
+      message(CHECK_START "Performing Test ${VAR}")
     endif()
     try_run(${VAR}_EXITCODE ${VAR}_COMPILED
       ${CMAKE_BINARY_DIR}
@@ -114,7 +114,7 @@
     if("${${VAR}_EXITCODE}" EQUAL 0)
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Success")
+        message(CHECK_PASS "Success")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Objective-C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
@@ -131,7 +131,7 @@
       endif()
 
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Performing Test ${VAR} - Failed")
+        message(CHECK_FAIL "Failed")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing Objective-C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index a7b020c..8b06403 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -54,6 +54,9 @@
 function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
 
   if (NOT DEFINED ${_VARIABLE})
+    if(NOT CMAKE_REQUIRED_QUIET)
+      message(CHECK_START "Checking prototype ${_FUNCTION} for ${_VARIABLE}")
+    endif()
     set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
 
     set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
@@ -103,14 +106,14 @@
     if (${_VARIABLE})
       set(${_VARIABLE} 1 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - True")
+        message(CHECK_PASS "True")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the prototype ${_FUNCTION} exists for ${_VARIABLE} passed with the following output:\n"
         "${OUTPUT}\n\n")
     else ()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Checking prototype ${_FUNCTION} for ${_VARIABLE} - False")
+        message(CHECK_FAIL "False")
       endif()
       set(${_VARIABLE} 0 CACHE INTERNAL "Have correct prototype for ${_FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 1053383..4f202c4 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -126,7 +126,7 @@
       "${SOURCEFILE}" @ONLY)
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Looking for ${SYMBOL}")
+      message(CHECK_START "Looking for ${SYMBOL}")
     endif()
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
@@ -140,7 +140,7 @@
       OUTPUT_VARIABLE OUTPUT)
     if(${VARIABLE})
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${SYMBOL} - found")
+        message(CHECK_PASS "found")
       endif()
       set(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
@@ -150,7 +150,7 @@
         "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${SYMBOL} - not found")
+        message(CHECK_FAIL "not found")
       endif()
       set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 3727373..2b07b7c 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -86,7 +86,7 @@
 # Helper function.  DO NOT CALL DIRECTLY.
 function(__check_type_size_impl type var map builtin language)
   if(NOT CMAKE_REQUIRED_QUIET)
-    message(STATUS "Check size of ${type}")
+    message(CHECK_START "Check size of ${type}")
   endif()
 
   # Include header files.
@@ -173,7 +173,7 @@
     endif()
 
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Check size of ${type} - done")
+      message(CHECK_PASS "done")
     endif()
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining size of ${type} passed with the following output:\n${output}\n\n")
@@ -181,7 +181,7 @@
   else()
     # The check failed to compile.
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Check size of ${type} - failed")
+      message(CHECK_FAIL "failed")
     endif()
     file(READ ${src} content)
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index f4953a3..8a93535 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -42,7 +42,7 @@
     set(MACRO_CHECK_VARIABLE_DEFINITIONS
       "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Looking for ${VAR}")
+      message(CHECK_START "Looking for ${VAR}")
     endif()
     if(CMAKE_REQUIRED_LINK_OPTIONS)
       set(CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS
@@ -67,7 +67,7 @@
     if(${VARIABLE})
       set(${VARIABLE} 1 CACHE INTERNAL "Have variable ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${VAR} - found")
+        message(CHECK_PASS "found")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the variable ${VAR} exists passed with the following output:\n"
@@ -75,7 +75,7 @@
     else()
       set(${VARIABLE} "" CACHE INTERNAL "Have variable ${VAR}")
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(STATUS "Looking for ${VAR} - not found")
+        message(CHECK_FAIL "not found")
       endif()
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the variable ${VAR} exists failed with the following output:\n"
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake
index 9973feb..c54ab9d 100644
--- a/Modules/Compiler/NAG-Fortran.cmake
+++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -1,6 +1,6 @@
 # Help CMAKE_PARSE_IMPLICIT_LINK_INFO detect NAG Fortran object files.
 if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED)
-  message(STATUS "Detecting NAG Fortran directory")
+  message(CHECK_START "Detecting NAG Fortran directory")
   # Run with -dryrun to see sample "link" line.
   execute_process(
     COMMAND ${CMAKE_Fortran_COMPILER} dummy.o -dryrun
@@ -20,11 +20,11 @@
       "  directory: ${_nag_dir}\n"
       "  regex: ${CMAKE_Fortran_IMPLICIT_OBJECT_REGEX}\n"
       "from output:\n${_dryrun}\n\n")
-    message(STATUS "Detecting NAG Fortran directory - ${_nag_dir}")
+    message(CHECK_PASS "${_nag_dir}")
   else()
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
       "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n")
-    message(STATUS "Detecting NAG Fortran directory - failed")
+    message(CHECK_FAIL "failed")
   endif()
 endif()
 
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index b59deda..2b24fa5 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -2,6 +2,29 @@
 set(CMAKE_CUDA_VERBOSE_FLAG "-v")
 set(CMAKE_CUDA_VERBOSE_COMPILE_FLAG "-Xcompiler=-v")
 
+if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 10.2)
+  # The -forward-unknown-to-host-compiler flag was only
+  # added to nvcc in 10.2 so before that we had no good
+  # way to invoke the CUDA compiler and propagate unknown
+  # flags such as -pthread to the host compiler
+  set(_CMAKE_CUDA_EXTRA_FLAGS "-forward-unknown-to-host-compiler")
+else()
+  set(_CMAKE_CUDA_EXTRA_FLAGS "")
+endif()
+
+if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
+  set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets")
+else()
+  set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "")
+endif()
+
+if (NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 10.2)
+  # The -MD flag was only added to nvcc in 10.2 so
+  # before that we had to invoke the compiler twice
+  # to get header dependency information
+  set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT <OBJECT> -MF <DEPFILE>")
+endif()
+
 if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
   set(CMAKE_CUDA_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE)
   set(CMAKE_CUDA_COMPILE_OPTIONS_PIC -Xcompiler=-fPIC)
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index c4fb097..1683dff 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -18,3 +18,7 @@
 # xlf: 1501-214 (W) command option E reserved for future use - ignored
 set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
 set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
+
+set(CMAKE_Fortran_PREPROCESS_SOURCE
+  "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -qpreprocess -qnoobject -qsuppress=1517-020 -tF -B \"${CMAKE_CURRENT_LIST_DIR}/XL-Fortran/\" -WF,--cpp,\"${CMAKE_Fortran_XL_CPP}\",--out,<PREPROCESSED_SOURCE> <SOURCE>"
+  )
diff --git a/Modules/Compiler/XL-Fortran/cpp b/Modules/Compiler/XL-Fortran/cpp
new file mode 100755
index 0000000..1fd62c2
--- /dev/null
+++ b/Modules/Compiler/XL-Fortran/cpp
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+# Source file.
+src="$(printf %q "$1")"
+shift
+
+# Output file the compiler expects.
+out="$(printf %q "$1")"
+shift
+
+# Create the file the compiler expects.  It will check syntax.
+>"$out"
+
+cpp='cpp'
+opts=''
+while test "$#" != 0; do
+    case "$1" in
+    # Extract the option for the path to cpp.
+    --cpp) shift; cpp="$(printf %q "$1")" ;;
+    # Extract the option for our own output file.
+    --out) shift; out="$(printf %q "$1")" ;;
+    # Collect the rest of the command line.
+    *) opts="$opts $(printf %q "$1")" ;;
+    esac
+    shift
+done
+
+# Execute the real preprocessor tool.
+eval "exec $cpp $src $out $opts"
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index d742274..b48a332 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -15,6 +15,8 @@
     @id_WindowsTargetPlatformVersion@
     @id_WindowsSDKDesktopARMSupport@
     @id_CudaToolkitCustomDir@
+    @id_ToolsetVCTargetsDir@
+    @id_CustomGlobals@
   </PropertyGroup>
   @id_toolset_version_props@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 66061a1..db3716a 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -265,6 +265,11 @@
         is set to ``NEW`` if this value is set to an empty string then no submodules
         are initialized or updated.
 
+      ``GIT_SUBMODULES_RECURSE <bool>``
+        Specify whether git submodules (if any) should update recursively by
+        passing the ``--recursive`` flag to ``git submodule update``.
+        If not specified, the default is on.
+
       ``GIT_SHALLOW <bool>``
         When this option is enabled, the ``git clone`` operation will be given
         the ``--depth 1`` option. This performs a shallow clone, which avoids
@@ -1065,7 +1070,7 @@
   "ExternalProject module."
   )
 
-function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name init_submodules git_submodules git_shallow git_progress git_config src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
+function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name init_submodules git_submodules_recurse git_submodules git_shallow git_progress git_config src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
   if(NOT GIT_VERSION_STRING VERSION_LESS 1.8.5)
     # Use `git checkout <tree-ish> --` to avoid ambiguity with a local path.
     set(git_checkout_explicit-- "--")
@@ -1115,7 +1120,7 @@
 endif()
 
 execute_process(
-  COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\"
+  COMMAND \${CMAKE_COMMAND} -E rm -rf \"${source_dir}\"
   RESULT_VARIABLE error_code
   )
 if(error_code)
@@ -1153,7 +1158,7 @@
 set(init_submodules ${init_submodules})
 if(init_submodules)
   execute_process(
-    COMMAND \"${git_EXECUTABLE}\" ${git_options} submodule update --recursive --init ${git_submodules}
+    COMMAND \"${git_EXECUTABLE}\" ${git_options} submodule update ${git_submodules_recurse} --init ${git_submodules}
     WORKING_DIRECTORY \"${work_dir}/${src_name}\"
     RESULT_VARIABLE error_code
     )
@@ -1191,7 +1196,7 @@
 endif()
 
 execute_process(
-  COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\"
+  COMMAND \${CMAKE_COMMAND} -E rm -rf \"${source_dir}\"
   RESULT_VARIABLE error_code
   )
 if(error_code)
@@ -1394,7 +1399,7 @@
   set(init_submodules ${init_submodules})
   if(init_submodules)
     execute_process(
-      COMMAND \"${git_EXECUTABLE}\" submodule update --recursive --init ${git_submodules}
+      COMMAND \"${git_EXECUTABLE}\" submodule update ${git_submodules_recurse} --init ${git_submodules}
       WORKING_DIRECTORY \"${work_dir}/${src_name}\"
       RESULT_VARIABLE error_code
       )
@@ -1772,6 +1777,11 @@
   # Replace location tags.
   _ep_replace_location_tags(${target_name} script_initial_cache)
   _ep_replace_location_tags(${target_name} script_filename)
+  # Replace list separators.
+  get_property(sep TARGET ${target_name} PROPERTY _EP_LIST_SEPARATOR)
+  if(sep AND script_initial_cache)
+    string(REPLACE "${sep}" ";" script_initial_cache "${script_initial_cache}")
+  endif()
   # Write out the initial cache file to the location specified.
   file(GENERATE OUTPUT "${script_filename}" CONTENT "${script_initial_cache}")
 endfunction()
@@ -2421,9 +2431,21 @@
       message(FATAL_ERROR "error: could not find git for clone of ${name}")
     endif()
 
+    get_property(git_submodules_recurse_set TARGET ${name} PROPERTY _EP_GIT_SUBMODULES_RECURSE SET)
+    if(NOT git_submodules_recurse_set)
+      set(git_submodules_recurse "--recursive")
+    else()
+      get_property(git_submodules_recurse_value TARGET ${name} PROPERTY _EP_GIT_SUBMODULES_RECURSE)
+      if(git_submodules_recurse_value)
+        set(git_submodules_recurse "--recursive")
+      else()
+        set(git_submodules_recurse "")
+      endif()
+    endif()
+
     # The git submodule update '--recursive' flag requires git >= v1.6.5
     #
-    if(GIT_VERSION_STRING VERSION_LESS 1.6.5)
+    if(git_submodules_recurse AND GIT_VERSION_STRING VERSION_LESS 1.6.5)
       message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': GIT_VERSION_STRING='${GIT_VERSION_STRING}'")
     endif()
 
@@ -2477,7 +2499,7 @@
     # The script will delete the source directory and then call git clone.
     #
     _ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
-      ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} ${git_init_submodules} "${git_submodules}" "${git_shallow}" "${git_progress}" "${git_config}" ${src_name} ${work_dir}
+      ${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} ${git_init_submodules} "${git_submodules_recurse}" "${git_submodules}" "${git_shallow}" "${git_progress}" "${git_config}" ${src_name} ${work_dir}
       ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt "${tls_verify}"
       )
     set(comment "Performing download step (git clone) for '${name}'")
@@ -2563,7 +2585,7 @@
     if(IS_DIRECTORY "${url}")
       get_filename_component(abs_dir "${url}" ABSOLUTE)
       set(comment "Performing download step (DIR copy) for '${name}'")
-      set(cmd   ${CMAKE_COMMAND} -E remove_directory ${source_dir}
+      set(cmd   ${CMAKE_COMMAND} -E rm -rf ${source_dir}
         COMMAND ${CMAKE_COMMAND} -E copy_directory ${abs_dir} ${source_dir})
     else()
       get_property(no_extract TARGET "${name}" PROPERTY _EP_DOWNLOAD_NO_EXTRACT SET)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 77f9d0e..165627e 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -517,7 +517,7 @@
       BLAS
       dgemm
       ""
-      "f77blas;atlas"
+      "blas;f77blas;atlas"
       ""
       )
   endif()
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index b6859aa..ad7fe99 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -676,7 +676,7 @@
 # Search for the cuda distribution.
 if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING)
   # Search in the CUDA_BIN_PATH first.
-  find_path(CUDA_TOOLKIT_ROOT_DIR
+  find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC
     NAMES nvcc nvcc.exe
     PATHS
       ENV CUDA_TOOLKIT_ROOT
@@ -688,19 +688,22 @@
     )
 
   # Now search default paths
-  find_path(CUDA_TOOLKIT_ROOT_DIR
+  find_program(CUDA_TOOLKIT_ROOT_DIR_NVCC
     NAMES nvcc nvcc.exe
     PATHS /opt/cuda/bin
     PATH_SUFFIXES cuda/bin
     DOC "Toolkit location."
     )
 
-  if (CUDA_TOOLKIT_ROOT_DIR)
+  if (CUDA_TOOLKIT_ROOT_DIR_NVCC)
+    get_filename_component(CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY)
+    get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC_PAR}" DIRECTORY CACHE)
     string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR})
     # We need to force this back into the cache.
     set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE)
     set(CUDA_TOOLKIT_TARGET_DIR ${CUDA_TOOLKIT_ROOT_DIR})
   endif()
+  unset(CUDA_TOOLKIT_ROOT_DIR_NVCC CACHE)
 
   if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
     if(CUDA_FIND_REQUIRED)
@@ -921,7 +924,7 @@
 if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
   list(APPEND CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
 elseif(CUDA_USE_STATIC_CUDA_RUNTIME AND CUDA_cudart_static_LIBRARY)
-  list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
+  list(APPEND CUDA_LIBRARIES ${CUDA_cudart_static_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS})
   if (CUDA_rt_LIBRARY)
     list(APPEND CUDA_LIBRARIES ${CUDA_rt_LIBRARY})
   endif()
@@ -2003,7 +2006,7 @@
     string(TOUPPER ${cuda_clean_target_name} cuda_clean_target_name)
   endif()
   add_custom_target(${cuda_clean_target_name}
-    COMMAND ${CMAKE_COMMAND} -E remove ${CUDA_ADDITIONAL_CLEAN_FILES})
+    COMMAND ${CMAKE_COMMAND} -E rm -f ${CUDA_ADDITIONAL_CLEAN_FILES})
 
   # Clear out the variable, so the next time we configure it will be empty.
   # This is useful so that the files won't persist in the list after targets
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index af15d55..ba35433 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -174,7 +174,7 @@
 # Delete the target file
 cuda_execute_process(
   "Removing ${generated_file}"
-  COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}"
+  COMMAND "${CMAKE_COMMAND}" -E rm -f "${generated_file}"
   )
 
 # For CUDA 2.3 and below, -G -M doesn't work, so remove the -G flag
@@ -241,7 +241,7 @@
 # Delete the temporary file
 cuda_execute_process(
   "Removing ${cmake_dependency_file}.tmp and ${NVCC_generated_dependency_file}"
-  COMMAND "${CMAKE_COMMAND}" -E remove "${cmake_dependency_file}.tmp" "${NVCC_generated_dependency_file}"
+  COMMAND "${CMAKE_COMMAND}" -E rm -f "${cmake_dependency_file}.tmp" "${NVCC_generated_dependency_file}"
   )
 
 if(CUDA_result)
@@ -267,7 +267,7 @@
   # Since nvcc can sometimes leave half done files make sure that we delete the output file.
   cuda_execute_process(
     "Removing ${generated_file}"
-    COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}"
+    COMMAND "${CMAKE_COMMAND}" -E rm -f "${generated_file}"
     )
   message(FATAL_ERROR "Error generating file ${generated_file}")
 else()
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index aeebc84..919babc 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -37,8 +37,35 @@
 
 ``CURL_VERSION_STRING``
   The version of ``curl`` found.
+
+CURL CMake
+^^^^^^^^^^
+
+If CURL was built using the CMake buildsystem then it provides its own
+``CURLConfig.cmake`` file for use with the :command:`find_package` command's
+config mode. This module looks for this file and, if found,
+returns its results with no further action.
+
+Set ``CURL_NO_CURL_CMAKE`` to ``ON`` to disable this search.
+
 #]=======================================================================]
 
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+if(NOT CURL_NO_CURL_CMAKE)
+  # do a find package call to specifically look for the CMake version
+  # of curl
+  find_package(CURL QUIET NO_MODULE)
+  mark_as_advanced(CURL_DIR)
+
+  # if we found the CURL cmake package then we are done, and
+  # can print what we found and return.
+  if(CURL_FOUND)
+    find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE)
+    return()
+  endif()
+endif()
+
 find_package(PkgConfig QUIET)
 if(PKG_CONFIG_FOUND)
   pkg_check_modules(PC_CURL QUIET libcurl)
@@ -139,7 +166,6 @@
   endforeach()
 endif()
 
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 find_package_handle_standard_args(CURL
                                   REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
                                   VERSION_VAR CURL_VERSION_STRING
diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake
index d48de08..b2e00df 100644
--- a/Modules/FindDCMTK.cmake
+++ b/Modules/FindDCMTK.cmake
@@ -102,7 +102,7 @@
 # Step1: Attempt to find a version of DCMTK providing a DCMTKConfig.cmake file.
 #
 if(NOT DCMTK_FIND_QUIETLY)
-  message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake")
+  message(CHECK_START "Trying to find DCMTK expecting DCMTKConfig.cmake")
 endif()
 find_package(DCMTK QUIET NO_MODULE)
 if(DCMTK_FOUND
@@ -110,12 +110,12 @@
     AND NOT "x" STREQUAL "x${DCMTK_INCLUDE_DIRS}")
 
   if(NOT DCMTK_FIND_QUIETLY)
-    message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - ok")
+    message(CHECK_PASS "ok")
   endif()
   return()
 else()
   if(NOT DCMTK_FIND_QUIETLY)
-    message(STATUS "Trying to find DCMTK expecting DCMTKConfig.cmake - failed")
+    message(CHECK_FAIL "failed")
   endif()
 endif()
 
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index d22b7ec..90e5f86 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -142,8 +142,6 @@
   #============================================================
   #
   macro(FLEX_TARGET Name Input Output)
-    set(FLEX_TARGET_outputs "${Output}")
-    set(FLEX_EXECUTABLE_opts "")
 
     set(FLEX_TARGET_PARAM_OPTIONS)
     set(FLEX_TARGET_PARAM_ONE_VALUE_KEYWORDS
@@ -165,31 +163,68 @@
     if(NOT "${FLEX_TARGET_ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
       message(SEND_ERROR ${FLEX_TARGET_usage})
     else()
-      if(NOT "${FLEX_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "")
-        set(FLEX_EXECUTABLE_opts "${FLEX_TARGET_ARG_COMPILE_FLAGS}")
-        separate_arguments(FLEX_EXECUTABLE_opts)
+
+      cmake_policy(GET CMP0098 _flex_CMP0098
+          PARENT_SCOPE # undocumented, do not use outside of CMake
+        )
+      set(_flex_INPUT "${Input}")
+      if("x${_flex_CMP0098}x" STREQUAL "xNEWx")
+        set(_flex_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+        if(NOT IS_ABSOLUTE "${_flex_INPUT}")
+          set(_flex_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/${_flex_INPUT}")
+        endif()
+      else()
+        set(_flex_WORKING_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
       endif()
-      if(NOT "${FLEX_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
-        list(APPEND FLEX_TARGET_outputs "${FLEX_TARGET_ARG_DEFINES_FILE}")
-        list(APPEND FLEX_EXECUTABLE_opts --header-file=${FLEX_TARGET_ARG_DEFINES_FILE})
+      unset(_flex_CMP0098)
+
+      set(_flex_OUTPUT "${Output}")
+      if(NOT IS_ABSOLUTE ${_flex_OUTPUT})
+        set(_flex_OUTPUT "${_flex_WORKING_DIR}/${_flex_OUTPUT}")
+      endif()
+      set(_flex_TARGET_OUTPUTS "${_flex_OUTPUT}")
+
+      set(_flex_EXE_OPTS "")
+      if(NOT "${FLEX_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "")
+        set(_flex_EXE_OPTS "${FLEX_TARGET_ARG_COMPILE_FLAGS}")
+        separate_arguments(_flex_EXE_OPTS)
       endif()
 
-      add_custom_command(OUTPUT ${FLEX_TARGET_outputs}
-        COMMAND ${FLEX_EXECUTABLE} ${FLEX_EXECUTABLE_opts} -o${Output} ${Input}
+      set(_flex_OUTPUT_HEADER "")
+      if(NOT "${FLEX_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
+        set(_flex_OUTPUT_HEADER "${FLEX_TARGET_ARG_DEFINES_FILE}")
+        if(IS_ABSOLUTE "${_flex_OUTPUT_HEADER}")
+          set(_flex_OUTPUT_HEADER_ABS "${_flex_OUTPUT_HEADER}")
+        else()
+          set(_flex_OUTPUT_HEADER_ABS "${_flex_WORKING_DIR}/${_flex_OUTPUT_HEADER}")
+        endif()
+        list(APPEND _flex_TARGET_OUTPUTS "${_flex_OUTPUT_HEADER_ABS}")
+        list(APPEND _flex_EXE_OPTS --header-file=${_flex_OUTPUT_HEADER_ABS})
+      endif()
+
+      get_filename_component(_flex_EXE_NAME_WE "${FLEX_EXECUTABLE}" NAME_WE)
+      add_custom_command(OUTPUT ${_flex_TARGET_OUTPUTS}
+        COMMAND ${FLEX_EXECUTABLE} ${_flex_EXE_OPTS} -o${_flex_OUTPUT} ${_flex_INPUT}
         VERBATIM
-        DEPENDS ${Input}
-        COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}"
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+        DEPENDS ${_flex_INPUT}
+        COMMENT "[FLEX][${Name}] Building scanner with ${_flex_EXE_NAME_WE} ${FLEX_VERSION}"
+        WORKING_DIRECTORY ${_flex_WORKING_DIR})
 
       set(FLEX_${Name}_DEFINED TRUE)
-      set(FLEX_${Name}_OUTPUTS ${Output})
-      set(FLEX_${Name}_INPUT ${Input})
-      set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
-      if("${FLEX_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
-        set(FLEX_${Name}_OUTPUT_HEADER "")
-      else()
-        set(FLEX_${Name}_OUTPUT_HEADER ${FLEX_TARGET_ARG_DEFINES_FILE})
-      endif()
+      set(FLEX_${Name}_OUTPUTS ${_flex_TARGET_OUTPUTS})
+      set(FLEX_${Name}_INPUT ${_flex_INPUT})
+      set(FLEX_${Name}_COMPILE_FLAGS ${_flex_EXE_OPTS})
+      set(FLEX_${Name}_OUTPUT_HEADER ${_flex_OUTPUT_HEADER})
+
+      unset(_flex_EXE_NAME_WE)
+      unset(_flex_EXE_OPTS)
+      unset(_flex_INPUT)
+      unset(_flex_OUTPUT)
+      unset(_flex_OUTPUT_HEADER)
+      unset(_flex_OUTPUT_HEADER_ABS)
+      unset(_flex_TARGET_OUTPUTS)
+      unset(_flex_WORKING_DIR)
+
     endif()
   endmacro()
   #============================================================
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index ef27b7d..ce3c8b8 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -16,18 +16,26 @@
   LibArchive_INCLUDE_DIRS - include search path
   LibArchive_LIBRARIES    - libraries to link
   LibArchive_VERSION      - libarchive 3-component version number
+
+The module defines the following ``IMPORTED`` targets:
+
+::
+
+  LibArchive::LibArchive  - target for linking against libarchive
 #]=======================================================================]
 
 find_path(LibArchive_INCLUDE_DIR
   NAMES archive.h
   PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/include"
+  DOC "libarchive include directory"
   )
 
 find_library(LibArchive_LIBRARY
   NAMES archive libarchive
   PATHS
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\LibArchive;InstallPath]/lib"
+  DOC "libarchive library"
   )
 
 mark_as_advanced(LibArchive_INCLUDE_DIR LibArchive_LIBRARY)
@@ -58,4 +66,11 @@
 if(LibArchive_FOUND)
   set(LibArchive_INCLUDE_DIRS ${LibArchive_INCLUDE_DIR})
   set(LibArchive_LIBRARIES    ${LibArchive_LIBRARY})
+
+  if (NOT TARGET LibArchive::LibArchive)
+    add_library(LibArchive::LibArchive UNKNOWN IMPORTED)
+    set_target_properties(LibArchive::LibArchive PROPERTIES
+      IMPORTED_LOCATION "${LibArchive_LIBRARY}"
+      INTERFACE_INCLUDE_DIRECTORIES "${LibArchive_INCLUDE_DIR}")
+  endif ()
 endif()
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index e366619..b8ca71b 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -31,7 +31,7 @@
     set(CHECK_INCLUDE_FILE_VAR "afxwin.h")
     configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx)
-    message(STATUS "Looking for MFC")
+    message(CHECK_START "Looking for MFC")
     # Try both shared and static as the root project may have set the /MT flag
     try_compile(MFC_HAVE_MFC
       ${CMAKE_BINARY_DIR}
@@ -51,13 +51,13 @@
         OUTPUT_VARIABLE OUTPUT)
     endif()
     if(MFC_HAVE_MFC)
-      message(STATUS "Looking for MFC - found")
+      message(CHECK_PASS "found")
       set(MFC_HAVE_MFC 1 CACHE INTERNAL "Have MFC?")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if MFC exists passed with the following output:\n"
         "${OUTPUT}\n\n")
     else()
-      message(STATUS "Looking for MFC - not found")
+      message(CHECK_FAIL "not found")
       set(MFC_HAVE_MFC 0 CACHE INTERNAL "Have MFC?")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if MFC exists failed with the following output:\n"
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 2779032..6b1da4b 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1391,6 +1391,7 @@
     endif()
   else()
     set(_MPI_FIND_${LANG} FALSE)
+    string(APPEND _MPI_FAIL_REASON "MPI component '${LANG}' was requested, but language ${LANG} is not enabled.  ")
   endif()
   if(_MPI_FIND_${LANG})
     if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )
@@ -1688,6 +1689,7 @@
 find_package_handle_standard_args(MPI
     REQUIRED_VARS ${_MPI_REQ_VARS}
     VERSION_VAR ${_MPI_MIN_VERSION}
+    REASON_FAILURE_MESSAGE "${_MPI_FAIL_REASON}"
     HANDLE_COMPONENTS)
 
 #=============================================================================
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 33ceab7..3688ae9 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -131,6 +131,7 @@
   ${_OPENSSL_ROOT_HINTS_AND_PATHS}
   HINTS
     ${_OPENSSL_INCLUDEDIR}
+    ${_OPENSSL_INCLUDE_DIRS}
   PATH_SUFFIXES
     include
 )
@@ -319,6 +320,7 @@
     ${_OPENSSL_ROOT_HINTS_AND_PATHS}
     HINTS
       ${_OPENSSL_LIBDIR}
+      ${_OPENSSL_LIBRARY_DIRS}
     PATH_SUFFIXES
       lib
   )
@@ -330,6 +332,7 @@
     ${_OPENSSL_ROOT_HINTS_AND_PATHS}
     HINTS
       ${_OPENSSL_LIBDIR}
+      ${_OPENSSL_LIBRARY_DIRS}
     PATH_SUFFIXES
       lib
   )
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index bd400c7..f1fe89a 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -94,6 +94,10 @@
       set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
       set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatibility
       set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
+      if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND
+         ("${PNG_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))
+        list(APPEND PNG_LIBRARIES m)
+      endif()
 
       if (CYGWIN)
         if(BUILD_SHARED_LIBS)
@@ -110,6 +114,12 @@
           INTERFACE_COMPILE_DEFINITIONS "${_PNG_COMPILE_DEFINITIONS}"
           INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
           INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
+        if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND
+           ("${PNG_LIBRARY}" MATCHES "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$"))
+          set_property(TARGET PNG::PNG APPEND PROPERTY
+            INTERFACE_LINK_LIBRARIES m)
+        endif()
+
         if(EXISTS "${PNG_LIBRARY}")
           set_target_properties(PNG::PNG PROPERTIES
             IMPORTED_LINK_INTERFACE_LANGUAGES "C"
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 5162a44..f4b6ea1 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -337,7 +337,7 @@
       # remove empty values from the list
       list(REMOVE_ITEM _pkgconfig_path "")
       file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
-      if(UNIX)
+      if(CMAKE_HOST_UNIX)
         string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}")
         string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}")
       endif()
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index b67d563..0d6d2fc 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -409,6 +409,7 @@
 
   if (_PVI_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_EXECUTABLE}")
     # interpreter does not exist anymore
+    set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot find the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
     return()
   endif()
@@ -427,6 +428,7 @@
     endif()
     if (NOT abi IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
       # incompatible ABI
+      set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong ABI for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
       set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
       return()
     endif()
@@ -444,6 +446,11 @@
                      OUTPUT_STRIP_TRAILING_WHITESPACE)
     if (result OR (_PVI_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version))
       # interpreter not usable or has wrong major version
+      if (result)
+        set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
+      else()
+        set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
+      endif()
       set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
       return()
     endif()
@@ -459,6 +466,11 @@
                        OUTPUT_STRIP_TRAILING_WHITESPACE)
       if (result OR NOT version EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
         # interpreter not usable or has wrong major version
+        if (result)
+          set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
+        else()
+          set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong major version for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
+        endif()
         set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
         return()
       endif()
@@ -476,6 +488,11 @@
                      OUTPUT_STRIP_TRAILING_WHITESPACE)
     if (result OR NOT size EQUAL CMAKE_SIZEOF_VOID_P)
       # interpreter not usable or has wrong architecture
+      if (result)
+        set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot use the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
+      else()
+        set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Wrong architecture for the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
+      endif()
       set_property (CACHE _${_PYTHON_PREFIX}_EXECUTABLE PROPERTY VALUE "_${_PYTHON_PREFIX}_EXECUTABLE-NOTFOUND")
       return()
     endif()
@@ -500,6 +517,7 @@
 
   if (_PVC_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_COMPILER}")
     # Compiler does not exist anymore
+    set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot find the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "_${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
     return()
   endif()
@@ -526,6 +544,11 @@
 
   if (result OR (_PVC_EXACT AND NOT version VERSION_EQUAL expected_version) OR (version VERSION_LESS expected_version))
     # Compiler not usable or has wrong version
+    if (result)
+      set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot use the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
+    else()
+      set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Wrong version for the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
+    endif()
     set_property (CACHE _${_PYTHON_PREFIX}_COMPILER PROPERTY VALUE "_${_PYTHON_PREFIX}_COMPILER-NOTFOUND")
   endif()
 endfunction()
@@ -545,6 +568,7 @@
 
   if (_PVL_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
     # library does not exist anymore
+    set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
     if (WIN32)
       set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_DEBUG PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_DEBUG-NOTFOUND")
@@ -558,16 +582,19 @@
 
   if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT lib_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
     # incompatible ABI
+    set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
   else()
     if (expected_version)
       if ((_PVL_EXACT AND NOT lib_VERSION VERSION_EQUAL expected_version) OR (lib_VERSION VERSION_LESS expected_version))
         # library has wrong version
+        set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
         set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
       endif()
     else()
       if (NOT lib_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
         # library has wrong major version
+        set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
         set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
       endif()
     endif()
@@ -596,6 +623,7 @@
 
   if (_PVID_CHECK_EXISTS AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
     # include file does not exist anymore
+    set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
     return()
   endif()
@@ -605,16 +633,19 @@
 
   if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT inc_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
     # incompatible ABI
+    set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong ABI for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
   else()
     if (expected_version)
       if ((_PVID_EXACT AND NOT inc_VERSION VERSION_EQUAL expected_version) OR (inc_VERSION VERSION_LESS expected_version))
         # include dir has wrong version
+        set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
         set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
       endif()
     else()
       if (NOT inc_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
         # include dir has wrong major version
+        set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Wrong major version for the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
         set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
       endif()
     endif()
@@ -836,6 +867,10 @@
 
 unset (_${_PYTHON_PREFIX}_REQUIRED_VARS)
 unset (_${_PYTHON_PREFIX}_CACHED_VARS)
+unset (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE)
+unset (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE)
+unset (_${_PYTHON_PREFIX}_Development_REASON_FAILURE)
+unset (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE)
 
 
 # first step, search for the interpreter
@@ -1161,6 +1196,7 @@
       # Interpreter is not usable
       set (_${_PYTHON_PREFIX}_EXECUTABLE_USABLE FALSE)
       unset (${_PYTHON_PREFIX}_VERSION)
+      set (_${_PYTHON_PREFIX}_Interpreter_REASON_FAILURE "Cannot run the interpreter \"${_${_PYTHON_PREFIX}_EXECUTABLE}\"")
     endif()
   endif()
 
@@ -1416,6 +1452,7 @@
     else()
       # compiler not usable
       set (_${_PYTHON_PREFIX}_COMPILER_USABLE FALSE)
+      set (_${_PYTHON_PREFIX}_Compiler_REASON_FAILURE "Cannot run the compiler \"${_${_PYTHON_PREFIX}_COMPILER}\"")
     endif()
     file (REMOVE_RECURSE "${_${_PYTHON_PREFIX}_VERSION_DIR}")
   endif()
@@ -1914,6 +1951,7 @@
   set (${_PYTHON_PREFIX}_LIBRARY_RELEASE "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}" CACHE FILEPATH "Path to a library." FORCE)
 
   if (_${_PYTHON_PREFIX}_LIBRARY_RELEASE AND NOT EXISTS "${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
+    set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the library \"${_${_PYTHON_PREFIX}_LIBRARY_RELEASE}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_LIBRARY_RELEASE PROPERTY VALUE "_${_PYTHON_PREFIX}_LIBRARY_RELEASE-NOTFOUND")
   endif()
 
@@ -2046,6 +2084,7 @@
   set (${_PYTHON_PREFIX}_INCLUDE_DIRS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
 
   if (_${_PYTHON_PREFIX}_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_INCLUDE_DIR}")
+    set (_${_PYTHON_PREFIX}_Development_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_INCLUDE_DIR}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_INCLUDE_DIR-NOTFOUND")
   endif()
 
@@ -2169,6 +2208,7 @@
   set (${_PYTHON_PREFIX}_NumPy_INCLUDE_DIRS "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
 
   if(_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR AND NOT EXISTS "${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
+    set (_${_PYTHON_PREFIX}_NumPy_REASON_FAILURE "Cannot find the directory \"${_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}\"")
     set_property (CACHE _${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR PROPERTY VALUE "_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR-NOTFOUND")
   endif()
 
@@ -2207,11 +2247,19 @@
   _python_display_failure ("Could NOT find ${_PYTHON_PREFIX}: Found unsuitable major version \"${${_PYTHON_PREFIX}_VERSION_MAJOR}\", but required major version is exact version \"${_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR}\"")
 endif()
 
+unset (_${_PYTHON_PREFIX}_REASON_FAILURE)
+foreach (_${_PYTHON_PREFIX}_COMPONENT IN ITEMS Interpreter Compiler Development NumPy)
+  if (_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE)
+    string (APPEND _${_PYTHON_PREFIX}_REASON_FAILURE "\n        ${_${_PYTHON_PREFIX}_COMPONENT}: ${_${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_REASON_FAILURE}")
+  endif()
+endforeach()
+
 include (${CMAKE_CURRENT_LIST_DIR}/../FindPackageHandleStandardArgs.cmake)
 find_package_handle_standard_args (${_PYTHON_PREFIX}
                                    REQUIRED_VARS ${_${_PYTHON_PREFIX}_REQUIRED_VARS}
                                    VERSION_VAR ${_PYTHON_PREFIX}_VERSION
-                                   HANDLE_COMPONENTS)
+                                   HANDLE_COMPONENTS
+                                   REASON_FAILURE_MESSAGE "${_${_PYTHON_PREFIX}_REASON_FAILURE}")
 
 # Create imported targets and helper functions
 if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index b0c91b2..64576eb 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -90,7 +90,7 @@
   if(NOT Threads_FOUND)
     # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
     if(NOT DEFINED THREADS_HAVE_PTHREAD_ARG)
-      message(STATUS "Check if compiler accepts -pthread")
+      message(CHECK_START "Check if compiler accepts -pthread")
       if(CMAKE_C_COMPILER_LOADED)
         set(_threads_src ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c)
       elseif(CMAKE_CXX_COMPILER_LOADED)
@@ -106,9 +106,9 @@
 
       if(THREADS_HAVE_PTHREAD_ARG)
         set(Threads_FOUND TRUE)
-        message(STATUS "Check if compiler accepts -pthread - yes")
+        message(CHECK_PASS "yes")
       else()
-        message(STATUS "Check if compiler accepts -pthread - no")
+        message(CHECK_FAIL "no")
         file(APPEND
           ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 893a96f..547346b 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -341,7 +341,7 @@
   # Build the verification project if not yet built.
   if(NOT DEFINED FortranCInterface_VERIFIED_${lang})
     set(_desc "Verifying Fortran/${lang} Compiler Compatibility")
-    message(STATUS "${_desc}")
+    message(CHECK_START "${_desc}")
 
     # Build a sample project which reports symbols.
     set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
@@ -363,12 +363,12 @@
 
     # Report results.
     if(FortranCInterface_VERIFY_${lang}_COMPILED)
-      message(STATUS "${_desc} - Success")
+      message(CHECK_PASS "Success")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "${_desc} passed with the following output:\n${_output}\n\n")
       set(FortranCInterface_VERIFIED_${lang} 1 CACHE INTERNAL "Fortran/${lang} compatibility")
     else()
-      message(STATUS "${_desc} - Failed")
+      message(CHECK_FAIL "Failed")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "${_desc} failed with the following output:\n${_output}\n\n")
       set(FortranCInterface_VERIFIED_${lang} 0 CACHE INTERNAL "Fortran/${lang} compatibility")
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index 7789785..33de6c6 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -15,7 +15,7 @@
     OR ${CMAKE_CURRENT_LIST_FILE}
     IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake
     )
-  message(STATUS "Detecting Fortran/C Interface")
+  message(CHECK_START "Detecting Fortran/C Interface")
 else()
   return()
 endif()
@@ -172,7 +172,9 @@
   else()
     set(_result "Found GLOBAL but not MODULE mangling")
   endif()
+  set(_result_type CHECK_PASS)
 elseif(NOT _result)
   set(_result "Failed to recognize symbols")
+  set(_result_type CHECK_FAIL)
 endif()
-message(STATUS "Detecting Fortran/C Interface - ${_result}")
+message(${_result_type} "${_result}")
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 82053b2..1f4bcfd 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -230,31 +230,22 @@
     foreach(_dep IN LISTS _deps)
         _cpack_nuget_debug("  checking dependency `${_dep}`")
 
-        string(MAKE_C_IDENTIFIER "${_dep}" _dep_id)
-
-        _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep_id}_VERSION)
+        _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep}_VERSION)
 
         if(NOT _ver)
-            string(TOUPPER "${_dep_id}" _dep_id)
-            _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep_id}_VERSION)
+            string(TOUPPER "${_dep}" _dep_upper)
+            _cpack_nuget_variable_fallback(_ver DEPENDENCIES_${_dep_upper}_VERSION)
         endif()
 
         if(_ver)
             _cpack_nuget_debug("  got `${_dep}` dependency version ${_ver}")
-            list(APPEND _collected_deps "<dependency id=\"${_dep}\" version=\"${_ver}\" />")
+            string(CONCAT _collected_deps "${_collected_deps}" "            <dependency id=\"${_dep}\" version=\"${_ver}\" />\n")
         endif()
     endforeach()
 
     # Render deps into the variable
     if(_collected_deps)
-        set(_CPACK_NUGET_DEPENDENCIES_TAG "<dependencies>\n")
-        foreach(_line IN LISTS _collected_deps)
-            string(
-                APPEND _CPACK_NUGET_DEPENDENCIES_TAG
-                "            ${_line}\n"
-              )
-        endforeach()
-        string(APPEND _CPACK_NUGET_DEPENDENCIES_TAG "        </dependencies>")
+        string(CONCAT _CPACK_NUGET_DEPENDENCIES_TAG "<dependencies>\n" "${_collected_deps}" "        </dependencies>")
     endif()
 
     # Render the spec file
diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in
index f75ae78..23bb0018 100644
--- a/Modules/Internal/CPack/NSIS.template.in
+++ b/Modules/Internal/CPack/NSIS.template.in
@@ -542,6 +542,8 @@
 
 ;--------------------------------
 ;Pages
+  @CPACK_NSIS_INSTALLER_WELCOME_TITLE_CODE@
+  @CPACK_NSIS_INSTALLER_WELCOME_TITLE_3LINES_CODE@
   !insertmacro MUI_PAGE_WELCOME
 
   !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@"
@@ -557,6 +559,8 @@
   @CPACK_NSIS_PAGE_COMPONENTS@
 
   !insertmacro MUI_PAGE_INSTFILES
+  @CPACK_NSIS_INSTALLER_FINISH_TITLE_CODE@
+  @CPACK_NSIS_INSTALLER_FINISH_TITLE_3LINES_CODE@
   !insertmacro MUI_PAGE_FINISH
 
   !insertmacro MUI_UNPAGE_CONFIRM
@@ -642,7 +646,7 @@
   WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
 
   ;Create uninstaller
-  WriteUninstaller "$INSTDIR\Uninstall.exe"
+  WriteUninstaller "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe"
   Push "DisplayName"
   Push "@CPACK_NSIS_DISPLAY_NAME@"
   Call ConditionalAddToRegisty
@@ -653,7 +657,7 @@
   Push "@CPACK_PACKAGE_VENDOR@"
   Call ConditionalAddToRegisty
   Push "UninstallString"
-  Push "$INSTDIR\Uninstall.exe"
+  Push "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe"
   Call ConditionalAddToRegisty
   Push "NoRepair"
   Push "1"
@@ -690,7 +694,7 @@
   CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
 @CPACK_NSIS_CREATE_ICONS@
 @CPACK_NSIS_CREATE_ICONS_EXTRA@
-  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe"
 
   ;Read a value from an InstallOptions INI file
   !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State"
@@ -829,7 +833,7 @@
 !endif
 
   ;Remove the uninstaller itself.
-  Delete "$INSTDIR\Uninstall.exe"
+  Delete "$INSTDIR\@CPACK_NSIS_UNINSTALL_NAME@.exe"
   DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
 
   ;Remove the installation directory if it is empty.
diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake
index 847178f..759448b 100644
--- a/Modules/Platform/Android-Clang.cmake
+++ b/Modules/Platform/Android-Clang.cmake
@@ -24,6 +24,14 @@
   return()
 endif()
 
+# Natively compiling on an Android host doesn't use the NDK cross-compilation
+# tools.
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+  macro(__android_compiler_clang lang)
+  endmacro()
+  return()
+endif()
+
 include(Platform/Android-Common)
 
 # The NDK toolchain configuration files at:
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index e7c1b48..2225897 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -18,6 +18,12 @@
   return()
 endif()
 
+# Natively compiling on an Android host doesn't use the NDK cross-compilation
+# tools.
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+  return()
+endif()
+
 cmake_policy(PUSH)
 cmake_policy(SET CMP0057 NEW) # if IN_LIST
 
diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake
index a5d2820..b90dd7a 100644
--- a/Modules/Platform/Android-Initialize.cmake
+++ b/Modules/Platform/Android-Initialize.cmake
@@ -24,6 +24,12 @@
   return()
 endif()
 
+# Natively compiling on an Android host doesn't use the NDK cross-compilation
+# tools.
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+  return()
+endif()
+
 if(NOT CMAKE_SYSROOT)
   if(CMAKE_ANDROID_NDK)
     set(CMAKE_SYSROOT "${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}/arch-${CMAKE_ANDROID_ARCH}")
diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake
index f08f841..8ffa1b2 100644
--- a/Modules/Platform/Android.cmake
+++ b/Modules/Platform/Android.cmake
@@ -2,6 +2,11 @@
 
 set(ANDROID 1)
 
+# Natively compiling on an Android host doesn't need these flags to be reset.
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+  return()
+endif()
+
 # Conventionally Android does not use versioned soname
 # But in modern versions it is acceptable
 if(NOT DEFINED CMAKE_PLATFORM_NO_VERSIONED_SONAME)
diff --git a/Modules/Platform/Android/Determine-Compiler.cmake b/Modules/Platform/Android/Determine-Compiler.cmake
index 5c6b97b..f9c2d89 100644
--- a/Modules/Platform/Android/Determine-Compiler.cmake
+++ b/Modules/Platform/Android/Determine-Compiler.cmake
@@ -31,6 +31,16 @@
   set(_ANDROID_HOST_EXT "")
 elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
   set(_ANDROID_HOST_EXT ".exe")
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Android")
+  # Natively compiling on an Android host doesn't use the NDK cross-compilation
+  # tools.
+  macro(__android_determine_compiler lang)
+    # Do nothing
+  endmacro()
+  if(NOT CMAKE_CXX_COMPILER_NAMES)
+    set(CMAKE_CXX_COMPILER_NAMES c++)
+  endif()
+  return()
 else()
   message(FATAL_ERROR "Android: Builds hosted on '${CMAKE_HOST_SYSTEM_NAME}' not supported.")
 endif()
diff --git a/Modules/Platform/Apple-GNU.cmake b/Modules/Platform/Apple-GNU.cmake
index 0eb8168..9572736 100644
--- a/Modules/Platform/Apple-GNU.cmake
+++ b/Modules/Platform/Apple-GNU.cmake
@@ -19,17 +19,17 @@
 macro(cmake_gnu_set_sysroot_flag lang)
   if(NOT DEFINED CMAKE_${lang}_SYSROOT_FLAG)
     set(_doc "${lang} compiler has -isysroot")
-    message(STATUS "Checking whether ${_doc}")
+    message(CHECK_START "Checking whether ${_doc}")
     execute_process(
       COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help"
       OUTPUT_VARIABLE _gcc_help
       ERROR_VARIABLE _gcc_help
       )
     if("${_gcc_help}" MATCHES "isysroot")
-      message(STATUS "Checking whether ${_doc} - yes")
+      message(CHECK_PASS "yes")
       set(CMAKE_${lang}_SYSROOT_FLAG "-isysroot")
     else()
-      message(STATUS "Checking whether ${_doc} - no")
+      message(CHECK_FAIL "no")
       set(CMAKE_${lang}_SYSROOT_FLAG "")
     endif()
     set(CMAKE_${lang}_SYSROOT_FLAG_CODE "set(CMAKE_${lang}_SYSROOT_FLAG \"${CMAKE_${lang}_SYSROOT_FLAG}\")")
@@ -39,17 +39,17 @@
 macro(cmake_gnu_set_osx_deployment_target_flag lang)
   if(NOT DEFINED CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG)
     set(_doc "${lang} compiler supports OSX deployment target flag")
-    message(STATUS "Checking whether ${_doc}")
+    message(CHECK_START "Checking whether ${_doc}")
     execute_process(
       COMMAND ${CMAKE_${lang}_COMPILER} "-v" "--help"
       OUTPUT_VARIABLE _gcc_help
       ERROR_VARIABLE _gcc_help
       )
     if("${_gcc_help}" MATCHES "macosx-version-min")
-      message(STATUS "Checking whether ${_doc} - yes")
+      message(CHECK_PASS "yes")
       set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=")
     else()
-      message(STATUS "Checking whether ${_doc} - no")
+      message(CHECK_FAIL "no")
       set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
     endif()
     set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG_CODE "set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG \"${CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG}\")")
diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake
index aef4abf..c51767e 100644
--- a/Modules/Platform/Generic-SDCC-C.cmake
+++ b/Modules/Platform/Generic-SDCC-C.cmake
@@ -19,14 +19,28 @@
 
 set(CMAKE_C_OUTPUT_EXTENSION ".rel")
 
-# find sdcclib as CMAKE_AR
-# since cmake may already have searched for "ar", sdcclib has to
-# be searched with a different variable name (SDCCLIB_EXECUTABLE)
-# and must then be forced into the cache
+# find sdar/sdcclib as CMAKE_AR
+# since cmake may already have searched for "ar", sdar has to
+# be searched with a different variable name (SDCCAR_EXECUTABLE)
+# and must then be forced into the cache.
+# sdcclib has been deprecated in SDCC 3.2.0 and removed in 3.8.6
+# so we first look for sdar
 get_filename_component(SDCC_LOCATION "${CMAKE_C_COMPILER}" PATH)
-find_program(SDCCLIB_EXECUTABLE sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH)
-find_program(SDCCLIB_EXECUTABLE sdcclib)
-set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
+find_program(SDCCAR_EXECUTABLE sdar NAMES sdcclib PATHS "${SDCC_LOCATION}" NO_DEFAULT_PATH)
+find_program(SDCCAR_EXECUTABLE sdar NAMES sdcclib)
+# for compatibility, in case SDCCLIB_EXECUTABLE is set, we use it
+if(DEFINED SDCCLIB_EXECUTABLE)
+  set(CMAKE_AR "${SDCCLIB_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
+else()
+  set(CMAKE_AR "${SDCCAR_EXECUTABLE}" CACHE FILEPATH "The sdcc librarian" FORCE)
+endif()
+
+
+if("${SDCCAR_EXECUTABLE}" MATCHES "sdcclib")
+  set(CMAKE_AR_OPTIONS "-a")
+else()
+  set(CMAKE_AR_OPTIONS "-rc")
+endif()
 
 # CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT should be set in a CMAKE_SYSTEM_PROCESSOR file
 if(NOT DEFINED CMAKE_C_FLAGS_INIT)
@@ -45,10 +59,10 @@
 # link object files to an executable
 set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
 
-# needs sdcc 2.7.0 + sddclib from cvs
+# needs sdcc + sdar/sdcclib
 set(CMAKE_C_CREATE_STATIC_LIBRARY
       "\"${CMAKE_COMMAND}\" -E remove <TARGET>"
-      "<CMAKE_AR> -a <TARGET> <LINK_FLAGS> <OBJECTS> ")
+      "<CMAKE_AR> ${CMAKE_AR_OPTIONS} <TARGET> <LINK_FLAGS> <OBJECTS> ")
 
 # not supported by sdcc
 set(CMAKE_C_CREATE_SHARED_LIBRARY "")
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 71189b1..cf85367 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -124,7 +124,7 @@
       string(REPLACE "<OBJECTS>" "-Wl,--whole-archive <OBJECT_DIR>/objects.a -Wl,--no-whole-archive"
         CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}")
       set(CMAKE_${lang}_${rule}
-        "<CMAKE_COMMAND> -E remove -f <OBJECT_DIR>/objects.a"
+        "<CMAKE_COMMAND> -E rm -f <OBJECT_DIR>/objects.a"
         "<CMAKE_AR> cr <OBJECT_DIR>/objects.a <OBJECTS>"
         "${CMAKE_${lang}_${rule}}"
         )
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
index 94d77b9..30b5aa9 100644
--- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
@@ -1,11 +1,11 @@
 include(Platform/Windows-MSVC)
 
 set(CMAKE_CUDA_COMPILE_PTX_COMPILATION
-  "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -ptx <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
+  "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -ptx <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
 set(CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
-  "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -dc <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
+  "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -dc <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
 set(CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
-  "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -c <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
+  "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -x cu -c <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
 
 set(__IMPLICT_LINKS )
 foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
@@ -30,11 +30,6 @@
 unset(_CMAKE_VS_LINK_EXE)
 unset(_CMAKE_VS_LINK_EXE)
 
-if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")
-  set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "-Wno-deprecated-gpu-targets")
-else()
-  set(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS "")
-endif()
 
 # Add implicit host link directories that contain device libraries
 # to the device link line.
@@ -51,11 +46,9 @@
 unset(__IMPLICT_DLINK_DIRS)
 
 set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
-  "<CMAKE_CUDA_COMPILER> <LANGUAGE_COMPILE_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICT_DLINK_FLAGS}")
+  "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICT_DLINK_FLAGS}")
 set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
-  "<CMAKE_CUDA_COMPILER> <FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICT_DLINK_FLAGS}")
-
-unset(_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS)
+  "<CMAKE_CUDA_COMPILER>  ${_CMAKE_CUDA_EXTRA_FLAGS} <FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICT_DLINK_FLAGS}")
 unset(__IMPLICT_DLINK_FLAGS)
 
 string(REPLACE "/D" "-D" _PLATFORM_DEFINES_CUDA "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_CXX}")
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index 0c6e188..8a769b7 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -19,8 +19,8 @@
 
 macro(TEST_BIG_ENDIAN VARIABLE)
   if(NOT DEFINED HAVE_${VARIABLE})
-    message(STATUS "Check if the system is big endian")
-    message(STATUS "Searching 16 bit integer")
+    message(CHECK_START "Check if the system is big endian")
+    message(CHECK_START "Searching 16 bit integer")
 
     if(CMAKE_C_COMPILER_LOADED)
       set(_test_language "C")
@@ -32,19 +32,19 @@
 
     CHECK_TYPE_SIZE("unsigned short" CMAKE_SIZEOF_UNSIGNED_SHORT LANGUAGE ${_test_language})
     if(CMAKE_SIZEOF_UNSIGNED_SHORT EQUAL 2)
-      message(STATUS "Using unsigned short")
+      message(CHECK_PASS "Using unsigned short")
       set(CMAKE_16BIT_TYPE "unsigned short")
     else()
       CHECK_TYPE_SIZE("unsigned int"   CMAKE_SIZEOF_UNSIGNED_INT LANGUAGE ${_test_language})
       if(CMAKE_SIZEOF_UNSIGNED_INT)
-        message(STATUS "Using unsigned int")
+        message(CHECK_PASS "Using unsigned int")
         set(CMAKE_16BIT_TYPE "unsigned int")
 
       else()
 
         CHECK_TYPE_SIZE("unsigned long"  CMAKE_SIZEOF_UNSIGNED_LONG LANGUAGE ${_test_language})
         if(CMAKE_SIZEOF_UNSIGNED_LONG)
-          message(STATUS "Using unsigned long")
+          message(CHECK_PASS "Using unsigned long")
           set(CMAKE_16BIT_TYPE "unsigned long")
         else()
           message(FATAL_ERROR "no suitable type found")
@@ -95,15 +95,16 @@
 
         if(CMAKE_TEST_ENDIANESS_STRINGS_LE)
           set(${VARIABLE} 0 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
-          message(STATUS "Check if the system is big endian - little endian")
+          message(CHECK_PASS "little endian")
         endif()
 
         if(CMAKE_TEST_ENDIANESS_STRINGS_BE)
           set(${VARIABLE} 1 CACHE INTERNAL "Result of TEST_BIG_ENDIAN" FORCE)
-          message(STATUS "Check if the system is big endian - big endian")
+          message(CHECK_PASS "big endian")
         endif()
 
         if(NOT CMAKE_TEST_ENDIANESS_STRINGS_BE  AND  NOT CMAKE_TEST_ENDIANESS_STRINGS_LE)
+          message(CHECK_FAIL "TEST_BIG_ENDIAN found no result!")
           message(SEND_ERROR "TEST_BIG_ENDIAN found no result!")
         endif()
 
@@ -111,7 +112,7 @@
           "Determining if the system is big endian passed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
 
       else()
-        message(STATUS "Check if the system is big endian - failed")
+        message(CHECK_FAIL "failed")
         file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
           "Determining if the system is big endian failed with the following output:\n${OUTPUT}\nTestEndianess.c:\n${TEST_ENDIANESS_FILE_CONTENT}\n\n")
         set(${VARIABLE})
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 92a362e..ce505f3 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -23,19 +23,19 @@
 
 macro(CHECK_CXX_ACCEPTS_FLAG FLAGS  VARIABLE)
   if(NOT DEFINED ${VARIABLE})
-    message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS}")
+    message(CHECK_START "Checking to see if CXX compiler accepts flag ${FLAGS}")
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/DummyCXXFile.cxx
       CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${FLAGS}
       OUTPUT_VARIABLE OUTPUT)
     if(${VARIABLE})
-      message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - yes")
+      message(CHECK_PASS "yes")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if the CXX compiler accepts the flag ${FLAGS} passed with "
         "the following output:\n${OUTPUT}\n\n")
     else()
-      message(STATUS "Checking to see if CXX compiler accepts flag ${FLAGS} - no")
+      message(CHECK_FAIL "no")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if the CXX compiler accepts the flag ${FLAGS} failed with "
         "the following output:\n${OUTPUT}\n\n")
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index 272e4ec..0f2dc01 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -16,19 +16,19 @@
 #]=======================================================================]
 
 if(NOT DEFINED CMAKE_ANSI_FOR_SCOPE)
-  message(STATUS "Check for ANSI scope")
+  message(CHECK_START "Check for ANSI scope")
   try_compile(CMAKE_ANSI_FOR_SCOPE  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
     OUTPUT_VARIABLE OUTPUT)
   if (CMAKE_ANSI_FOR_SCOPE)
-    message(STATUS "Check for ANSI scope - found")
+    message(CHECK_PASS "found")
     set (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
       "Does the compiler support ansi for scope.")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler understands ansi for scopes passed with "
       "the following output:\n${OUTPUT}\n\n")
   else ()
-    message(STATUS "Check for ANSI scope - not found")
+    message(CHECK_FAIL "not found")
     set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
       "Does the compiler support ansi for scope.")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index e70df00..545b7ec 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -15,19 +15,19 @@
 #]=======================================================================]
 
 if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM)
-  message(STATUS "Check for sstream")
+  message(CHECK_START "Check for sstream")
   try_compile(CMAKE_HAS_ANSI_STRING_STREAM  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
     OUTPUT_VARIABLE OUTPUT)
   if (CMAKE_HAS_ANSI_STRING_STREAM)
-    message(STATUS "Check for sstream - found")
+    message(CHECK_PASS "found")
     set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
          "Does the compiler support sstream")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has sstream passed with "
       "the following output:\n${OUTPUT}\n\n")
   else ()
-    message(STATUS "Check for sstream - not found")
+    message(CHECK_FAIL "not found")
     set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
        "Does the compiler support sstream")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index 703e631..d101c83 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -15,19 +15,19 @@
 #]=======================================================================]
 
 if(NOT DEFINED CMAKE_STD_NAMESPACE)
-  message(STATUS "Check for STD namespace")
+  message(CHECK_START "Check for STD namespace")
   try_compile(CMAKE_STD_NAMESPACE  ${CMAKE_BINARY_DIR}
     ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx
     OUTPUT_VARIABLE OUTPUT)
   if (CMAKE_STD_NAMESPACE)
-    message(STATUS "Check for STD namespace - found")
+    message(CHECK_PASS "found")
     set (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
          "Does the compiler support std::.")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
       "Determining if the CXX compiler has std namespace passed with "
       "the following output:\n${OUTPUT}\n\n")
   else ()
-    message(STATUS "Check for STD namespace - not found")
+    message(CHECK_FAIL "not found")
     set (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
        "Does the compiler support std::.")
     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 0798488..28f74ea 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -408,6 +408,12 @@
 set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
 set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
 
+if (CMAKE_HOST_WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+    set(_UseJava_PATH_SEP "$<SEMICOLON>")
+else ()
+    set(_UseJava_PATH_SEP ":")
+endif()
+
 function(add_jar _TARGET_NAME)
 
     cmake_parse_arguments(_add_jar
@@ -497,14 +503,8 @@
         ${CMAKE_JAVA_LIBRARY_OUTPUT_PATH}
     )
 
-    if (CMAKE_HOST_WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
-        set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
-    else ()
-        set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
-    endif()
-
     foreach (JAVA_INCLUDE_DIR IN LISTS CMAKE_JAVA_INCLUDE_PATH)
-       string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
+       string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${JAVA_INCLUDE_DIR}")
     endforeach()
 
     set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
@@ -576,7 +576,7 @@
         if (TARGET ${_JAVA_INCLUDE_JAR})
             get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
             if (_JAVA_JAR_PATH)
-                string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
+                string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${_JAVA_JAR_PATH}")
                 list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
                 list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
                 list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH})
@@ -584,7 +584,7 @@
                 message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar")
             endif ()
         else ()
-            string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}")
+            string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${_UseJava_PATH_SEP}${_JAVA_INCLUDE_JAR}")
             list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}")
             list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}")
             list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}")
@@ -1190,55 +1190,40 @@
     set(_javadoc_options -d ${_javadoc_builddir})
 
     if (_javadoc_sourcepath)
-        set(_start TRUE)
-        foreach(_path IN LISTS _javadoc_sourcepath)
-            if (_start)
-                set(_sourcepath ${_path})
-                set(_start FALSE)
-            else ()
-                set(_sourcepath ${_sourcepath}:${_path})
-            endif ()
-        endforeach()
-        set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath})
+        list(JOIN _javadoc_sourcepath "${_UseJava_PATH_SEP}" _javadoc_sourcepath)
+        list(APPEND _javadoc_options -sourcepath "\"${_javadoc_sourcepath}\"")
     endif ()
 
     if (_javadoc_classpath)
-        set(_start TRUE)
-        foreach(_path IN LISTS _javadoc_classpath)
-            if (_start)
-                set(_classpath ${_path})
-                set(_start FALSE)
-            else ()
-                set(_classpath ${_classpath}:${_path})
-            endif ()
-        endforeach()
-        set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}")
+        list(JOIN _javadoc_classpath "${_UseJava_PATH_SEP}" _javadoc_classpath)
+        list(APPEND _javadoc_options -classpath "\"${_javadoc_classpath}\"")
     endif ()
 
     if (_javadoc_doctitle)
-        set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}')
+        list(APPEND _javadoc_options -doctitle '${_javadoc_doctitle}')
     endif ()
 
     if (_javadoc_windowtitle)
-        set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}')
+        list(APPEND _javadoc_options -windowtitle '${_javadoc_windowtitle}')
     endif ()
 
     if (_javadoc_author)
-        set(_javadoc_options ${_javadoc_options} -author)
+        list(APPEND _javadoc_options -author)
     endif ()
 
     if (_javadoc_use)
-        set(_javadoc_options ${_javadoc_options} -use)
+        list(APPEND _javadoc_options -use)
     endif ()
 
     if (_javadoc_version)
-        set(_javadoc_options ${_javadoc_options} -version)
+        list(APPEND _javadoc_options -version)
     endif ()
 
     add_custom_target(${_target}_javadoc ALL
-        COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options}
-                            ${_javadoc_files}
-                            ${_javadoc_packages}
+        COMMAND ${Java_JAVADOC_EXECUTABLE}
+                ${_javadoc_options}
+                ${_javadoc_files}
+                ${_javadoc_packages}
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     )
 
@@ -1274,11 +1259,6 @@
     endif()
 
     set (_output_files)
-    if (WIN32 AND NOT CYGWIN AND CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
-      set(_classpath_sep "$<SEMICOLON>")
-    else ()
-      set(_classpath_sep ":")
-    endif()
 
     # handle javah options
     set (_javah_options)
@@ -1304,7 +1284,7 @@
           message(SEND_ERROR "create_javah: CLASSPATH entry ${_path} does not exist.")
         endif()
       endforeach()
-      string (REPLACE ";" "${_classpath_sep}" _classpath "${_classpath}")
+      string (REPLACE ";" "${_UseJava_PATH_SEP}" _classpath "${_classpath}")
       list (APPEND _javah_options -classpath "${_classpath}")
     endif()
 
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index b1f7b29..ff313d6 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -289,6 +289,8 @@
   cmGeneratorExpression.h
   cmGeneratorTarget.cxx
   cmGeneratorTarget.h
+  cmLinkItemGraphVisitor.cxx
+  cmLinkItemGraphVisitor.h
   cmGetPipes.cxx
   cmGetPipes.h
   cmGlobalCommonGenerator.cxx
@@ -691,6 +693,8 @@
 
   cmDuration.h
   cmDuration.cxx
+
+  bindexplib.cxx
   )
 
 SET_PROPERTY(SOURCE cmProcessOutput.cxx APPEND PROPERTY COMPILE_DEFINITIONS
@@ -713,7 +717,6 @@
   set(SRCS ${SRCS}
     cmCallVisualStudioMacro.cxx
     cmCallVisualStudioMacro.h
-    bindexplib.cxx
     )
 
   if(NOT UNIX)
@@ -1193,6 +1196,11 @@
   endforeach()
 endif()
 
+if(CMake_JOB_POOL_LINK_BIN)
+  set_property(TARGET ${_tools} PROPERTY JOB_POOL_LINK "link-bin")
+  set_property(GLOBAL APPEND PROPERTY JOB_POOLS "link-bin=${CMake_JOB_POOL_LINK_BIN}")
+endif()
+
 # Install tools
 
 foreach(_tool ${_tools})
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 7f74e3b..3f30aea 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 16)
-set(CMake_VERSION_PATCH 0)
+set(CMake_VERSION_PATCH 20191210)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 9bf72df..4702639 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -128,14 +128,13 @@
       this->IsSet("CPACK_NSIS_MUI_UNIICON")) {
     std::string installerIconCode;
     if (this->IsSet("CPACK_NSIS_MUI_ICON")) {
-      installerIconCode += "!define MUI_ICON \"";
-      installerIconCode += this->GetOption("CPACK_NSIS_MUI_ICON");
-      installerIconCode += "\"\n";
+      installerIconCode += cmStrCat(
+        "!define MUI_ICON \"", this->GetOption("CPACK_NSIS_MUI_ICON"), "\"\n");
     }
     if (this->IsSet("CPACK_NSIS_MUI_UNIICON")) {
-      installerIconCode += "!define MUI_UNICON \"";
-      installerIconCode += this->GetOption("CPACK_NSIS_MUI_UNIICON");
-      installerIconCode += "\"\n";
+      installerIconCode +=
+        cmStrCat("!define MUI_UNICON \"",
+                 this->GetOption("CPACK_NSIS_MUI_UNIICON"), "\"\n");
     }
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE",
                             installerIconCode.c_str());
@@ -173,6 +172,32 @@
                             installerRunCode.c_str());
   }
 
+  if (this->IsSet("CPACK_NSIS_WELCOME_TITLE")) {
+    std::string welcomeTitleCode =
+      cmStrCat("!define MUI_WELCOMEPAGE_TITLE \"",
+               this->GetOption("CPACK_NSIS_WELCOME_TITLE"), "\"");
+    this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_WELCOME_TITLE_CODE",
+                            welcomeTitleCode.c_str());
+  }
+
+  if (this->IsSet("CPACK_NSIS_WELCOME_TITLE_3LINES")) {
+    this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_WELCOME_TITLE_3LINES_CODE",
+                            "!define MUI_WELCOMEPAGE_TITLE_3LINES");
+  }
+
+  if (this->IsSet("CPACK_NSIS_FINISH_TITLE")) {
+    std::string finishTitleCode =
+      cmStrCat("!define MUI_FINISHPAGE_TITLE \"",
+               this->GetOption("CPACK_NSIS_FINISH_TITLE"), "\"");
+    this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_FINISH_TITLE_CODE",
+                            finishTitleCode.c_str());
+  }
+
+  if (this->IsSet("CPACK_NSIS_FINISH_TITLE_3LINES")) {
+    this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_FINISH_TITLE_3LINES_CODE",
+                            "!define MUI_FINISHPAGE_TITLE_3LINES");
+  }
+
   // Setup all of the component sections
   if (this->Components.empty()) {
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLATION_TYPES", "");
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index dae5ec9..ac3d64d 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -46,7 +46,66 @@
   return component.ArchiveFile + ".pkg";
 }
 
-void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile)
+void cmCPackPKGGenerator::CreateBackground(const char* themeName,
+                                           const char* metapackageFile,
+                                           cm::string_view genName,
+                                           cmXMLWriter& xout)
+{
+  std::string paramSuffix =
+    (themeName == nullptr) ? "" : cmSystemTools::UpperCase(themeName);
+  std::string opt = (themeName == nullptr)
+    ? cmStrCat("CPACK_", genName, "_BACKGROUND")
+    : cmStrCat("CPACK_", genName, "_BACKGROUND_", paramSuffix);
+  const char* bgFileName = this->GetOption(opt);
+  if (bgFileName == nullptr) {
+    return;
+  }
+
+  std::string bgFilePath = cmStrCat(metapackageFile, "/Contents/", bgFileName);
+
+  if (!cmSystemTools::FileExists(bgFilePath)) {
+    cmCPackLogger(cmCPackLog::LOG_ERROR,
+                  "Background image doesn't exist in the resource directory: "
+                    << bgFileName << std::endl);
+    return;
+  }
+
+  if (themeName == nullptr) {
+    xout.StartElement("background");
+  } else {
+    xout.StartElement(cmStrCat("background-", themeName));
+  }
+
+  xout.Attribute("file", bgFileName);
+
+  const char* param = this->GetOption(cmStrCat(opt, "_ALIGNMENT"));
+  if (param != nullptr) {
+    xout.Attribute("alignment", param);
+  }
+
+  param = this->GetOption(cmStrCat(opt, "_SCALING"));
+  if (param != nullptr) {
+    xout.Attribute("scaling", param);
+  }
+
+  // Apple docs say that you must provide either mime-type or uti
+  // attribute for the background, but I've seen examples that
+  // doesn't have them, so don't make them mandatory.
+  param = this->GetOption(cmStrCat(opt, "_MIME_TYPE"));
+  if (param != nullptr) {
+    xout.Attribute("mime-type", param);
+  }
+
+  param = this->GetOption(cmStrCat(opt, "_UTI"));
+  if (param != nullptr) {
+    xout.Attribute("uti", param);
+  }
+
+  xout.EndElement();
+}
+
+void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile,
+                                                const char* genName)
 {
   std::string distributionTemplate =
     this->FindTemplate("CPack.distribution.dist.in");
@@ -102,6 +161,11 @@
     CreateChoice(PostFlightComponent, xout);
   }
 
+  // default background
+  this->CreateBackground(nullptr, metapackageFile, genName, xout);
+  // Dark Aqua
+  this->CreateBackground("darkAqua", metapackageFile, genName, xout);
+
   this->SetOption("CPACK_PACKAGEMAKER_CHOICES", choiceOut.str().c_str());
 
   // Create the distribution.dist file in the metapackage to turn it
diff --git a/Source/CPack/cmCPackPKGGenerator.h b/Source/CPack/cmCPackPKGGenerator.h
index 69286ff..be730ab 100644
--- a/Source/CPack/cmCPackPKGGenerator.h
+++ b/Source/CPack/cmCPackPKGGenerator.h
@@ -9,6 +9,8 @@
 #include <sstream>
 #include <string>
 
+#include <cm/string_view>
+
 #include "cmCPackComponentGroup.h"
 #include "cmCPackGenerator.h"
 
@@ -57,7 +59,7 @@
   // inter-component dependencies. metapackageFile is the name of the
   // metapackage for the distribution. Only valid for a
   // component-based install.
-  void WriteDistributionFile(const char* metapackageFile);
+  void WriteDistributionFile(const char* metapackageFile, const char* genName);
 
   // Subroutine of WriteDistributionFile that writes out the
   // dependency attributes for inter-component dependencies.
@@ -85,6 +87,10 @@
   /// installer GUI.
   void CreateChoice(const cmCPackComponent& component, cmXMLWriter& xout);
 
+  /// Creates a background in the distribution XML.
+  void CreateBackground(const char* themeName, const char* metapackageFile,
+                        cm::string_view genName, cmXMLWriter& xout);
+
   // The PostFlight component when creating a metapackage
   cmCPackComponent PostFlightComponent;
 };
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index c5ba726..12ea97b 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -279,7 +279,7 @@
   } else {
     // We have built the package in place. Generate the
     // distribution.dist file to describe it for the installer.
-    WriteDistributionFile(packageDirFileName.c_str());
+    WriteDistributionFile(packageDirFileName.c_str(), "PACKAGEMAKER");
   }
 
   std::string tmpFile = cmStrCat(this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index dae268c..a3e55de 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -81,7 +81,7 @@
   }
 
   // combine package(s) into a distribution
-  WriteDistributionFile(packageDirFileName.c_str());
+  WriteDistributionFile(packageDirFileName.c_str(), "PRODUCTBUILD");
   std::ostringstream pkgCmd;
 
   std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 5895652..dc31623 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -115,7 +115,6 @@
   argc = args.argc();
   argv = args.argv();
 
-  cmSystemTools::EnableMSVCDebugHook();
   cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(argv[0]);
   cmCPackLog log;
@@ -314,7 +313,7 @@
     else {
       // get a default value (current working directory)
       cpackProjectDirectory = cmsys::SystemTools::GetCurrentWorkingDirectory();
-      // use default value iff no value has been provided by the config file
+      // use default value if no value has been provided by the config file
       if (!globalMF.IsSet("CPACK_PACKAGE_DIRECTORY")) {
         globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY",
                                cpackProjectDirectory);
@@ -324,6 +323,12 @@
       globalMF.AddDefinition(cd.first, cd.second);
     }
 
+    // Force CPACK_PACKAGE_DIRECTORY as absolute path
+    cpackProjectDirectory = globalMF.GetDefinition("CPACK_PACKAGE_DIRECTORY");
+    cpackProjectDirectory =
+      cmSystemTools::CollapseFullPath(cpackProjectDirectory);
+    globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory);
+
     const char* cpackModulesPath = globalMF.GetDefinition("CPACK_MODULE_PATH");
     if (cpackModulesPath) {
       globalMF.AddDefinition("CMAKE_MODULE_PATH", cpackModulesPath);
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 02d396e..04abf98 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -171,9 +171,9 @@
   this->RunningCount += GetProcessorsUsed(test);
 
   cmCTestRunTest* testRun = new cmCTestRunTest(*this);
-  if (this->CTest->GetRepeatUntilFail()) {
-    testRun->SetRunUntilFailOn();
-    testRun->SetNumberOfRuns(this->CTest->GetTestRepeat());
+  if (this->RepeatMode != cmCTest::Repeat::Never) {
+    testRun->SetRepeatMode(this->RepeatMode);
+    testRun->SetNumberOfRuns(this->RepeatCount);
   }
   testRun->SetIndex(test);
   testRun->SetTestProperties(this->Properties[test]);
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 1db4bfd..4837401 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -14,11 +14,11 @@
 
 #include "cm_uv.h"
 
+#include "cmCTest.h"
 #include "cmCTestResourceAllocator.h"
 #include "cmCTestTestHandler.h"
 #include "cmUVHandlePtr.h"
 
-class cmCTest;
 struct cmCTestBinPackerAllocation;
 class cmCTestResourceSpec;
 class cmCTestRunTest;
@@ -85,6 +85,12 @@
 
   cmCTestTestHandler* GetTestHandler() { return this->TestHandler; }
 
+  void SetRepeatMode(cmCTest::Repeat mode, int count)
+  {
+    this->RepeatMode = mode;
+    this->RepeatCount = count;
+  }
+
   void SetQuiet(bool b) { this->Quiet = b; }
 
   void InitResourceAllocator(const cmCTestResourceSpec& spec)
@@ -179,6 +185,8 @@
   cmCTestTestHandler* TestHandler;
   cmCTest* CTest;
   bool HasCycles;
+  cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never;
+  int RepeatCount = 1;
   bool Quiet;
   bool SerialTestRunning;
 };
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 3091050..cc5de43 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -34,9 +34,6 @@
   this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
   this->TestResult.TestCount = 0;
   this->TestResult.Properties = nullptr;
-  this->NumberOfRunsLeft = 1; // default to 1 run of the test
-  this->RunUntilFail = false; // default to run the test once
-  this->RunAgain = false;     // default to not having to run again
 }
 
 void cmCTestRunTest::CheckOutput(std::string const& line)
@@ -310,7 +307,7 @@
   }
   // If the test does not need to rerun push the current TestResult onto the
   // TestHandler vector
-  if (!this->NeedsToRerun()) {
+  if (!this->NeedsToRepeat()) {
     this->TestHandler->TestResults.push_back(this->TestResult);
   }
   this->TestProcess.reset();
@@ -336,17 +333,21 @@
   return true;
 }
 
-bool cmCTestRunTest::NeedsToRerun()
+bool cmCTestRunTest::NeedsToRepeat()
 {
   this->NumberOfRunsLeft--;
   if (this->NumberOfRunsLeft == 0) {
     return false;
   }
   // if number of runs left is not 0, and we are running until
-  // we find a failed test, then return true so the test can be
+  // we find a failed (or passed) test, then return true so the test can be
   // restarted
-  if (this->RunUntilFail &&
-      this->TestResult.Status == cmCTestTestHandler::COMPLETED) {
+  if ((this->RepeatMode == cmCTest::Repeat::UntilFail &&
+       this->TestResult.Status == cmCTestTestHandler::COMPLETED) ||
+      (this->RepeatMode == cmCTest::Repeat::UntilPass &&
+       this->TestResult.Status != cmCTestTestHandler::COMPLETED) ||
+      (this->RepeatMode == cmCTest::Repeat::AfterTimeout &&
+       this->TestResult.Status == cmCTestTestHandler::TIMEOUT)) {
     this->RunAgain = true;
     return true;
   }
@@ -746,7 +747,12 @@
   // then it will never print out the completed / total, same would
   // got for run until pass.  Trick is when this is called we don't
   // yet know if we are passing or failing.
-  if (this->NumberOfRunsLeft == 1 || this->CTest->GetTestProgressOutput()) {
+  bool const progressOnLast =
+    (this->RepeatMode != cmCTest::Repeat::UntilPass &&
+     this->RepeatMode != cmCTest::Repeat::AfterTimeout);
+  if ((progressOnLast && this->NumberOfRunsLeft == 1) ||
+      (!progressOnLast && this->NumberOfRunsLeft == this->NumberOfRunsTotal) ||
+      this->CTest->GetTestProgressOutput()) {
     outputStream << std::setw(getNumWidth(total)) << completed << "/";
     outputStream << std::setw(getNumWidth(total)) << total << " ";
   }
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index f781c7a..7eeaebd 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -13,13 +13,12 @@
 
 #include <stddef.h>
 
+#include "cmCTest.h"
 #include "cmCTestMultiProcessHandler.h"
 #include "cmCTestTestHandler.h"
 #include "cmDuration.h"
 #include "cmProcess.h"
 
-class cmCTest;
-
 /** \class cmRunTest
  * \brief represents a single test to be run
  *
@@ -30,8 +29,13 @@
 public:
   explicit cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler);
 
-  void SetNumberOfRuns(int n) { this->NumberOfRunsLeft = n; }
-  void SetRunUntilFailOn() { this->RunUntilFail = true; }
+  void SetNumberOfRuns(int n)
+  {
+    this->NumberOfRunsLeft = n;
+    this->NumberOfRunsTotal = n;
+  }
+
+  void SetRepeatMode(cmCTest::Repeat r) { this->RepeatMode = r; }
   void SetTestProperties(cmCTestTestHandler::cmCTestTestProperties* prop)
   {
     this->TestProperties = prop;
@@ -98,7 +102,7 @@
   }
 
 private:
-  bool NeedsToRerun();
+  bool NeedsToRepeat();
   void DartProcessing();
   void ExeNotFound(std::string exe);
   bool ForkProcess(cmDuration testTimeOut, bool explicitTimeout,
@@ -132,9 +136,10 @@
   std::vector<std::map<
     std::string, std::vector<cmCTestMultiProcessHandler::ResourceAllocation>>>
     AllocatedResources;
-  bool RunUntilFail;
-  int NumberOfRunsLeft;
-  bool RunAgain;
+  cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never;
+  int NumberOfRunsLeft = 1;  // default to 1 run of the test
+  int NumberOfRunsTotal = 1; // default to 1 run of the test
+  bool RunAgain = false;     // default to not having to run again
   size_t TotalNumberOfTests;
 };
 
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index 9784214..0f9b695 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -29,6 +29,7 @@
   this->Bind("EXCLUDE_FIXTURE_SETUP"_s, this->ExcludeFixtureSetup);
   this->Bind("EXCLUDE_FIXTURE_CLEANUP"_s, this->ExcludeFixtureCleanup);
   this->Bind("PARALLEL_LEVEL"_s, this->ParallelLevel);
+  this->Bind("REPEAT"_s, this->Repeat);
   this->Bind("SCHEDULE_RANDOM"_s, this->ScheduleRandom);
   this->Bind("STOP_TIME"_s, this->StopTime);
   this->Bind("TEST_LOAD"_s, this->TestLoad);
@@ -85,6 +86,9 @@
   if (!this->ParallelLevel.empty()) {
     handler->SetOption("ParallelLevel", this->ParallelLevel.c_str());
   }
+  if (!this->Repeat.empty()) {
+    handler->SetOption("Repeat", this->Repeat.c_str());
+  }
   if (!this->ScheduleRandom.empty()) {
     handler->SetOption("ScheduleRandom", this->ScheduleRandom.c_str());
   }
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 4019694..2345afb 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -55,6 +55,7 @@
   std::string ExcludeFixtureSetup;
   std::string ExcludeFixtureCleanup;
   std::string ParallelLevel;
+  std::string Repeat;
   std::string ScheduleRandom;
   std::string StopTime;
   std::string TestLoad;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 8e3ac22..37c7154 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -471,6 +471,30 @@
   if (cmIsOn(this->GetOption("ScheduleRandom"))) {
     this->CTest->SetScheduleType("Random");
   }
+  if (const char* repeat = this->GetOption("Repeat")) {
+    cmsys::RegularExpression repeatRegex(
+      "^(UNTIL_FAIL|UNTIL_PASS|AFTER_TIMEOUT):([0-9]+)$");
+    if (repeatRegex.find(repeat)) {
+      std::string const& count = repeatRegex.match(2);
+      unsigned long n = 1;
+      cmStrToULong(count, &n); // regex guarantees success
+      this->RepeatCount = static_cast<int>(n);
+      if (this->RepeatCount > 1) {
+        std::string const& mode = repeatRegex.match(1);
+        if (mode == "UNTIL_FAIL") {
+          this->RepeatMode = cmCTest::Repeat::UntilFail;
+        } else if (mode == "UNTIL_PASS") {
+          this->RepeatMode = cmCTest::Repeat::UntilPass;
+        } else if (mode == "AFTER_TIMEOUT") {
+          this->RepeatMode = cmCTest::Repeat::AfterTimeout;
+        }
+      }
+    } else {
+      cmCTestLog(this->CTest, ERROR_MESSAGE,
+                 "Repeat option invalid value: " << repeat << std::endl);
+      return false;
+    }
+  }
   if (this->GetOption("ParallelLevel")) {
     this->CTest->SetParallelLevel(atoi(this->GetOption("ParallelLevel")));
   }
@@ -1231,6 +1255,12 @@
   parallel->SetCTest(this->CTest);
   parallel->SetParallelLevel(this->CTest->GetParallelLevel());
   parallel->SetTestHandler(this);
+  if (this->RepeatMode != cmCTest::Repeat::Never) {
+    parallel->SetRepeatMode(this->RepeatMode, this->RepeatCount);
+  } else {
+    parallel->SetRepeatMode(this->CTest->GetRepeatMode(),
+                            this->CTest->GetRepeatCount());
+  }
   parallel->SetQuiet(this->Quiet);
   if (this->TestLoad > 0) {
     parallel->SetTestLoad(this->TestLoad);
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index eab75d0..55237f9 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -18,12 +18,12 @@
 
 #include "cmsys/RegularExpression.hxx"
 
+#include "cmCTest.h"
 #include "cmCTestGenericHandler.h"
 #include "cmCTestResourceSpec.h"
 #include "cmDuration.h"
 #include "cmListFileCache.h"
 
-class cmCTest;
 class cmMakefile;
 class cmXMLWriter;
 
@@ -353,6 +353,8 @@
 
   std::ostream* LogFile;
 
+  cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never;
+  int RepeatCount = 1;
   bool RerunFailed;
 };
 
diff --git a/Source/Checks/Curses.cmake b/Source/Checks/Curses.cmake
index 2942b66..d35dd2a 100644
--- a/Source/Checks/Curses.cmake
+++ b/Source/Checks/Curses.cmake
@@ -1,4 +1,7 @@
-message(STATUS "Checking for curses support")
+include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake)
+cm_message_checks_compat(
+  "Checking for curses support" __checkStart __checkPass __checkFail)
+message(${__checkStart})
 
 # Try compiling a simple project using curses.
 # Pass in any cache entries that the user may have set.
@@ -31,11 +34,11 @@
 unset(CMakeCheckCurses_COMPILED CACHE)
 
 if(CMakeCheckCurses_COMPILED)
-  message(STATUS "Checking for curses support - Success")
+  message(${__checkPass} "Success")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
     "Checking for curses support passed with the following output:\n${CMakeCheckCurses_OUTPUT}\n\n")
 else()
-  message(STATUS "Checking for curses support - Failed")
+  message(${__checkFail} "Failed")
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Checking for curses support failed with the following output:\n${CMakeCheckCurses_OUTPUT}\n\n")
 endif()
diff --git a/Source/Checks/cm_c11_thread_local.cmake b/Source/Checks/cm_c11_thread_local.cmake
index 6b8d10b..2263be3 100644
--- a/Source/Checks/cm_c11_thread_local.cmake
+++ b/Source/Checks/cm_c11_thread_local.cmake
@@ -1,7 +1,11 @@
 set(CMake_C11_THREAD_LOCAL_BROKEN 0)
 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_C11_STANDARD_COMPILE_OPTION)
   if(NOT DEFINED CMake_C11_THREAD_LOCAL_WORKS)
-    message(STATUS "Checking if compiler supports C11 _Thread_local")
+    include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake)
+    cm_message_checks_compat(
+      "Checking if compiler supports C11 _Thread_local"
+      __checkStart __checkPass __checkFail)
+    message(${__checkStart})
     try_compile(CMake_C11_THREAD_LOCAL_WORKS
       ${CMAKE_CURRENT_BINARY_DIR}
       ${CMAKE_CURRENT_LIST_DIR}/cm_c11_thread_local.c
@@ -12,14 +16,14 @@
       set_property(CACHE CMake_C11_THREAD_LOCAL_WORKS PROPERTY VALUE 0)
     endif()
     if(CMake_C11_THREAD_LOCAL_WORKS)
-      message(STATUS "Checking if compiler supports C11 _Thread_local - yes")
+      message(${__checkPass} "yes")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if compiler supports C11 _Thread_local passed with the following output:\n"
         "${OUTPUT}\n"
         "\n"
         )
     else()
-      message(STATUS "Checking if compiler supports C11 _Thread_local - no")
+      message(${__checkFail} "no")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if compiler supports C11 _Thread_local failed with the following output:\n"
         "${OUTPUT}\n"
diff --git a/Source/Checks/cm_cxx14_check.cmake b/Source/Checks/cm_cxx14_check.cmake
index 38606b9..e5656bf 100644
--- a/Source/Checks/cm_cxx14_check.cmake
+++ b/Source/Checks/cm_cxx14_check.cmake
@@ -1,10 +1,14 @@
 set(CMake_CXX14_BROKEN 0)
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI")
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI|Intel")
   if(NOT CMAKE_CXX14_STANDARD_COMPILE_OPTION)
     set(CMake_CXX14_WORKS 0)
   endif()
   if(NOT DEFINED CMake_CXX14_WORKS)
-    message(STATUS "Checking if compiler supports needed C++14 constructs")
+    include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake)
+    cm_message_checks_compat(
+      "Checking if compiler supports needed C++14 constructs"
+      __checkStart __checkPass __checkFail)
+    message(${__checkStart})
     try_compile(CMake_CXX14_WORKS
       ${CMAKE_CURRENT_BINARY_DIR}
       ${CMAKE_CURRENT_LIST_DIR}/cm_cxx14_check.cpp
@@ -15,14 +19,14 @@
       set_property(CACHE CMake_CXX14_WORKS PROPERTY VALUE 0)
     endif()
     if(CMake_CXX14_WORKS)
-      message(STATUS "Checking if compiler supports needed C++14 constructs - yes")
+      message(${__checkPass} "yes")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if compiler supports needed C++14 constructs passed with the following output:\n"
         "${OUTPUT}\n"
         "\n"
         )
     else()
-      message(STATUS "Checking if compiler supports needed C++14 constructs - no")
+      message(${__checkFail} "no")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if compiler supports needed C++14 constructs failed with the following output:\n"
         "${OUTPUT}\n"
diff --git a/Source/Checks/cm_cxx17_check.cmake b/Source/Checks/cm_cxx17_check.cmake
index 4da2fd7..dba3eaf 100644
--- a/Source/Checks/cm_cxx17_check.cmake
+++ b/Source/Checks/cm_cxx17_check.cmake
@@ -1,10 +1,14 @@
 set(CMake_CXX17_BROKEN 0)
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI")
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI|Intel")
   if(NOT CMAKE_CXX17_STANDARD_COMPILE_OPTION)
     set(CMake_CXX17_WORKS 0)
   endif()
   if(NOT DEFINED CMake_CXX17_WORKS)
-    message(STATUS "Checking if compiler supports needed C++17 constructs")
+    include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake)
+    cm_message_checks_compat(
+      "Checking if compiler supports needed C++17 constructs"
+      __checkStart __checkPass __checkFail)
+    message(${__checkStart})
     try_compile(CMake_CXX17_WORKS
       ${CMAKE_CURRENT_BINARY_DIR}
       ${CMAKE_CURRENT_LIST_DIR}/cm_cxx17_check.cpp
@@ -15,14 +19,14 @@
       set_property(CACHE CMake_CXX17_WORKS PROPERTY VALUE 0)
     endif()
     if(CMake_CXX17_WORKS)
-      message(STATUS "Checking if compiler supports needed C++17 constructs - yes")
+      message(${__checkPass} "yes")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if compiler supports needed C++17 constructs passed with the following output:\n"
         "${OUTPUT}\n"
         "\n"
         )
     else()
-      message(STATUS "Checking if compiler supports needed C++17 constructs - no")
+      message(${__checkFail} "no")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if compiler supports needed C++17 constructs failed with the following output:\n"
         "${OUTPUT}\n"
diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp
index 29863b1..abbe22c 100644
--- a/Source/Checks/cm_cxx17_check.cpp
+++ b/Source/Checks/cm_cxx17_check.cpp
@@ -8,6 +8,13 @@
 #  include <comdef.h>
 #endif
 
+template <typename T,
+          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
+typename T::pointer get_ptr(T& item)
+{
+  return item.get();
+}
+
 int main()
 {
   int a[] = { 0, 1, 2 };
@@ -20,6 +27,9 @@
 
   std::unique_ptr<int> u(new int(0));
 
+  // Intel compiler do not handle correctly 'decltype' inside 'invoke_result'
+  get_ptr(u);
+
 #ifdef _MSC_VER
   // clang-cl has problems instantiating this constructor in C++17 mode
   //  error: indirection requires pointer operand ('const _GUID' invalid)
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index fb68ed7..3b00dfb 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -1,8 +1,12 @@
+include(${CMAKE_CURRENT_LIST_DIR}/cm_message_checks_compat.cmake)
 
 function(cm_check_cxx_feature name)
   string(TOUPPER ${name} FEATURE)
   if(NOT DEFINED CMake_HAVE_CXX_${FEATURE})
-    message(STATUS "Checking if compiler supports C++ ${name}")
+    cm_message_checks_compat(
+      "Checking if compiler supports C++ ${name}"
+      __checkStart __checkPass __checkFail)
+    message(${__checkStart})
     if(CMAKE_CXX_STANDARD)
       set(maybe_cxx_standard -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD})
     else()
@@ -26,19 +30,21 @@
     string(REGEX REPLACE "[^\n]*warning:[^\n]*sprintf\\(\\) is often misused, please use snprintf[^\n]*" "" check_output "${check_output}")
     # Filter out xcodebuild warnings.
     string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}")
+    # Filter out ld warnings.
+    string(REGEX REPLACE "[^\n]*ld: warning: [^\n]*" "" check_output "${check_output}")
     # If using the feature causes warnings, treat it as broken/unavailable.
     if(check_output MATCHES "(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]")
       set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
     endif()
     if(CMake_HAVE_CXX_${FEATURE})
-      message(STATUS "Checking if compiler supports C++ ${name} - yes")
+      message(${__checkPass} "yes")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Determining if compiler supports C++ ${name} passed with the following output:\n"
         "${OUTPUT}\n"
         "\n"
         )
     else()
-      message(STATUS "Checking if compiler supports C++ ${name} - no")
+      message(${__checkFail} "no")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Determining if compiler supports C++ ${name} failed with the following output:\n"
         "${OUTPUT}\n"
diff --git a/Source/Checks/cm_message_checks_compat.cmake b/Source/Checks/cm_message_checks_compat.cmake
new file mode 100644
index 0000000..024c397
--- /dev/null
+++ b/Source/Checks/cm_message_checks_compat.cmake
@@ -0,0 +1,13 @@
+# Supporting using the CHECK_... message modes if available
+# and fall back to the older behavior if not
+macro(cm_message_checks_compat description startVar passVar failVar)
+  if(CMAKE_VERSION VERSION_GREATER 3.16.2019)
+    set(${startVar} CHECK_START "${description}")
+    set(${passVar}  CHECK_PASS)
+    set(${failVar}  CHECK_FAIL)
+  else()
+    set(${startVar} STATUS "${description}")
+    set(${passVar}  STATUS "${description} - ")
+    set(${failVar}  STATUS "${description} - ")
+  endif()
+endmacro()
diff --git a/Source/CursesDialog/CMakeLists.txt b/Source/CursesDialog/CMakeLists.txt
index 7009717..c24ee76 100644
--- a/Source/CursesDialog/CMakeLists.txt
+++ b/Source/CursesDialog/CMakeLists.txt
@@ -5,6 +5,7 @@
   ccmake.cxx
   cmCursesBoolWidget.cxx
   cmCursesCacheEntryComposite.cxx
+  cmCursesColor.cxx
   cmCursesDummyWidget.cxx
   cmCursesFilePathWidget.cxx
   cmCursesForm.cxx
@@ -17,21 +18,45 @@
   cmCursesWidget.cxx
   )
 target_include_directories(ccmake PRIVATE ${CURSES_INCLUDE_PATH})
+set(CMAKE_REQUIRED_INCLUDES ${CURSES_INCLUDE_PATH})
 target_link_libraries(ccmake CMakeLib)
 if(CMAKE_USE_SYSTEM_FORM)
   find_path(CURSES_FORM_INCLUDE_DIR NAMES form.h HINTS ${CURSES_INCLUDE_PATH} ${CURSES_INCLUDE_PATH}/ncurses)
   if(CURSES_FORM_INCLUDE_DIR)
     target_include_directories(ccmake PRIVATE ${CURSES_FORM_INCLUDE_DIR})
+    list(APPEND CMAKE_REQUIRED_INCLUDES ${CURSES_FORM_INCLUDE_DIR})
   endif()
   target_link_libraries(ccmake
     ${CURSES_FORM_LIBRARY}
     ${CURSES_LIBRARY}
   )
+  set(CMAKE_REQUIRED_LIBRARIES
+    ${CURSES_FORM_LIBRARY}
+    ${CURSES_LIBRARY}
+  )
   if(CURSES_EXTRA_LIBRARY)
     target_link_libraries(ccmake ${CURSES_EXTRA_LIBRARY})
+    list(APPEND CMAKE_REQUIRED_LIBRARIES ${CURSES_EXTRA_LIBRARY})
   endif()
 else()
   target_link_libraries(ccmake cmForm)
+  get_target_property(cmFormIncludeDirs cmForm INTERFACE_INCLUDE_DIRECTORIES)
+  list(APPEND CMAKE_REQUIRED_INCLUDES ${cmFormIncludeDirs})
+  get_target_property(cmFormLibraries cmForm INTERFACE_LINK_LIBRARIES)
+  set(CMAKE_REQUIRED_LIBRARIES ${cmFormLibraries})
+endif()
+
+include(CheckSymbolExists)
+check_symbol_exists(use_default_colors
+  "form.h"
+  HAVE_CURSES_USE_DEFAULT_COLORS)
+if(HAVE_CURSES_USE_DEFAULT_COLORS)
+  set_source_files_properties(cmCursesColor.cxx
+    PROPERTIES COMPILE_DEFINITIONS HAVE_CURSES_USE_DEFAULT_COLORS)
+endif()
+
+if(CMake_JOB_POOL_LINK_BIN)
+  set_property(TARGET ccmake PROPERTY JOB_POOL_LINK "link-bin")
 endif()
 
 CMake_OPTIONAL_COMPONENT(ccmake)
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 9e9dfbd..01fce85 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -9,6 +9,7 @@
 
 #include "cmsys/Encoding.hxx"
 
+#include "cmCursesColor.h"
 #include "cmCursesForm.h"
 #include "cmCursesMainForm.h"
 #include "cmCursesStandardIncludes.h"
@@ -126,6 +127,7 @@
   noecho();             /* Echo off */
   cbreak();             /* nl- or cr not needed */
   keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
+  cmCursesColor::InitColors();
 
   signal(SIGWINCH, onsig);
 
@@ -153,10 +155,28 @@
     return 1;
   }
 
+  /*
+   * The message is stored in a list by the form which will be
+   * joined by '\n' before display.
+   * Removing any trailing '\n' avoid extra empty lines in the final results
+   */
+  auto cleanMessage = [](const std::string& message) -> std::string {
+    auto msg = message;
+    if (!msg.empty() && msg.back() == '\n') {
+      msg.pop_back();
+    }
+    return msg;
+  };
   cmSystemTools::SetMessageCallback(
-    [myform](const std::string& message, const char* title) {
-      myform->AddError(message, title);
+    [&](const std::string& message, const char* title) {
+      myform->AddError(cleanMessage(message), title);
     });
+  cmSystemTools::SetStderrCallback([&](const std::string& message) {
+    myform->AddError(cleanMessage(message), "");
+  });
+  cmSystemTools::SetStdoutCallback([&](const std::string& message) {
+    myform->UpdateProgress(cleanMessage(message), -1);
+  });
 
   cmCursesForm::CurrentForm = myform;
 
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx
index 97b0811..c4dbed8 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.cxx
+++ b/Source/CursesDialog/cmCursesBoolWidget.cxx
@@ -4,6 +4,7 @@
 
 #include <string>
 
+#include "cmCursesColor.h"
 #include "cmCursesWidget.h"
 #include "cmStateTypes.h"
 
@@ -12,8 +13,10 @@
   : cmCursesWidget(width, height, left, top)
 {
   this->Type = cmStateEnums::BOOL;
-  set_field_fore(this->Field, A_NORMAL);
-  set_field_back(this->Field, A_STANDOUT);
+  if (!cmCursesColor::HasColors()) {
+    set_field_fore(this->Field, A_NORMAL);
+    set_field_back(this->Field, A_STANDOUT);
+  }
   field_opts_off(this->Field, O_STATIC);
   this->SetValueAsBool(false);
 }
@@ -42,8 +45,16 @@
 {
   if (value) {
     this->SetValue("ON");
+    if (cmCursesColor::HasColors()) {
+      set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::BoolOn));
+      set_field_back(this->Field, COLOR_PAIR(cmCursesColor::BoolOn));
+    }
   } else {
     this->SetValue("OFF");
+    if (cmCursesColor::HasColors()) {
+      set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::BoolOff));
+      set_field_back(this->Field, COLOR_PAIR(cmCursesColor::BoolOff));
+    }
   }
 }
 
diff --git a/Source/CursesDialog/cmCursesColor.cxx b/Source/CursesDialog/cmCursesColor.cxx
new file mode 100644
index 0000000..641d48c
--- /dev/null
+++ b/Source/CursesDialog/cmCursesColor.cxx
@@ -0,0 +1,29 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#include "cmCursesColor.h"
+
+#include "cmCursesStandardIncludes.h"
+
+bool cmCursesColor::HasColors()
+{
+#ifdef HAVE_CURSES_USE_DEFAULT_COLORS
+  return has_colors();
+#else
+  return false;
+#endif
+}
+
+void cmCursesColor::InitColors()
+{
+#ifdef HAVE_CURSES_USE_DEFAULT_COLORS
+  if (HasColors()) {
+    start_color();
+    use_default_colors();
+    init_pair(cmCursesColor::BoolOff, COLOR_RED, -1);
+    init_pair(cmCursesColor::BoolOn, COLOR_GREEN, -1);
+    init_pair(cmCursesColor::String, COLOR_BLUE, -1);
+    init_pair(cmCursesColor::Path, COLOR_YELLOW, -1);
+    init_pair(cmCursesColor::Options, COLOR_MAGENTA, -1);
+  }
+#endif
+}
diff --git a/Source/CursesDialog/cmCursesColor.h b/Source/CursesDialog/cmCursesColor.h
new file mode 100644
index 0000000..78ca52c
--- /dev/null
+++ b/Source/CursesDialog/cmCursesColor.h
@@ -0,0 +1,24 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cmCursesColor_h
+#define cmCursesColor_h
+
+class cmCursesColor
+{
+public:
+  enum Color
+  {
+    // Default color is pair 0
+    BoolOff = 1,
+    BoolOn,
+    String,
+    Path,
+    Options
+  };
+
+  static bool HasColors();
+
+  static void InitColors();
+};
+
+#endif // cmCursesColor_h
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index e2d8d06..806e663 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -8,6 +8,7 @@
 #include "cmCursesForm.h"
 #include "cmCursesMainForm.h"
 #include "cmCursesStandardIncludes.h"
+#include "cmStringAlgorithms.h"
 #include "cmVersion.h"
 
 inline int ctrl(int z)
@@ -16,14 +17,12 @@
 }
 
 cmCursesLongMessageForm::cmCursesLongMessageForm(
-  std::vector<std::string> const& messages, const char* title)
+  std::vector<std::string> const& messages, const char* title,
+  ScrollBehavior scrollBehavior)
+  : Scrolling(scrollBehavior)
 {
   // Append all messages into on big string
-  for (std::string const& message : messages) {
-    this->Messages += message;
-    // Add one blank line after each message
-    this->Messages += "\n\n";
-  }
+  this->Messages = cmJoin(messages, "\n");
   this->Title = title;
   this->Fields[0] = nullptr;
   this->Fields[1] = nullptr;
@@ -48,7 +47,7 @@
     size = cmCursesMainForm::MAX_WIDTH - 1;
   }
   strncpy(bar, this->Title.c_str(), size);
-  for (size_t i = size - 1; i < cmCursesMainForm::MAX_WIDTH; i++) {
+  for (size_t i = size; i < cmCursesMainForm::MAX_WIDTH; i++) {
     bar[i] = ' ';
   }
   int width;
@@ -89,7 +88,7 @@
     return;
   }
   char firstLine[512];
-  sprintf(firstLine, "Press [e] to exit help");
+  sprintf(firstLine, "Press [e] to exit screen");
 
   char fmt_s[] = "%s";
   curses_move(y - 2, 0);
@@ -112,8 +111,6 @@
 
   const char* msg = this->Messages.c_str();
 
-  curses_clear();
-
   if (this->Fields[0]) {
     free_field(this->Fields[0]);
     this->Fields[0] = nullptr;
@@ -136,10 +133,13 @@
     }
     i++;
   }
-  form_driver(this->Form, REQ_BEG_FIELD);
+  if (this->Scrolling == ScrollBehavior::ScrollDown) {
+    form_driver(this->Form, REQ_END_FIELD);
+  } else {
+    form_driver(this->Form, REQ_BEG_FIELD);
+  }
 
   this->UpdateStatusBar();
-  this->PrintKeys();
   touchwin(stdscr);
   refresh();
 }
@@ -153,6 +153,7 @@
   char debugMessage[128];
 
   for (;;) {
+    this->PrintKeys();
     int key = getch();
 
     sprintf(debugMessage, "Message widget handling input, key: %d", key);
@@ -173,7 +174,6 @@
     }
 
     this->UpdateStatusBar();
-    this->PrintKeys();
     touchwin(stdscr);
     wrefresh(stdscr);
   }
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h
index 42f9c71..88efe62 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.h
+++ b/Source/CursesDialog/cmCursesLongMessageForm.h
@@ -14,8 +14,14 @@
 class cmCursesLongMessageForm : public cmCursesForm
 {
 public:
+  enum class ScrollBehavior
+  {
+    NoScroll,
+    ScrollDown
+  };
+
   cmCursesLongMessageForm(std::vector<std::string> const& messages,
-                          const char* title);
+                          const char* title, ScrollBehavior scrollBehavior);
   ~cmCursesLongMessageForm() override;
 
   cmCursesLongMessageForm(cmCursesLongMessageForm const&) = delete;
@@ -43,6 +49,7 @@
 protected:
   std::string Messages;
   std::string Title;
+  ScrollBehavior Scrolling;
 
   FIELD* Fields[2];
 };
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 6b71e8a..2c92835 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -34,6 +34,7 @@
   : Args(std::move(args))
   , InitialWidth(initWidth)
 {
+  this->HasNonStatusOutputs = false;
   this->NumberOfPages = 0;
   this->AdvancedMode = false;
   this->NumberOfVisibleEntries = 0;
@@ -321,25 +322,25 @@
     } else {
       if (this->OkToGenerate) {
         sprintf(firstLine,
-                "Press [c] to configure       Press [g] to generate and exit");
+                "      [l] Show log output   [c] Configure"
+                "       [g] Generate        ");
       } else {
         sprintf(firstLine,
-                "Press [c] to configure                                     ");
+                "      [l] Show log output   [c] Configure"
+                "                           ");
       }
       {
         const char* toggleKeyInstruction =
-          "Press [t] to toggle advanced mode (Currently %s)";
+          "      [t] Toggle advanced mode (currently %s)";
         sprintf(thirdLine, toggleKeyInstruction,
-                this->AdvancedMode ? "On" : "Off");
+                this->AdvancedMode ? "on" : "off");
       }
       sprintf(secondLine,
-              "Press [h] for help           "
-              "Press [q] to quit without generating");
+              "      [h] Help              [q] Quit without generating");
     }
 
     curses_move(y - 4, 0);
-    char fmt[512] =
-      "Press [enter] to edit option Press [d] to delete an entry";
+    char fmt[512] = "Keys: [enter] Edit an entry [d] Delete an entry";
     if (process) {
       memset(fmt, ' ', 57);
     }
@@ -364,7 +365,7 @@
 
 // Print the key of the current entry and the CMake version
 // on the status bar. Designed for a width of 80 chars.
-void cmCursesMainForm::UpdateStatusBar(const char* message)
+void cmCursesMainForm::UpdateStatusBar(cm::optional<std::string> message)
 {
   int x;
   int y;
@@ -385,119 +386,91 @@
     return;
   }
 
-  // Get the key of the current entry
-  FIELD* cur = current_field(this->Form);
-  int findex = field_index(cur);
-  cmCursesWidget* lbl = nullptr;
-  if (findex >= 0) {
-    lbl = reinterpret_cast<cmCursesWidget*>(
-      field_userptr(this->Fields[findex - 2]));
-  }
-  char help[128] = "";
-  const char* curField = "";
-  if (lbl) {
-    curField = lbl->GetValue();
+  // Find the current label index
+  // Field are grouped by 3, the label should be 2 less than the current index
+  using size_type = decltype(this->Fields)::size_type;
+  size_type currentLabelIndex = field_index(current_field(this->Form)) - 2;
+
+  // Use the status message if any, otherwise join the key and help string
+  std::string bar;
+  if (message) {
+    bar = *message;
+  } else {
+    // Get the key of the current entry
+    cmCursesWidget* labelWidget = reinterpret_cast<cmCursesWidget*>(
+      field_userptr(this->Fields[currentLabelIndex]));
+    std::string labelValue = labelWidget->GetValue();
+    bar = labelValue + ": ";
 
     // Get the help string of the current entry
     // and add it to the help string
-    const char* existingValue =
-      this->CMakeInstance->GetState()->GetCacheEntryValue(curField);
+    auto cmakeState = this->CMakeInstance->GetState();
+    const char* existingValue = cmakeState->GetCacheEntryValue(labelValue);
     if (existingValue) {
-      const char* hs = this->CMakeInstance->GetState()->GetCacheEntryProperty(
-        curField, "HELPSTRING");
-      if (hs) {
-        strncpy(help, hs, 127);
-        help[127] = '\0';
-      } else {
-        help[0] = 0;
-      }
-    } else {
-      sprintf(help, " ");
-    }
-  }
-
-  // Join the key, help string and pad with spaces
-  // (or truncate) as necessary
-  char bar[cmCursesMainForm::MAX_WIDTH];
-  size_t curFieldLen = strlen(curField);
-  size_t helpLen = strlen(help);
-
-  size_t width = std::min<size_t>(x, cmCursesMainForm::MAX_WIDTH);
-
-  if (message) {
-    curField = message;
-    curFieldLen = strlen(message);
-    strncpy(bar, curField, width);
-    if (curFieldLen < width) {
-      memset(bar + curFieldLen, ' ', width - curFieldLen);
-    }
-  } else {
-    strncpy(bar, curField, width);
-    if (curFieldLen < width) {
-      bar[curFieldLen] = ':';
-      bar[curFieldLen + 1] = ' ';
-      strncpy(bar + curFieldLen + 2, help, width - curFieldLen - 2);
-      if (curFieldLen + helpLen + 2 < width) {
-        memset(bar + curFieldLen + helpLen + 2, ' ',
-               width - (curFieldLen + helpLen + 2));
+      auto help = cmakeState->GetCacheEntryProperty(labelValue, "HELPSTRING");
+      if (help) {
+        bar += help;
       }
     }
   }
-
-  bar[width] = '\0';
-
-  // Display CMake version info on the next line
-  // We want to display this on the right
-  char version[cmCursesMainForm::MAX_WIDTH];
-  char vertmp[128];
-  sprintf(vertmp, "CMake Version %s", cmVersion::GetCMakeVersion());
-  size_t sideSpace = (width - strlen(vertmp));
-  memset(version, ' ', sideSpace);
-  sprintf(version + sideSpace, "%s", vertmp);
-  version[width] = '\0';
-
-  // Now print both lines
-  char fmt_s[] = "%s";
+  // Pad with spaces to erase any previous text,
+  // or truncate as necessary to fit the screen
+  bar.resize(x, ' ');
   curses_move(y - 5, 0);
   attron(A_STANDOUT);
-  printw(fmt_s, bar);
+  char fmt_s[] = "%s";
+  printw(fmt_s, bar.c_str());
   attroff(A_STANDOUT);
-  curses_move(y - 4, 0);
-  printw(fmt_s, version);
+
+  // Highlight the current label, reset others
+  // Fields are grouped by 3, the first one being the label
+  // so start at 0 and move up by 3 avoiding the last null entry
+  for (size_type index = 0; index < this->Fields.size() - 1; index += 3) {
+    bool currentLabel = index == currentLabelIndex;
+    set_field_fore(this->Fields[index], currentLabel ? A_STANDOUT : A_NORMAL);
+  }
+
+  // Display CMake version under the status bar
+  // We want to display this on the right
+  std::string version = "CMake Version ";
+  version += cmVersion::GetCMakeVersion();
+  version.resize(std::min<std::string::size_type>(x, version.size()));
+  curses_move(y - 4, x - static_cast<int>(version.size()));
+  printw(fmt_s, version.c_str());
+
   pos_form_cursor(this->Form);
 }
 
 void cmCursesMainForm::UpdateProgress(const std::string& msg, float prog)
 {
-  char tmp[1024];
-  const char* cmsg = tmp;
   if (prog >= 0) {
-    sprintf(tmp, "%s %i%%", msg.c_str(), static_cast<int>(100 * prog));
+    constexpr int progressBarWidth = 40;
+    int progressBarCompleted = static_cast<int>(progressBarWidth * prog);
+    int percentCompleted = static_cast<int>(100 * prog);
+    this->LastProgress = (percentCompleted < 100 ? " " : "");
+    this->LastProgress += (percentCompleted < 10 ? " " : "");
+    this->LastProgress += std::to_string(percentCompleted) + "% [";
+    this->LastProgress.append(progressBarCompleted, '#');
+    this->LastProgress.append(progressBarWidth - progressBarCompleted, ' ');
+    this->LastProgress += "] " + msg + "...";
   } else {
-    cmsg = msg.c_str();
+    this->Outputs.emplace_back(msg);
   }
-  this->UpdateStatusBar(cmsg);
-  this->PrintKeys(1);
-  curses_move(1, 1);
-  touchwin(stdscr);
-  refresh();
+
+  this->DisplayOutputs();
 }
 
 int cmCursesMainForm::Configure(int noconfigure)
 {
-  int xi;
-  int yi;
-  getmaxyx(stdscr, yi, xi);
+  this->ResetOutputs();
 
-  curses_move(1, 1);
-  this->UpdateStatusBar("Configuring, please wait...");
-  this->PrintKeys(1);
-  touchwin(stdscr);
-  refresh();
-  this->CMakeInstance->SetProgressCallback(
-    [this](const std::string& msg, float prog) {
-      this->UpdateProgress(msg, prog);
-    });
+  if (noconfigure == 0) {
+    this->UpdateProgress("Configuring", 0);
+    this->CMakeInstance->SetProgressCallback(
+      [this](const std::string& msg, float prog) {
+        this->UpdateProgress(msg, prog);
+      });
+  }
 
   // always save the current gui values to disk
   this->FillCacheManagerFromUI();
@@ -505,9 +478,6 @@
     this->CMakeInstance->GetHomeOutputDirectory());
   this->LoadCache(nullptr);
 
-  // Get rid of previous errors
-  this->Errors = std::vector<std::string>();
-
   // run the generate process
   this->OkToGenerate = true;
   int retVal;
@@ -524,7 +494,7 @@
 
   keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
 
-  if (retVal != 0 || !this->Errors.empty()) {
+  if (retVal != 0 || this->HasNonStatusOutputs) {
     // see if there was an error
     if (cmSystemTools::GetErrorOccuredFlag()) {
       this->OkToGenerate = false;
@@ -532,11 +502,13 @@
     int xx;
     int yy;
     getmaxyx(stdscr, yy, xx);
-    cmCursesLongMessageForm* msgs =
-      new cmCursesLongMessageForm(this->Errors,
-                                  cmSystemTools::GetErrorOccuredFlag()
-                                    ? "Errors occurred during the last pass."
-                                    : "CMake produced the following output.");
+    const char* title = "Configure produced the following output";
+    if (cmSystemTools::GetErrorOccuredFlag()) {
+      title = "Configure failed with the following output";
+    }
+    cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(
+      this->Outputs, title,
+      cmCursesLongMessageForm::ScrollBehavior::ScrollDown);
     // reset error condition
     cmSystemTools::ResetErrorOccuredFlag();
     CurrentForm = msgs;
@@ -547,11 +519,13 @@
     if (retVal == -2) {
       return retVal;
     }
-    CurrentForm = this;
-    this->Render(1, 1, xx, yy);
   }
 
   this->InitializeUI();
+  CurrentForm = this;
+  int xi;
+  int yi;
+  getmaxyx(stdscr, yi, xi);
   this->Render(1, 1, xi, yi);
 
   return 0;
@@ -559,30 +533,21 @@
 
 int cmCursesMainForm::Generate()
 {
-  int xi;
-  int yi;
-  getmaxyx(stdscr, yi, xi);
+  this->ResetOutputs();
 
-  curses_move(1, 1);
-  this->UpdateStatusBar("Generating, please wait...");
-  this->PrintKeys(1);
-  touchwin(stdscr);
-  refresh();
+  this->UpdateProgress("Generating", 0);
   this->CMakeInstance->SetProgressCallback(
     [this](const std::string& msg, float prog) {
       this->UpdateProgress(msg, prog);
     });
 
-  // Get rid of previous errors
-  this->Errors = std::vector<std::string>();
-
   // run the generate process
   int retVal = this->CMakeInstance->Generate();
 
   this->CMakeInstance->SetProgressCallback(nullptr);
   keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
 
-  if (retVal != 0 || !this->Errors.empty()) {
+  if (retVal != 0 || this->HasNonStatusOutputs) {
     // see if there was an error
     if (cmSystemTools::GetErrorOccuredFlag()) {
       this->OkToGenerate = false;
@@ -592,12 +557,13 @@
     int xx;
     int yy;
     getmaxyx(stdscr, yy, xx);
-    const char* title = "Messages during last pass.";
+    const char* title = "Generate produced the following output";
     if (cmSystemTools::GetErrorOccuredFlag()) {
-      title = "Errors occurred during the last pass.";
+      title = "Generate failed with the following output";
     }
-    cmCursesLongMessageForm* msgs =
-      new cmCursesLongMessageForm(this->Errors, title);
+    cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(
+      this->Outputs, title,
+      cmCursesLongMessageForm::ScrollBehavior::ScrollDown);
     CurrentForm = msgs;
     msgs->Render(1, 1, xx, yy);
     msgs->HandleInput();
@@ -606,11 +572,13 @@
     if (retVal == -2) {
       return retVal;
     }
-    CurrentForm = this;
-    this->Render(1, 1, xx, yy);
   }
 
   this->InitializeUI();
+  CurrentForm = this;
+  int xi;
+  int yi;
+  getmaxyx(stdscr, yi, xi);
   this->Render(1, 1, xi, yi);
 
   return 0;
@@ -619,7 +587,9 @@
 void cmCursesMainForm::AddError(const std::string& message,
                                 const char* /*unused*/)
 {
-  this->Errors.emplace_back(message);
+  this->Outputs.emplace_back(message);
+  this->HasNonStatusOutputs = true;
+  this->DisplayOutputs();
 }
 
 void cmCursesMainForm::RemoveEntry(const char* value)
@@ -704,7 +674,7 @@
     this->PrintKeys();
     if (this->SearchMode) {
       std::string searchstr = "Search: " + this->SearchString;
-      this->UpdateStatusBar(searchstr.c_str());
+      this->UpdateStatusBar(searchstr);
       this->PrintKeys(1);
       curses_move(y - 5, static_cast<unsigned int>(searchstr.size()));
       // curses_move(1,1);
@@ -848,8 +818,9 @@
           this->HelpMessage[1] = "";
         }
 
-        cmCursesLongMessageForm* msgs =
-          new cmCursesLongMessageForm(this->HelpMessage, "Help.");
+        cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(
+          this->HelpMessage, "Help",
+          cmCursesLongMessageForm::ScrollBehavior::NoScroll);
         CurrentForm = msgs;
         msgs->Render(1, 1, x, y);
         msgs->HandleInput();
@@ -861,7 +832,8 @@
       else if (key == 'l') {
         getmaxyx(stdscr, y, x);
         cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(
-          this->Errors, "Errors occurred during the last pass.");
+          this->Outputs, "CMake produced the following output",
+          cmCursesLongMessageForm::ScrollBehavior::NoScroll);
         CurrentForm = msgs;
         msgs->Render(1, 1, x, y);
         msgs->HandleInput();
@@ -1007,15 +979,6 @@
     } else {
       form_driver(this->Form, REQ_NEXT_FIELD);
     }
-    /*
-    char buffer[1024];
-    sprintf(buffer, "Line: %d != %d / %d\n", findex, idx,
-    this->NumberOfVisibleEntries);
-    touchwin(stdscr);
-    refresh();
-    this->UpdateStatusBar( buffer );
-    usleep(100000);
-    */
     cur = current_field(this->Form);
     findex = field_index(cur);
     if (findex == start_index) {
@@ -1024,6 +987,28 @@
   }
 }
 
+void cmCursesMainForm::ResetOutputs()
+{
+  this->LogForm.reset();
+  this->Outputs.clear();
+  this->HasNonStatusOutputs = false;
+  this->LastProgress.clear();
+}
+
+void cmCursesMainForm::DisplayOutputs()
+{
+  int xi;
+  int yi;
+  getmaxyx(stdscr, yi, xi);
+
+  auto newLogForm = new cmCursesLongMessageForm(
+    this->Outputs, this->LastProgress.c_str(),
+    cmCursesLongMessageForm::ScrollBehavior::ScrollDown);
+  CurrentForm = newLogForm;
+  this->LogForm.reset(newLogForm);
+  this->LogForm->Render(1, 1, xi, yi);
+}
+
 const char* cmCursesMainForm::s_ConstHelpMessage =
   "CMake is used to configure and generate build files for software projects. "
   "The basic steps for configuring a project with ccmake are as follows:\n\n"
@@ -1080,7 +1065,7 @@
   " c : process the configuration files with the current options\n"
   " g : generate build files and exit, only available when there are no "
   "new options and no errors have been detected during last configuration.\n"
-  " l : shows last errors\n"
+  " l : shows cmake output\n"
   " d : delete an option\n"
   " t : toggles advanced mode. In normal mode, only the most important "
   "options are shown. In advanced mode, all options are shown. We recommend "
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index b8769b7..b7c204d 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -10,12 +10,15 @@
 #include <string>
 #include <vector>
 
+#include <cm/optional>
+
 #include "cmCursesCacheEntryComposite.h"
 #include "cmCursesForm.h"
 #include "cmCursesStandardIncludes.h"
 #include "cmStateTypes.h"
 
 class cmake;
+class cmCursesLongMessageForm;
 
 /** \class cmCursesMainForm
  * \brief The main page of ccmake
@@ -66,8 +69,8 @@
    * exception is during a resize. The optional argument specifies the
    * string to be displayed in the status bar.
    */
-  void UpdateStatusBar() override { this->UpdateStatusBar(nullptr); }
-  virtual void UpdateStatusBar(const char* message);
+  void UpdateStatusBar() override { this->UpdateStatusBar(cm::nullopt); }
+  void UpdateStatusBar(cm::optional<std::string> message);
 
   /**
    * Display current commands and their keys on the toolbar.  This
@@ -122,10 +125,24 @@
   // Jump to the cache entry whose name matches the string.
   void JumpToCacheEntry(const char* str);
 
+  // Clear and reset the output log and state
+  void ResetOutputs();
+
+  // Display the current progress and output
+  void DisplayOutputs();
+
   // Copies of cache entries stored in the user interface
   std::vector<cmCursesCacheEntryComposite> Entries;
-  // Errors produced during last run of cmake
-  std::vector<std::string> Errors;
+
+  // The form used to display logs during processing
+  std::unique_ptr<cmCursesLongMessageForm> LogForm;
+  // Output produced by the last pass
+  std::vector<std::string> Outputs;
+  // Did the last pass produced outputs of interest (errors, warnings, ...)
+  bool HasNonStatusOutputs;
+  // Last progress bar
+  std::string LastProgress;
+
   // Command line arguments to be passed to cmake each time
   // it is run
   std::vector<std::string> Args;
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx
index eb773ad..a15241f 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.cxx
+++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx
@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmCursesOptionsWidget.h"
 
+#include "cmCursesColor.h"
 #include "cmCursesWidget.h"
 #include "cmStateTypes.h"
 
@@ -15,8 +16,13 @@
   // there is no option type, and string type causes ccmake to cast
   // the widget into a string widget at some point.  BOOL is safe for
   // now.
-  set_field_fore(this->Field, A_NORMAL);
-  set_field_back(this->Field, A_STANDOUT);
+  if (cmCursesColor::HasColors()) {
+    set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::Options));
+    set_field_back(this->Field, COLOR_PAIR(cmCursesColor::Options));
+  } else {
+    set_field_fore(this->Field, A_NORMAL);
+    set_field_back(this->Field, A_STANDOUT);
+  }
   field_opts_off(this->Field, O_STATIC);
 }
 
diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx
index bb3808e..8ed42de 100644
--- a/Source/CursesDialog/cmCursesPathWidget.cxx
+++ b/Source/CursesDialog/cmCursesPathWidget.cxx
@@ -4,6 +4,7 @@
 
 #include <vector>
 
+#include "cmCursesColor.h"
 #include "cmCursesMainForm.h"
 #include "cmCursesStringWidget.h"
 #include "cmStateTypes.h"
@@ -16,6 +17,13 @@
   this->Type = cmStateEnums::PATH;
   this->Cycle = false;
   this->CurrentIndex = 0;
+  if (cmCursesColor::HasColors()) {
+    set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::Path));
+    set_field_back(this->Field, COLOR_PAIR(cmCursesColor::Path));
+  } else {
+    set_field_fore(this->Field, A_NORMAL);
+    set_field_back(this->Field, A_STANDOUT);
+  }
 }
 
 void cmCursesPathWidget::OnType(int& key, cmCursesMainForm* fm, WINDOW* w)
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index 6296af2..c629478 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -4,6 +4,7 @@
 
 #include <cstdio>
 
+#include "cmCursesColor.h"
 #include "cmCursesForm.h"
 #include "cmCursesMainForm.h"
 #include "cmCursesStandardIncludes.h"
@@ -21,8 +22,13 @@
 {
   this->InEdit = false;
   this->Type = cmStateEnums::STRING;
-  set_field_fore(this->Field, A_NORMAL);
-  set_field_back(this->Field, A_STANDOUT);
+  if (cmCursesColor::HasColors()) {
+    set_field_fore(this->Field, COLOR_PAIR(cmCursesColor::String));
+    set_field_back(this->Field, COLOR_PAIR(cmCursesColor::String));
+  } else {
+    set_field_fore(this->Field, A_NORMAL);
+    set_field_back(this->Field, A_STANDOUT);
+  }
   field_opts_off(this->Field, O_STATIC);
 }
 
diff --git a/Source/LexerParser/cmCommandArgumentParser.cxx b/Source/LexerParser/cmCommandArgumentParser.cxx
index ae7fb42..34dc8ec 100644
--- a/Source/LexerParser/cmCommandArgumentParser.cxx
+++ b/Source/LexerParser/cmCommandArgumentParser.cxx
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
@@ -48,7 +48,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.3.2"
+#define YYBISON_VERSION "3.4.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -72,7 +72,7 @@
 
 
 /* First part of user prologue.  */
-#line 1 "cmCommandArgumentParser.y" /* yacc.c:337  */
+#line 1 "cmCommandArgumentParser.y"
 
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
@@ -134,7 +134,8 @@
 # pragma GCC diagnostic ignored "-Wconversion"
 #endif
 
-#line 138 "cmCommandArgumentParser.cxx" /* yacc.c:337  */
+#line 138 "cmCommandArgumentParser.cxx"
+
 # ifndef YY_NULLPTR
 #  if defined __cplusplus
 #   if 201103L <= __cplusplus
@@ -155,8 +156,8 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-/* In a future release of Bison, this section will be replaced
-   by #include "cmCommandArgumentParserTokens.h".  */
+/* Use api.header.include to #include this header
+   instead of duplicating it here.  */
 #ifndef YY_CMCOMMANDARGUMENT_YY_CMCOMMANDARGUMENTPARSERTOKENS_H_INCLUDED
 # define YY_CMCOMMANDARGUMENT_YY_CMCOMMANDARGUMENTPARSERTOKENS_H_INCLUDED
 /* Debug traces.  */
@@ -310,6 +311,8 @@
 #endif
 
 
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -700,7 +703,9 @@
   if (yytype < YYNTOKENS)
     YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
 # endif
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
@@ -1138,6 +1143,8 @@
 | yynewstate -- set current state (the top of the stack) to yystate.  |
 `--------------------------------------------------------------------*/
 yysetstate:
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
   *yyssp = (yytype_int16) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
@@ -1200,8 +1207,6 @@
     }
 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
   if (yystate == YYFINAL)
     YYACCEPT;
 
@@ -1269,7 +1274,6 @@
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
   YY_IGNORE_MAYBE_UNINITIALIZED_END
-
   goto yynewstate;
 
 
@@ -1304,193 +1308,194 @@
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 2:
-#line 99 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+  case 2:
+#line 99 "cmCommandArgumentParser.y"
     {
     (yyval.str) = 0;
     yyGetParser->SetResult((yyvsp[0].str));
   }
-#line 1314 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1318 "cmCommandArgumentParser.cxx"
     break;
 
   case 3:
-#line 105 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 105 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1322 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1326 "cmCommandArgumentParser.cxx"
     break;
 
   case 4:
-#line 108 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 108 "cmCommandArgumentParser.y"
     {
     (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
   }
-#line 1330 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1334 "cmCommandArgumentParser.cxx"
     break;
 
   case 5:
-#line 113 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 113 "cmCommandArgumentParser.y"
     {
     (yyval.str) = 0;
   }
-#line 1338 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1342 "cmCommandArgumentParser.cxx"
     break;
 
   case 6:
-#line 116 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 116 "cmCommandArgumentParser.y"
     {
     (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
   }
-#line 1346 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1350 "cmCommandArgumentParser.cxx"
     break;
 
   case 7:
-#line 121 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 121 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1354 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1358 "cmCommandArgumentParser.cxx"
     break;
 
   case 8:
-#line 124 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 124 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1362 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1366 "cmCommandArgumentParser.cxx"
     break;
 
   case 9:
-#line 129 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 129 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1370 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1374 "cmCommandArgumentParser.cxx"
     break;
 
   case 10:
-#line 132 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 132 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1378 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1382 "cmCommandArgumentParser.cxx"
     break;
 
   case 11:
-#line 135 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 135 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1386 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1390 "cmCommandArgumentParser.cxx"
     break;
 
   case 12:
-#line 138 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 138 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1394 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1398 "cmCommandArgumentParser.cxx"
     break;
 
   case 13:
-#line 141 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 141 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1402 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1406 "cmCommandArgumentParser.cxx"
     break;
 
   case 14:
-#line 144 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 144 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1410 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1414 "cmCommandArgumentParser.cxx"
     break;
 
   case 15:
-#line 149 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 149 "cmCommandArgumentParser.y"
     {
     (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str));
   }
-#line 1418 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1422 "cmCommandArgumentParser.cxx"
     break;
 
   case 16:
-#line 152 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 152 "cmCommandArgumentParser.y"
     {
     (yyval.str) = yyGetParser->ExpandSpecialVariable((yyvsp[-2].str), (yyvsp[-1].str));
   }
-#line 1426 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1430 "cmCommandArgumentParser.cxx"
     break;
 
   case 17:
-#line 155 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 155 "cmCommandArgumentParser.y"
     {
     (yyval.str) = yyGetParser->ExpandVariable((yyvsp[-1].str));
   }
-#line 1434 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1438 "cmCommandArgumentParser.cxx"
     break;
 
   case 18:
-#line 158 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 158 "cmCommandArgumentParser.y"
     {
     (yyval.str) = yyGetParser->ExpandVariableForAt((yyvsp[0].str));
   }
-#line 1442 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1446 "cmCommandArgumentParser.cxx"
     break;
 
   case 19:
-#line 163 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 163 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1450 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1454 "cmCommandArgumentParser.cxx"
     break;
 
   case 20:
-#line 166 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 166 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[-1].str);
   }
-#line 1458 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1462 "cmCommandArgumentParser.cxx"
     break;
 
   case 21:
-#line 171 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 171 "cmCommandArgumentParser.y"
     {
     (yyval.str) = 0;
   }
-#line 1466 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1470 "cmCommandArgumentParser.cxx"
     break;
 
   case 22:
-#line 174 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 174 "cmCommandArgumentParser.y"
     {
     (yyval.str) = yyGetParser->CombineUnions((yyvsp[-1].str), (yyvsp[0].str));
   }
-#line 1474 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1478 "cmCommandArgumentParser.cxx"
     break;
 
   case 23:
-#line 179 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 179 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1482 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1486 "cmCommandArgumentParser.cxx"
     break;
 
   case 24:
-#line 182 "cmCommandArgumentParser.y" /* yacc.c:1652  */
+#line 182 "cmCommandArgumentParser.y"
     {
     (yyval.str) = (yyvsp[0].str);
   }
-#line 1490 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1494 "cmCommandArgumentParser.cxx"
     break;
 
 
-#line 1494 "cmCommandArgumentParser.cxx" /* yacc.c:1652  */
+#line 1498 "cmCommandArgumentParser.cxx"
+
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1723,7 +1728,7 @@
 #endif
   return yyresult;
 }
-#line 187 "cmCommandArgumentParser.y" /* yacc.c:1918  */
+#line 187 "cmCommandArgumentParser.y"
 
 /* End of grammar */
 
diff --git a/Source/LexerParser/cmCommandArgumentParserTokens.h b/Source/LexerParser/cmCommandArgumentParserTokens.h
index 56c9794..033b899 100644
--- a/Source/LexerParser/cmCommandArgumentParserTokens.h
+++ b/Source/LexerParser/cmCommandArgumentParserTokens.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
diff --git a/Source/LexerParser/cmDependsJavaParser.cxx b/Source/LexerParser/cmDependsJavaParser.cxx
index 6c1fb2c..b15082d 100644
--- a/Source/LexerParser/cmDependsJavaParser.cxx
+++ b/Source/LexerParser/cmDependsJavaParser.cxx
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
@@ -48,7 +48,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.3.2"
+#define YYBISON_VERSION "3.4.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -72,7 +72,7 @@
 
 
 /* First part of user prologue.  */
-#line 1 "cmDependsJavaParser.y" /* yacc.c:337  */
+#line 1 "cmDependsJavaParser.y"
 
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
@@ -123,7 +123,8 @@
 # pragma GCC diagnostic ignored "-Wconversion"
 #endif
 
-#line 127 "cmDependsJavaParser.cxx" /* yacc.c:337  */
+#line 127 "cmDependsJavaParser.cxx"
+
 # ifndef YY_NULLPTR
 #  if defined __cplusplus
 #   if 201103L <= __cplusplus
@@ -144,8 +145,8 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-/* In a future release of Bison, this section will be replaced
-   by #include "cmDependsJavaParserTokens.h".  */
+/* Use api.header.include to #include this header
+   instead of duplicating it here.  */
 #ifndef YY_CMDEPENDSJAVA_YY_CMDEPENDSJAVAPARSERTOKENS_H_INCLUDED
 # define YY_CMDEPENDSJAVA_YY_CMDEPENDSJAVAPARSERTOKENS_H_INCLUDED
 /* Debug traces.  */
@@ -481,6 +482,8 @@
 #endif
 
 
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -1685,7 +1688,9 @@
   if (yytype < YYNTOKENS)
     YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
 # endif
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
@@ -2123,6 +2128,8 @@
 | yynewstate -- set current state (the top of the stack) to yystate.  |
 `--------------------------------------------------------------------*/
 yysetstate:
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
   *yyssp = (yytype_int16) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
@@ -2185,8 +2192,6 @@
     }
 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
   if (yystate == YYFINAL)
     YYACCEPT;
 
@@ -2254,7 +2259,6 @@
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
   YY_IGNORE_MAYBE_UNINITIALIZED_END
-
   goto yynewstate;
 
 
@@ -2289,215 +2293,215 @@
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 2:
-#line 183 "cmDependsJavaParser.y" /* yacc.c:1652  */
+  case 2:
+#line 183 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2301 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2305 "cmDependsJavaParser.cxx"
     break;
 
   case 3:
-#line 192 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 192 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2312 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2316 "cmDependsJavaParser.cxx"
     break;
 
   case 4:
-#line 200 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 200 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2323 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2327 "cmDependsJavaParser.cxx"
     break;
 
   case 5:
-#line 208 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 208 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2334 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2338 "cmDependsJavaParser.cxx"
     break;
 
   case 6:
-#line 216 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 216 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2345 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2349 "cmDependsJavaParser.cxx"
     break;
 
   case 7:
-#line 224 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 224 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2356 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2360 "cmDependsJavaParser.cxx"
     break;
 
   case 8:
-#line 232 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 232 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2367 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2371 "cmDependsJavaParser.cxx"
     break;
 
   case 9:
-#line 241 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 241 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2378 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2382 "cmDependsJavaParser.cxx"
     break;
 
   case 10:
-#line 249 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 249 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2389 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2393 "cmDependsJavaParser.cxx"
     break;
 
   case 11:
-#line 258 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 258 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2400 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2404 "cmDependsJavaParser.cxx"
     break;
 
   case 12:
-#line 266 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 266 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2411 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2415 "cmDependsJavaParser.cxx"
     break;
 
   case 13:
-#line 275 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 275 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2419 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2423 "cmDependsJavaParser.cxx"
     break;
 
   case 14:
-#line 280 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 280 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2427 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2431 "cmDependsJavaParser.cxx"
     break;
 
   case 15:
-#line 285 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 285 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2435 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2439 "cmDependsJavaParser.cxx"
     break;
 
   case 16:
-#line 290 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 290 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2443 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2447 "cmDependsJavaParser.cxx"
     break;
 
   case 17:
-#line 295 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 295 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2451 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2455 "cmDependsJavaParser.cxx"
     break;
 
   case 18:
-#line 300 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 300 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2459 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2463 "cmDependsJavaParser.cxx"
     break;
 
   case 19:
-#line 305 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 305 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2467 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2471 "cmDependsJavaParser.cxx"
     break;
 
   case 20:
-#line 310 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 310 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
 }
-#line 2475 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2479 "cmDependsJavaParser.cxx"
     break;
 
   case 21:
-#line 316 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 316 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2486 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2490 "cmDependsJavaParser.cxx"
     break;
 
   case 22:
-#line 324 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 324 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2497 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2501 "cmDependsJavaParser.cxx"
     break;
 
   case 23:
-#line 333 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 333 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpStoreClass((yyvsp[0].str));
@@ -2505,44 +2509,44 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2509 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2513 "cmDependsJavaParser.cxx"
     break;
 
   case 24:
-#line 343 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 343 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2520 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2524 "cmDependsJavaParser.cxx"
     break;
 
   case 25:
-#line 352 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 352 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2531 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2535 "cmDependsJavaParser.cxx"
     break;
 
   case 26:
-#line 361 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 361 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2542 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2546 "cmDependsJavaParser.cxx"
     break;
 
   case 27:
-#line 369 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 369 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpStoreClass((yyvsp[-1].str));
@@ -2550,56 +2554,56 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2554 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2558 "cmDependsJavaParser.cxx"
     break;
 
   case 28:
-#line 379 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 379 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = (yyvsp[0].str);
 }
-#line 2563 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2567 "cmDependsJavaParser.cxx"
     break;
 
   case 29:
-#line 385 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 385 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = (yyvsp[0].str);
 }
-#line 2572 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2576 "cmDependsJavaParser.cxx"
     break;
 
   case 30:
-#line 392 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 392 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = (yyvsp[0].str);
 }
-#line 2581 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2585 "cmDependsJavaParser.cxx"
     break;
 
   case 31:
-#line 399 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 399 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = (yyvsp[0].str);
 }
-#line 2590 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2594 "cmDependsJavaParser.cxx"
     break;
 
   case 32:
-#line 405 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 405 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   (yyval.str) = (yyvsp[0].str);
 }
-#line 2599 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2603 "cmDependsJavaParser.cxx"
     break;
 
   case 33:
-#line 412 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 412 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->AddClassFound((yyvsp[-2].str));
@@ -2607,11 +2611,11 @@
   yyGetParser->DeallocateParserType(&((yyvsp[-2].str)));
   (yyval.str) = const_cast<char*>(yyGetParser->GetCurrentCombine());
 }
-#line 2611 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2615 "cmDependsJavaParser.cxx"
     break;
 
   case 34:
-#line 421 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 421 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpStoreClass((yyvsp[-2].str));
@@ -2620,11 +2624,11 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2624 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2628 "cmDependsJavaParser.cxx"
     break;
 
   case 35:
-#line 431 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 431 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpStoreClass((yyvsp[-2].str));
@@ -2633,118 +2637,118 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2637 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2641 "cmDependsJavaParser.cxx"
     break;
 
   case 36:
-#line 441 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 441 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2648 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2652 "cmDependsJavaParser.cxx"
     break;
 
   case 37:
-#line 450 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 450 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2659 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2663 "cmDependsJavaParser.cxx"
     break;
 
   case 38:
-#line 458 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 458 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2670 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2674 "cmDependsJavaParser.cxx"
     break;
 
   case 39:
-#line 467 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 467 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2681 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2685 "cmDependsJavaParser.cxx"
     break;
 
   case 40:
-#line 475 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 475 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2691 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2695 "cmDependsJavaParser.cxx"
     break;
 
   case 41:
-#line 482 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 482 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2702 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2706 "cmDependsJavaParser.cxx"
     break;
 
   case 42:
-#line 490 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 490 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2712 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2716 "cmDependsJavaParser.cxx"
     break;
 
   case 43:
-#line 497 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 497 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2723 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2727 "cmDependsJavaParser.cxx"
     break;
 
   case 44:
-#line 505 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 505 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2733 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2737 "cmDependsJavaParser.cxx"
     break;
 
   case 45:
-#line 512 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 512 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2744 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2748 "cmDependsJavaParser.cxx"
     break;
 
   case 46:
-#line 521 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 521 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->SetCurrentPackage((yyvsp[-1].str));
@@ -2754,33 +2758,33 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2758 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2762 "cmDependsJavaParser.cxx"
     break;
 
   case 47:
-#line 533 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 533 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2769 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2773 "cmDependsJavaParser.cxx"
     break;
 
   case 48:
-#line 541 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 541 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2780 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2784 "cmDependsJavaParser.cxx"
     break;
 
   case 49:
-#line 550 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 550 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->AddPackagesImport((yyvsp[-1].str));
@@ -2790,11 +2794,11 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2794 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2798 "cmDependsJavaParser.cxx"
     break;
 
   case 50:
-#line 562 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 562 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   std::string str = (yyvsp[-3].str);
@@ -2805,77 +2809,77 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2809 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2813 "cmDependsJavaParser.cxx"
     break;
 
   case 51:
-#line 575 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 575 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2820 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2824 "cmDependsJavaParser.cxx"
     break;
 
   case 52:
-#line 583 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 583 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2831 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2835 "cmDependsJavaParser.cxx"
     break;
 
   case 53:
-#line 591 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 591 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2842 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2846 "cmDependsJavaParser.cxx"
     break;
 
   case 54:
-#line 600 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 600 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2853 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2857 "cmDependsJavaParser.cxx"
     break;
 
   case 55:
-#line 608 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 608 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2864 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2868 "cmDependsJavaParser.cxx"
     break;
 
   case 67:
-#line 623 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 623 "cmDependsJavaParser.y"
     {
   yyGetParser->StartClass((yyvsp[0].str));
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
   jpCheckEmpty(3);
 }
-#line 2875 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2879 "cmDependsJavaParser.cxx"
     break;
 
   case 68:
-#line 633 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 633 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -2883,11 +2887,11 @@
   yyGetParser->SetCurrentCombine("");
   yyGetParser->EndClass();
 }
-#line 2887 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2891 "cmDependsJavaParser.cxx"
     break;
 
   case 69:
-#line 642 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 642 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(2);
@@ -2895,11 +2899,11 @@
   yyGetParser->SetCurrentCombine("");
   yyGetParser->EndClass();
 }
-#line 2899 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2903 "cmDependsJavaParser.cxx"
     break;
 
   case 70:
-#line 651 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 651 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -2907,11 +2911,11 @@
   yyGetParser->SetCurrentCombine("");
   yyGetParser->EndClass();
 }
-#line 2911 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2915 "cmDependsJavaParser.cxx"
     break;
 
   case 71:
-#line 660 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 660 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -2919,226 +2923,226 @@
   yyGetParser->SetCurrentCombine("");
   yyGetParser->EndClass();
 }
-#line 2923 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2927 "cmDependsJavaParser.cxx"
     break;
 
   case 72:
-#line 669 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 669 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2933 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2937 "cmDependsJavaParser.cxx"
     break;
 
   case 73:
-#line 676 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 676 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2944 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2948 "cmDependsJavaParser.cxx"
     break;
 
   case 74:
-#line 685 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 685 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2955 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2959 "cmDependsJavaParser.cxx"
     break;
 
   case 75:
-#line 694 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 694 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2966 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2970 "cmDependsJavaParser.cxx"
     break;
 
   case 76:
-#line 703 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 703 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2977 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2981 "cmDependsJavaParser.cxx"
     break;
 
   case 77:
-#line 711 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 711 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2988 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 2992 "cmDependsJavaParser.cxx"
     break;
 
   case 78:
-#line 720 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 720 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 2999 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3003 "cmDependsJavaParser.cxx"
     break;
 
   case 79:
-#line 728 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 728 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3009 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3013 "cmDependsJavaParser.cxx"
     break;
 
   case 80:
-#line 735 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 735 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3020 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3024 "cmDependsJavaParser.cxx"
     break;
 
   case 81:
-#line 744 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 744 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3031 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3035 "cmDependsJavaParser.cxx"
     break;
 
   case 82:
-#line 752 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 752 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3042 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3046 "cmDependsJavaParser.cxx"
     break;
 
   case 83:
-#line 760 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 760 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3053 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3057 "cmDependsJavaParser.cxx"
     break;
 
   case 84:
-#line 768 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 768 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3064 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3068 "cmDependsJavaParser.cxx"
     break;
 
   case 85:
-#line 777 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 777 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3075 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3079 "cmDependsJavaParser.cxx"
     break;
 
   case 86:
-#line 785 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 785 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3086 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3090 "cmDependsJavaParser.cxx"
     break;
 
   case 87:
-#line 794 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 794 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
 }
-#line 3094 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3098 "cmDependsJavaParser.cxx"
     break;
 
   case 88:
-#line 800 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 800 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3105 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3109 "cmDependsJavaParser.cxx"
     break;
 
   case 89:
-#line 808 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 808 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3116 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3120 "cmDependsJavaParser.cxx"
     break;
 
   case 90:
-#line 817 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 817 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3127 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3131 "cmDependsJavaParser.cxx"
     break;
 
   case 91:
-#line 825 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 825 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3138 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3142 "cmDependsJavaParser.cxx"
     break;
 
   case 92:
-#line 834 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 834 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
@@ -3146,77 +3150,77 @@
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3150 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3154 "cmDependsJavaParser.cxx"
     break;
 
   case 93:
-#line 843 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 843 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3161 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3165 "cmDependsJavaParser.cxx"
     break;
 
   case 94:
-#line 852 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 852 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3172 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3176 "cmDependsJavaParser.cxx"
     break;
 
   case 95:
-#line 860 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 860 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3183 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3187 "cmDependsJavaParser.cxx"
     break;
 
   case 96:
-#line 869 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 869 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3194 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3198 "cmDependsJavaParser.cxx"
     break;
 
   case 97:
-#line 877 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 877 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3205 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3209 "cmDependsJavaParser.cxx"
     break;
 
   case 98:
-#line 885 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 885 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3216 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3220 "cmDependsJavaParser.cxx"
     break;
 
   case 99:
-#line 894 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 894 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -3224,11 +3228,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3228 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3232 "cmDependsJavaParser.cxx"
     break;
 
   case 100:
-#line 903 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 903 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -3236,22 +3240,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3240 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3244 "cmDependsJavaParser.cxx"
     break;
 
   case 101:
-#line 912 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 912 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3251 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3255 "cmDependsJavaParser.cxx"
     break;
 
   case 102:
-#line 920 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 920 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3259,11 +3263,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3263 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3267 "cmDependsJavaParser.cxx"
     break;
 
   case 103:
-#line 930 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 930 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   yyGetParser->DeallocateParserType(&((yyvsp[-3].str)));
@@ -3272,40 +3276,40 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3276 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3280 "cmDependsJavaParser.cxx"
     break;
 
   case 104:
-#line 940 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 940 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
 
 }
-#line 3285 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3289 "cmDependsJavaParser.cxx"
     break;
 
   case 105:
-#line 946 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 946 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3296 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3300 "cmDependsJavaParser.cxx"
     break;
 
   case 107:
-#line 957 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 957 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
 
 }
-#line 3305 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3309 "cmDependsJavaParser.cxx"
     break;
 
   case 108:
-#line 963 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 963 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -3313,11 +3317,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3317 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3321 "cmDependsJavaParser.cxx"
     break;
 
   case 109:
-#line 973 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 973 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -3325,11 +3329,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3329 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3333 "cmDependsJavaParser.cxx"
     break;
 
   case 110:
-#line 983 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 983 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3337,20 +3341,20 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3341 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3345 "cmDependsJavaParser.cxx"
     break;
 
   case 111:
-#line 993 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 993 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
 
 }
-#line 3350 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3354 "cmDependsJavaParser.cxx"
     break;
 
   case 112:
-#line 999 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 999 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -3358,11 +3362,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3362 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3366 "cmDependsJavaParser.cxx"
     break;
 
   case 113:
-#line 1009 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1009 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3370,11 +3374,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3374 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3378 "cmDependsJavaParser.cxx"
     break;
 
   case 114:
-#line 1019 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1019 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3382,11 +3386,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3386 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3390 "cmDependsJavaParser.cxx"
     break;
 
   case 115:
-#line 1029 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1029 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -3394,11 +3398,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3398 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3402 "cmDependsJavaParser.cxx"
     break;
 
   case 116:
-#line 1038 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1038 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -3406,11 +3410,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3410 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3414 "cmDependsJavaParser.cxx"
     break;
 
   case 117:
-#line 1048 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1048 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   yyGetParser->DeallocateParserType(&((yyvsp[-3].str)));
@@ -3419,11 +3423,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3423 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3427 "cmDependsJavaParser.cxx"
     break;
 
   case 118:
-#line 1059 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1059 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -3431,22 +3435,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3435 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3439 "cmDependsJavaParser.cxx"
     break;
 
   case 119:
-#line 1068 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1068 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3446 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3450 "cmDependsJavaParser.cxx"
     break;
 
   case 120:
-#line 1076 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1076 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3454,11 +3458,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3458 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3462 "cmDependsJavaParser.cxx"
     break;
 
   case 121:
-#line 1086 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1086 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -3466,11 +3470,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3470 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3474 "cmDependsJavaParser.cxx"
     break;
 
   case 122:
-#line 1095 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1095 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -3478,22 +3482,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3482 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3486 "cmDependsJavaParser.cxx"
     break;
 
   case 123:
-#line 1105 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1105 "cmDependsJavaParser.y"
     {
   yyGetParser->StartClass((yyvsp[0].str));
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
   jpCheckEmpty(3);
 }
-#line 3493 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3497 "cmDependsJavaParser.cxx"
     break;
 
   case 124:
-#line 1114 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1114 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3501,21 +3505,21 @@
   yyGetParser->SetCurrentCombine("");
   yyGetParser->EndClass();
 }
-#line 3505 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3509 "cmDependsJavaParser.cxx"
     break;
 
   case 125:
-#line 1123 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1123 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 }
-#line 3515 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3519 "cmDependsJavaParser.cxx"
     break;
 
   case 126:
-#line 1130 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1130 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3523,11 +3527,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3527 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3531 "cmDependsJavaParser.cxx"
     break;
 
   case 127:
-#line 1140 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1140 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3535,11 +3539,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3539 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3543 "cmDependsJavaParser.cxx"
     break;
 
   case 128:
-#line 1149 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1149 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -3547,11 +3551,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3551 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3555 "cmDependsJavaParser.cxx"
     break;
 
   case 129:
-#line 1159 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1159 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -3559,33 +3563,33 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3563 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3567 "cmDependsJavaParser.cxx"
     break;
 
   case 130:
-#line 1168 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1168 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3574 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3578 "cmDependsJavaParser.cxx"
     break;
 
   case 131:
-#line 1176 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1176 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3585 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3589 "cmDependsJavaParser.cxx"
     break;
 
   case 132:
-#line 1185 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1185 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3593,11 +3597,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3597 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3601 "cmDependsJavaParser.cxx"
     break;
 
   case 133:
-#line 1194 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1194 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3605,11 +3609,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3609 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3613 "cmDependsJavaParser.cxx"
     break;
 
   case 134:
-#line 1203 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1203 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3617,22 +3621,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3621 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3625 "cmDependsJavaParser.cxx"
     break;
 
   case 135:
-#line 1212 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1212 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3632 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3636 "cmDependsJavaParser.cxx"
     break;
 
   case 136:
-#line 1220 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1220 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3640,22 +3644,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3644 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3648 "cmDependsJavaParser.cxx"
     break;
 
   case 137:
-#line 1229 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1229 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3655 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3659 "cmDependsJavaParser.cxx"
     break;
 
   case 138:
-#line 1238 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1238 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3663,11 +3667,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3667 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3671 "cmDependsJavaParser.cxx"
     break;
 
   case 139:
-#line 1248 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1248 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3675,11 +3679,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3679 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3683 "cmDependsJavaParser.cxx"
     break;
 
   case 140:
-#line 1258 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1258 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3687,11 +3691,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3691 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3695 "cmDependsJavaParser.cxx"
     break;
 
   case 141:
-#line 1267 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1267 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3699,11 +3703,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3703 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3707 "cmDependsJavaParser.cxx"
     break;
 
   case 142:
-#line 1277 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1277 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -3711,22 +3715,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3715 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3719 "cmDependsJavaParser.cxx"
     break;
 
   case 143:
-#line 1286 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1286 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3726 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3730 "cmDependsJavaParser.cxx"
     break;
 
   case 144:
-#line 1294 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1294 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3734,11 +3738,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3738 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3742 "cmDependsJavaParser.cxx"
     break;
 
   case 145:
-#line 1303 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1303 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -3746,11 +3750,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3750 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3754 "cmDependsJavaParser.cxx"
     break;
 
   case 146:
-#line 1313 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1313 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3758,11 +3762,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3762 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3766 "cmDependsJavaParser.cxx"
     break;
 
   case 147:
-#line 1322 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1322 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -3770,33 +3774,33 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3774 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3778 "cmDependsJavaParser.cxx"
     break;
 
   case 148:
-#line 1332 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1332 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3785 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3789 "cmDependsJavaParser.cxx"
     break;
 
   case 149:
-#line 1340 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1340 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3796 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3800 "cmDependsJavaParser.cxx"
     break;
 
   case 150:
-#line 1348 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1348 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3804,11 +3808,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3808 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3812 "cmDependsJavaParser.cxx"
     break;
 
   case 151:
-#line 1358 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1358 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3816,11 +3820,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3820 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3824 "cmDependsJavaParser.cxx"
     break;
 
   case 152:
-#line 1367 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1367 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(2);
@@ -3828,11 +3832,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3832 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3836 "cmDependsJavaParser.cxx"
     break;
 
   case 153:
-#line 1377 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1377 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3840,11 +3844,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3844 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3848 "cmDependsJavaParser.cxx"
     break;
 
   case 154:
-#line 1386 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1386 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3852,11 +3856,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3856 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3860 "cmDependsJavaParser.cxx"
     break;
 
   case 155:
-#line 1395 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1395 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3864,11 +3868,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3868 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3872 "cmDependsJavaParser.cxx"
     break;
 
   case 156:
-#line 1405 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1405 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(2);
@@ -3876,11 +3880,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3880 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3884 "cmDependsJavaParser.cxx"
     break;
 
   case 157:
-#line 1415 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1415 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(3);
@@ -3888,11 +3892,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3892 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3896 "cmDependsJavaParser.cxx"
     break;
 
   case 158:
-#line 1424 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1424 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(2);
@@ -3900,11 +3904,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3904 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3908 "cmDependsJavaParser.cxx"
     break;
 
   case 159:
-#line 1434 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1434 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3912,11 +3916,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3916 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3920 "cmDependsJavaParser.cxx"
     break;
 
   case 160:
-#line 1443 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1443 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3924,11 +3928,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3928 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3932 "cmDependsJavaParser.cxx"
     break;
 
   case 161:
-#line 1452 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1452 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3936,11 +3940,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3940 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3944 "cmDependsJavaParser.cxx"
     break;
 
   case 162:
-#line 1461 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1461 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3948,11 +3952,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3952 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3956 "cmDependsJavaParser.cxx"
     break;
 
   case 163:
-#line 1470 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1470 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3960,11 +3964,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3964 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3968 "cmDependsJavaParser.cxx"
     break;
 
   case 164:
-#line 1479 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1479 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3972,11 +3976,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3976 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3980 "cmDependsJavaParser.cxx"
     break;
 
   case 165:
-#line 1489 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1489 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3984,11 +3988,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 3988 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 3992 "cmDependsJavaParser.cxx"
     break;
 
   case 166:
-#line 1498 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1498 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -3996,11 +4000,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4000 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4004 "cmDependsJavaParser.cxx"
     break;
 
   case 167:
-#line 1507 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1507 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4008,11 +4012,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4012 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4016 "cmDependsJavaParser.cxx"
     break;
 
   case 168:
-#line 1516 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1516 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4020,11 +4024,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4024 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4028 "cmDependsJavaParser.cxx"
     break;
 
   case 169:
-#line 1525 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1525 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4032,11 +4036,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4036 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4040 "cmDependsJavaParser.cxx"
     break;
 
   case 170:
-#line 1535 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1535 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4044,11 +4048,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4048 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4052 "cmDependsJavaParser.cxx"
     break;
 
   case 171:
-#line 1544 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1544 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4056,11 +4060,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4060 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4064 "cmDependsJavaParser.cxx"
     break;
 
   case 172:
-#line 1553 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1553 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4068,11 +4072,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4072 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4076 "cmDependsJavaParser.cxx"
     break;
 
   case 173:
-#line 1562 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1562 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4080,11 +4084,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4084 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4088 "cmDependsJavaParser.cxx"
     break;
 
   case 174:
-#line 1571 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1571 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4092,11 +4096,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4096 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4100 "cmDependsJavaParser.cxx"
     break;
 
   case 175:
-#line 1580 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1580 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4104,11 +4108,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4108 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4112 "cmDependsJavaParser.cxx"
     break;
 
   case 176:
-#line 1589 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1589 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4116,11 +4120,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4120 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4124 "cmDependsJavaParser.cxx"
     break;
 
   case 177:
-#line 1598 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1598 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4128,11 +4132,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4132 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4136 "cmDependsJavaParser.cxx"
     break;
 
   case 178:
-#line 1607 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1607 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4140,11 +4144,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4144 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4148 "cmDependsJavaParser.cxx"
     break;
 
   case 179:
-#line 1616 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1616 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4152,11 +4156,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4156 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4160 "cmDependsJavaParser.cxx"
     break;
 
   case 180:
-#line 1625 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1625 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4164,11 +4168,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4168 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4172 "cmDependsJavaParser.cxx"
     break;
 
   case 181:
-#line 1634 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1634 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4176,11 +4180,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4180 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4184 "cmDependsJavaParser.cxx"
     break;
 
   case 182:
-#line 1644 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1644 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4188,11 +4192,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4192 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4196 "cmDependsJavaParser.cxx"
     break;
 
   case 183:
-#line 1654 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1654 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[-2].str)));
@@ -4201,11 +4205,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4205 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4209 "cmDependsJavaParser.cxx"
     break;
 
   case 184:
-#line 1665 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1665 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4213,11 +4217,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4217 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4221 "cmDependsJavaParser.cxx"
     break;
 
   case 185:
-#line 1675 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1675 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -4225,11 +4229,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4229 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4233 "cmDependsJavaParser.cxx"
     break;
 
   case 186:
-#line 1685 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1685 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4237,11 +4241,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4241 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4245 "cmDependsJavaParser.cxx"
     break;
 
   case 187:
-#line 1694 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1694 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4249,11 +4253,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4253 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4257 "cmDependsJavaParser.cxx"
     break;
 
   case 188:
-#line 1703 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1703 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4261,11 +4265,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4265 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4269 "cmDependsJavaParser.cxx"
     break;
 
   case 189:
-#line 1712 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1712 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4273,11 +4277,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4277 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4281 "cmDependsJavaParser.cxx"
     break;
 
   case 190:
-#line 1721 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1721 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4285,11 +4289,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4289 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4293 "cmDependsJavaParser.cxx"
     break;
 
   case 191:
-#line 1730 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1730 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4297,11 +4301,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4301 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4305 "cmDependsJavaParser.cxx"
     break;
 
   case 192:
-#line 1739 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1739 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4309,11 +4313,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4313 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4317 "cmDependsJavaParser.cxx"
     break;
 
   case 193:
-#line 1749 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1749 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -4321,11 +4325,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4325 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4329 "cmDependsJavaParser.cxx"
     break;
 
   case 194:
-#line 1759 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1759 "cmDependsJavaParser.y"
     {
   jpElementStart(7);
   jpCheckEmpty(7);
@@ -4333,11 +4337,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4337 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4341 "cmDependsJavaParser.cxx"
     break;
 
   case 195:
-#line 1769 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1769 "cmDependsJavaParser.y"
     {
   jpElementStart(7);
   jpCheckEmpty(7);
@@ -4345,40 +4349,40 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4349 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4353 "cmDependsJavaParser.cxx"
     break;
 
   case 196:
-#line 1779 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1779 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
 
 }
-#line 4358 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4362 "cmDependsJavaParser.cxx"
     break;
 
   case 197:
-#line 1786 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1786 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
 
 }
-#line 4367 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4371 "cmDependsJavaParser.cxx"
     break;
 
   case 198:
-#line 1792 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1792 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4378 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4382 "cmDependsJavaParser.cxx"
     break;
 
   case 199:
-#line 1800 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1800 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4386,22 +4390,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4390 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4394 "cmDependsJavaParser.cxx"
     break;
 
   case 200:
-#line 1809 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1809 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4401 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4405 "cmDependsJavaParser.cxx"
     break;
 
   case 201:
-#line 1817 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1817 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -4409,11 +4413,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4413 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4417 "cmDependsJavaParser.cxx"
     break;
 
   case 202:
-#line 1827 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1827 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -4421,11 +4425,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4425 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4429 "cmDependsJavaParser.cxx"
     break;
 
   case 203:
-#line 1837 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1837 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4433,11 +4437,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4437 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4441 "cmDependsJavaParser.cxx"
     break;
 
   case 204:
-#line 1846 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1846 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -4445,11 +4449,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4449 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4453 "cmDependsJavaParser.cxx"
     break;
 
   case 205:
-#line 1856 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1856 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4457,11 +4461,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4461 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4465 "cmDependsJavaParser.cxx"
     break;
 
   case 206:
-#line 1865 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1865 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -4469,58 +4473,58 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4473 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4477 "cmDependsJavaParser.cxx"
     break;
 
   case 207:
-#line 1875 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1875 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
 
 }
-#line 4482 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4486 "cmDependsJavaParser.cxx"
     break;
 
   case 208:
-#line 1882 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1882 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
 
 }
-#line 4491 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4495 "cmDependsJavaParser.cxx"
     break;
 
   case 209:
-#line 1889 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1889 "cmDependsJavaParser.y"
     {
   jpElementStart(7);
 
 }
-#line 4500 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4504 "cmDependsJavaParser.cxx"
     break;
 
   case 210:
-#line 1897 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1897 "cmDependsJavaParser.y"
     {
   jpElementStart(9);
 
 }
-#line 4509 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4513 "cmDependsJavaParser.cxx"
     break;
 
   case 211:
-#line 1903 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1903 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4520 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4524 "cmDependsJavaParser.cxx"
     break;
 
   case 212:
-#line 1911 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1911 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4528,22 +4532,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4532 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4536 "cmDependsJavaParser.cxx"
     break;
 
   case 213:
-#line 1920 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1920 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4543 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4547 "cmDependsJavaParser.cxx"
     break;
 
   case 214:
-#line 1928 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1928 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4551,33 +4555,33 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4555 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4559 "cmDependsJavaParser.cxx"
     break;
 
   case 215:
-#line 1939 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1939 "cmDependsJavaParser.y"
     {
   jpElementStart(9);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4566 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4570 "cmDependsJavaParser.cxx"
     break;
 
   case 216:
-#line 1947 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1947 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4577 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4581 "cmDependsJavaParser.cxx"
     break;
 
   case 217:
-#line 1955 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1955 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4585,11 +4589,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4589 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4593 "cmDependsJavaParser.cxx"
     break;
 
   case 218:
-#line 1965 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1965 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4597,11 +4601,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4601 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4605 "cmDependsJavaParser.cxx"
     break;
 
   case 219:
-#line 1974 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1974 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4609,11 +4613,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4613 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4617 "cmDependsJavaParser.cxx"
     break;
 
   case 220:
-#line 1984 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1984 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4621,11 +4625,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4625 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4629 "cmDependsJavaParser.cxx"
     break;
 
   case 221:
-#line 1994 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 1994 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4633,11 +4637,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4637 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4641 "cmDependsJavaParser.cxx"
     break;
 
   case 222:
-#line 2003 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2003 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4645,11 +4649,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4649 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4653 "cmDependsJavaParser.cxx"
     break;
 
   case 223:
-#line 2013 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2013 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4657,11 +4661,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4661 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4665 "cmDependsJavaParser.cxx"
     break;
 
   case 224:
-#line 2022 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2022 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -4669,11 +4673,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4673 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4677 "cmDependsJavaParser.cxx"
     break;
 
   case 225:
-#line 2032 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2032 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[-1].str)));
@@ -4682,31 +4686,31 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4686 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4690 "cmDependsJavaParser.cxx"
     break;
 
   case 226:
-#line 2042 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2042 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4697 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4701 "cmDependsJavaParser.cxx"
     break;
 
   case 227:
-#line 2050 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2050 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
 
 }
-#line 4706 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4710 "cmDependsJavaParser.cxx"
     break;
 
   case 228:
-#line 2057 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2057 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[-1].str)));
@@ -4715,11 +4719,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4719 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4723 "cmDependsJavaParser.cxx"
     break;
 
   case 229:
-#line 2068 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2068 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4727,11 +4731,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4731 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4735 "cmDependsJavaParser.cxx"
     break;
 
   case 230:
-#line 2078 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2078 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4739,11 +4743,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4743 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4747 "cmDependsJavaParser.cxx"
     break;
 
   case 231:
-#line 2088 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2088 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -4751,11 +4755,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4755 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4759 "cmDependsJavaParser.cxx"
     break;
 
   case 232:
-#line 2098 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2098 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4763,11 +4767,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4767 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4771 "cmDependsJavaParser.cxx"
     break;
 
   case 233:
-#line 2107 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2107 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -4775,22 +4779,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4779 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4783 "cmDependsJavaParser.cxx"
     break;
 
   case 234:
-#line 2116 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2116 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4790 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4794 "cmDependsJavaParser.cxx"
     break;
 
   case 235:
-#line 2124 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2124 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4798,11 +4802,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4802 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4806 "cmDependsJavaParser.cxx"
     break;
 
   case 236:
-#line 2134 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2134 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4810,11 +4814,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4814 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4818 "cmDependsJavaParser.cxx"
     break;
 
   case 237:
-#line 2143 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2143 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -4822,20 +4826,20 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4826 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4830 "cmDependsJavaParser.cxx"
     break;
 
   case 238:
-#line 2153 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2153 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
 
 }
-#line 4835 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4839 "cmDependsJavaParser.cxx"
     break;
 
   case 239:
-#line 2160 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2160 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -4843,11 +4847,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4847 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4851 "cmDependsJavaParser.cxx"
     break;
 
   case 240:
-#line 2170 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2170 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4855,11 +4859,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4859 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4863 "cmDependsJavaParser.cxx"
     break;
 
   case 241:
-#line 2179 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2179 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4867,11 +4871,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4871 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4875 "cmDependsJavaParser.cxx"
     break;
 
   case 242:
-#line 2189 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2189 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4879,20 +4883,20 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4883 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4887 "cmDependsJavaParser.cxx"
     break;
 
   case 243:
-#line 2198 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2198 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
 
 }
-#line 4892 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4896 "cmDependsJavaParser.cxx"
     break;
 
   case 244:
-#line 2204 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2204 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -4900,11 +4904,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4904 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4908 "cmDependsJavaParser.cxx"
     break;
 
   case 245:
-#line 2213 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2213 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4912,11 +4916,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4916 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4920 "cmDependsJavaParser.cxx"
     break;
 
   case 246:
-#line 2222 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2222 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4924,11 +4928,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4928 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4932 "cmDependsJavaParser.cxx"
     break;
 
   case 247:
-#line 2231 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2231 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4936,11 +4940,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4940 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4944 "cmDependsJavaParser.cxx"
     break;
 
   case 248:
-#line 2240 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2240 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4948,11 +4952,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4952 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4956 "cmDependsJavaParser.cxx"
     break;
 
   case 249:
-#line 2250 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2250 "cmDependsJavaParser.y"
     {
   jpElementStart(6);
   jpCheckEmpty(6);
@@ -4960,22 +4964,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4964 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4968 "cmDependsJavaParser.cxx"
     break;
 
   case 250:
-#line 2259 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2259 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4975 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4979 "cmDependsJavaParser.cxx"
     break;
 
   case 251:
-#line 2267 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2267 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -4983,22 +4987,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4987 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 4991 "cmDependsJavaParser.cxx"
     break;
 
   case 252:
-#line 2276 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2276 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 4998 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5002 "cmDependsJavaParser.cxx"
     break;
 
   case 253:
-#line 2284 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2284 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5006,11 +5010,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5010 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5014 "cmDependsJavaParser.cxx"
     break;
 
   case 254:
-#line 2294 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2294 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5018,11 +5022,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5022 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5026 "cmDependsJavaParser.cxx"
     break;
 
   case 255:
-#line 2303 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2303 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5030,11 +5034,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5034 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5038 "cmDependsJavaParser.cxx"
     break;
 
   case 256:
-#line 2313 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2313 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -5042,11 +5046,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5046 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5050 "cmDependsJavaParser.cxx"
     break;
 
   case 257:
-#line 2322 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2322 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -5054,11 +5058,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5058 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5062 "cmDependsJavaParser.cxx"
     break;
 
   case 258:
-#line 2331 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2331 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -5066,11 +5070,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5070 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5074 "cmDependsJavaParser.cxx"
     break;
 
   case 259:
-#line 2340 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2340 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -5078,22 +5082,22 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5082 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5086 "cmDependsJavaParser.cxx"
     break;
 
   case 260:
-#line 2349 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2349 "cmDependsJavaParser.y"
     {
   jpElementStart(0);
   (yyval.str) = 0;
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5093 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5097 "cmDependsJavaParser.cxx"
     break;
 
   case 261:
-#line 2357 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2357 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5101,11 +5105,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5105 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5109 "cmDependsJavaParser.cxx"
     break;
 
   case 262:
-#line 2367 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2367 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5113,11 +5117,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5117 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5121 "cmDependsJavaParser.cxx"
     break;
 
   case 263:
-#line 2376 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2376 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5125,11 +5129,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5129 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5133 "cmDependsJavaParser.cxx"
     break;
 
   case 264:
-#line 2386 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2386 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5137,29 +5141,29 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5141 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5145 "cmDependsJavaParser.cxx"
     break;
 
   case 265:
-#line 2396 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2396 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
 
 }
-#line 5150 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5154 "cmDependsJavaParser.cxx"
     break;
 
   case 266:
-#line 2402 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2402 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
 
 }
-#line 5159 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5163 "cmDependsJavaParser.cxx"
     break;
 
   case 267:
-#line 2409 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2409 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
@@ -5168,11 +5172,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5172 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5176 "cmDependsJavaParser.cxx"
     break;
 
   case 268:
-#line 2419 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2419 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
@@ -5181,11 +5185,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5185 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5189 "cmDependsJavaParser.cxx"
     break;
 
   case 269:
-#line 2429 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2429 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
@@ -5194,11 +5198,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5198 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5202 "cmDependsJavaParser.cxx"
     break;
 
   case 270:
-#line 2439 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2439 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
@@ -5207,11 +5211,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5211 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5215 "cmDependsJavaParser.cxx"
     break;
 
   case 271:
-#line 2450 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2450 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   yyGetParser->DeallocateParserType(&((yyvsp[-3].str)));
@@ -5220,11 +5224,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5224 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5228 "cmDependsJavaParser.cxx"
     break;
 
   case 272:
-#line 2460 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2460 "cmDependsJavaParser.y"
     {
   jpElementStart(6);
   yyGetParser->DeallocateParserType(&((yyvsp[-5].str)));
@@ -5234,11 +5238,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5238 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5242 "cmDependsJavaParser.cxx"
     break;
 
   case 273:
-#line 2471 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2471 "cmDependsJavaParser.y"
     {
   jpElementStart(6);
   yyGetParser->DeallocateParserType(&((yyvsp[-3].str)));
@@ -5247,11 +5251,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5251 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5255 "cmDependsJavaParser.cxx"
     break;
 
   case 274:
-#line 2481 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2481 "cmDependsJavaParser.y"
     {
   jpElementStart(6);
   yyGetParser->DeallocateParserType(&((yyvsp[-3].str)));
@@ -5260,11 +5264,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5264 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5268 "cmDependsJavaParser.cxx"
     break;
 
   case 275:
-#line 2492 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2492 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   yyGetParser->DeallocateParserType(&((yyvsp[-3].str)));
@@ -5273,11 +5277,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5277 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5281 "cmDependsJavaParser.cxx"
     break;
 
   case 276:
-#line 2502 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2502 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -5285,11 +5289,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5289 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5293 "cmDependsJavaParser.cxx"
     break;
 
   case 277:
-#line 2512 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2512 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5297,11 +5301,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5301 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5305 "cmDependsJavaParser.cxx"
     break;
 
   case 278:
-#line 2521 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2521 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
@@ -5309,11 +5313,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5313 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5317 "cmDependsJavaParser.cxx"
     break;
 
   case 279:
-#line 2530 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2530 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5321,11 +5325,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5325 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5329 "cmDependsJavaParser.cxx"
     break;
 
   case 280:
-#line 2539 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2539 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5333,11 +5337,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5337 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5341 "cmDependsJavaParser.cxx"
     break;
 
   case 281:
-#line 2548 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2548 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5345,11 +5349,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5349 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5353 "cmDependsJavaParser.cxx"
     break;
 
   case 282:
-#line 2558 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2558 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5357,11 +5361,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5361 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5365 "cmDependsJavaParser.cxx"
     break;
 
   case 283:
-#line 2568 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2568 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5369,11 +5373,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5373 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5377 "cmDependsJavaParser.cxx"
     break;
 
   case 284:
-#line 2578 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2578 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5381,11 +5385,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5385 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5389 "cmDependsJavaParser.cxx"
     break;
 
   case 285:
-#line 2587 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2587 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5393,11 +5397,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5397 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5401 "cmDependsJavaParser.cxx"
     break;
 
   case 286:
-#line 2596 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2596 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5405,11 +5409,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5409 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5413 "cmDependsJavaParser.cxx"
     break;
 
   case 287:
-#line 2605 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2605 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5417,11 +5421,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5421 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5425 "cmDependsJavaParser.cxx"
     break;
 
   case 288:
-#line 2614 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2614 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5429,11 +5433,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5433 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5437 "cmDependsJavaParser.cxx"
     break;
 
   case 289:
-#line 2624 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2624 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5441,11 +5445,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5445 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5449 "cmDependsJavaParser.cxx"
     break;
 
   case 290:
-#line 2634 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2634 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5453,11 +5457,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5457 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5461 "cmDependsJavaParser.cxx"
     break;
 
   case 291:
-#line 2644 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2644 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5465,11 +5469,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5469 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5473 "cmDependsJavaParser.cxx"
     break;
 
   case 292:
-#line 2653 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2653 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5477,11 +5481,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5481 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5485 "cmDependsJavaParser.cxx"
     break;
 
   case 293:
-#line 2662 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2662 "cmDependsJavaParser.y"
     {
   jpElementStart(2);
   jpCheckEmpty(2);
@@ -5489,11 +5493,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5493 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5497 "cmDependsJavaParser.cxx"
     break;
 
   case 294:
-#line 2671 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2671 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5501,11 +5505,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5505 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5509 "cmDependsJavaParser.cxx"
     break;
 
   case 295:
-#line 2681 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2681 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -5513,11 +5517,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5517 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5521 "cmDependsJavaParser.cxx"
     break;
 
   case 296:
-#line 2690 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2690 "cmDependsJavaParser.y"
     {
   jpElementStart(4);
   jpCheckEmpty(4);
@@ -5525,20 +5529,20 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5529 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5533 "cmDependsJavaParser.cxx"
     break;
 
   case 297:
-#line 2699 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2699 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
 
 }
-#line 5538 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5542 "cmDependsJavaParser.cxx"
     break;
 
   case 298:
-#line 2706 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2706 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5546,11 +5550,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5550 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5554 "cmDependsJavaParser.cxx"
     break;
 
   case 299:
-#line 2715 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2715 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5558,11 +5562,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5562 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5566 "cmDependsJavaParser.cxx"
     break;
 
   case 300:
-#line 2724 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2724 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5570,11 +5574,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5574 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5578 "cmDependsJavaParser.cxx"
     break;
 
   case 301:
-#line 2733 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2733 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5582,11 +5586,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5586 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5590 "cmDependsJavaParser.cxx"
     break;
 
   case 302:
-#line 2743 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2743 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5594,11 +5598,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5598 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5602 "cmDependsJavaParser.cxx"
     break;
 
   case 303:
-#line 2752 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2752 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5606,11 +5610,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5610 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5614 "cmDependsJavaParser.cxx"
     break;
 
   case 304:
-#line 2761 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2761 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5618,11 +5622,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5622 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5626 "cmDependsJavaParser.cxx"
     break;
 
   case 305:
-#line 2771 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2771 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5630,11 +5634,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5634 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5638 "cmDependsJavaParser.cxx"
     break;
 
   case 306:
-#line 2780 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2780 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5642,11 +5646,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5646 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5650 "cmDependsJavaParser.cxx"
     break;
 
   case 307:
-#line 2789 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2789 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5654,11 +5658,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5658 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5662 "cmDependsJavaParser.cxx"
     break;
 
   case 308:
-#line 2798 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2798 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5666,11 +5670,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5670 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5674 "cmDependsJavaParser.cxx"
     break;
 
   case 309:
-#line 2808 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2808 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5678,11 +5682,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5682 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5686 "cmDependsJavaParser.cxx"
     break;
 
   case 310:
-#line 2817 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2817 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5690,11 +5694,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5694 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5698 "cmDependsJavaParser.cxx"
     break;
 
   case 311:
-#line 2826 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2826 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5702,11 +5706,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5706 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5710 "cmDependsJavaParser.cxx"
     break;
 
   case 312:
-#line 2835 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2835 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5714,11 +5718,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5718 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5722 "cmDependsJavaParser.cxx"
     break;
 
   case 313:
-#line 2844 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2844 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5726,11 +5730,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5730 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5734 "cmDependsJavaParser.cxx"
     break;
 
   case 314:
-#line 2853 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2853 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5738,11 +5742,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5742 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5746 "cmDependsJavaParser.cxx"
     break;
 
   case 315:
-#line 2863 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2863 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5750,11 +5754,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5754 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5758 "cmDependsJavaParser.cxx"
     break;
 
   case 316:
-#line 2872 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2872 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5762,11 +5766,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5766 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5770 "cmDependsJavaParser.cxx"
     break;
 
   case 317:
-#line 2881 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2881 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5774,11 +5778,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5778 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5782 "cmDependsJavaParser.cxx"
     break;
 
   case 318:
-#line 2891 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2891 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5786,11 +5790,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5790 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5794 "cmDependsJavaParser.cxx"
     break;
 
   case 319:
-#line 2900 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2900 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5798,11 +5802,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5802 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5806 "cmDependsJavaParser.cxx"
     break;
 
   case 320:
-#line 2910 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2910 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5810,11 +5814,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5814 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5818 "cmDependsJavaParser.cxx"
     break;
 
   case 321:
-#line 2919 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2919 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5822,11 +5826,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5826 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5830 "cmDependsJavaParser.cxx"
     break;
 
   case 322:
-#line 2929 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2929 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5834,11 +5838,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5838 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5842 "cmDependsJavaParser.cxx"
     break;
 
   case 323:
-#line 2938 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2938 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5846,11 +5850,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5850 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5854 "cmDependsJavaParser.cxx"
     break;
 
   case 324:
-#line 2948 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2948 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5858,11 +5862,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5862 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5866 "cmDependsJavaParser.cxx"
     break;
 
   case 325:
-#line 2957 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2957 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5870,11 +5874,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5874 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5878 "cmDependsJavaParser.cxx"
     break;
 
   case 326:
-#line 2967 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2967 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5882,11 +5886,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5886 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5890 "cmDependsJavaParser.cxx"
     break;
 
   case 327:
-#line 2976 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2976 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5894,11 +5898,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5898 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5902 "cmDependsJavaParser.cxx"
     break;
 
   case 328:
-#line 2986 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2986 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5906,11 +5910,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5910 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5914 "cmDependsJavaParser.cxx"
     break;
 
   case 329:
-#line 2995 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 2995 "cmDependsJavaParser.y"
     {
   jpElementStart(5);
   jpCheckEmpty(5);
@@ -5918,11 +5922,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5922 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5926 "cmDependsJavaParser.cxx"
     break;
 
   case 330:
-#line 3005 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3005 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5930,11 +5934,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5934 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5938 "cmDependsJavaParser.cxx"
     break;
 
   case 331:
-#line 3014 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3014 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5942,11 +5946,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5946 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5950 "cmDependsJavaParser.cxx"
     break;
 
   case 332:
-#line 3024 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3024 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpCheckEmpty(3);
@@ -5954,11 +5958,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5958 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5962 "cmDependsJavaParser.cxx"
     break;
 
   case 333:
-#line 3034 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3034 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   yyGetParser->DeallocateParserType(&((yyvsp[0].str)));
@@ -5967,11 +5971,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5971 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5975 "cmDependsJavaParser.cxx"
     break;
 
   case 334:
-#line 3044 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3044 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5979,11 +5983,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5983 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5987 "cmDependsJavaParser.cxx"
     break;
 
   case 335:
-#line 3053 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3053 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -5991,11 +5995,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 5995 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 5999 "cmDependsJavaParser.cxx"
     break;
 
   case 336:
-#line 3063 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3063 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6003,11 +6007,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6007 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6011 "cmDependsJavaParser.cxx"
     break;
 
   case 337:
-#line 3072 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3072 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6015,11 +6019,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6019 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6023 "cmDependsJavaParser.cxx"
     break;
 
   case 338:
-#line 3081 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3081 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6027,11 +6031,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6031 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6035 "cmDependsJavaParser.cxx"
     break;
 
   case 339:
-#line 3090 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3090 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6039,11 +6043,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6043 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6047 "cmDependsJavaParser.cxx"
     break;
 
   case 340:
-#line 3099 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3099 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6051,11 +6055,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6055 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6059 "cmDependsJavaParser.cxx"
     break;
 
   case 341:
-#line 3108 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3108 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6063,11 +6067,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6067 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6071 "cmDependsJavaParser.cxx"
     break;
 
   case 342:
-#line 3117 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3117 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6075,11 +6079,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6079 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6083 "cmDependsJavaParser.cxx"
     break;
 
   case 343:
-#line 3126 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3126 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6087,11 +6091,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6091 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6095 "cmDependsJavaParser.cxx"
     break;
 
   case 344:
-#line 3135 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3135 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6099,11 +6103,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6103 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6107 "cmDependsJavaParser.cxx"
     break;
 
   case 345:
-#line 3144 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3144 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6111,11 +6115,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6115 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6119 "cmDependsJavaParser.cxx"
     break;
 
   case 346:
-#line 3153 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3153 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6123,11 +6127,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6127 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6131 "cmDependsJavaParser.cxx"
     break;
 
   case 347:
-#line 3162 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3162 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6135,11 +6139,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6139 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6143 "cmDependsJavaParser.cxx"
     break;
 
   case 348:
-#line 3172 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3172 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6147,11 +6151,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6151 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6155 "cmDependsJavaParser.cxx"
     break;
 
   case 349:
-#line 3182 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3182 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6159,11 +6163,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6163 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6167 "cmDependsJavaParser.cxx"
     break;
 
   case 350:
-#line 3192 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3192 "cmDependsJavaParser.y"
     {
   jpElementStart(1);
   jpCheckEmpty(1);
@@ -6171,11 +6175,11 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6175 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6179 "cmDependsJavaParser.cxx"
     break;
 
   case 351:
-#line 3201 "cmDependsJavaParser.y" /* yacc.c:1652  */
+#line 3201 "cmDependsJavaParser.y"
     {
   jpElementStart(3);
   jpStoreClass((yyvsp[-2].str));
@@ -6184,11 +6188,12 @@
   yyGetParser->SetCurrentCombine("");
 
 }
-#line 6188 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6192 "cmDependsJavaParser.cxx"
     break;
 
 
-#line 6192 "cmDependsJavaParser.cxx" /* yacc.c:1652  */
+#line 6196 "cmDependsJavaParser.cxx"
+
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -6421,7 +6426,7 @@
 #endif
   return yyresult;
 }
-#line 3210 "cmDependsJavaParser.y" /* yacc.c:1918  */
+#line 3210 "cmDependsJavaParser.y"
 
 /* End of grammar */
 
diff --git a/Source/LexerParser/cmDependsJavaParserTokens.h b/Source/LexerParser/cmDependsJavaParserTokens.h
index 6bbc084..e0dfa01 100644
--- a/Source/LexerParser/cmDependsJavaParserTokens.h
+++ b/Source/LexerParser/cmDependsJavaParserTokens.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
diff --git a/Source/LexerParser/cmExprParser.cxx b/Source/LexerParser/cmExprParser.cxx
index 8416e72..562b35b 100644
--- a/Source/LexerParser/cmExprParser.cxx
+++ b/Source/LexerParser/cmExprParser.cxx
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
@@ -48,7 +48,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.3.2"
+#define YYBISON_VERSION "3.4.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -72,7 +72,7 @@
 
 
 /* First part of user prologue.  */
-#line 1 "cmExprParser.y" /* yacc.c:337  */
+#line 1 "cmExprParser.y"
 
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
@@ -116,7 +116,8 @@
 # pragma GCC diagnostic ignored "-Wconversion"
 #endif
 
-#line 120 "cmExprParser.cxx" /* yacc.c:337  */
+#line 120 "cmExprParser.cxx"
+
 # ifndef YY_NULLPTR
 #  if defined __cplusplus
 #   if 201103L <= __cplusplus
@@ -137,8 +138,8 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-/* In a future release of Bison, this section will be replaced
-   by #include "cmExprParserTokens.h".  */
+/* Use api.header.include to #include this header
+   instead of duplicating it here.  */
 #ifndef YY_CMEXPR_YY_CMEXPRPARSERTOKENS_H_INCLUDED
 # define YY_CMEXPR_YY_CMEXPRPARSERTOKENS_H_INCLUDED
 /* Debug traces.  */
@@ -296,6 +297,8 @@
 #endif
 
 
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -688,7 +691,9 @@
   if (yytype < YYNTOKENS)
     YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
 # endif
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
@@ -1126,6 +1131,8 @@
 | yynewstate -- set current state (the top of the stack) to yystate.  |
 `--------------------------------------------------------------------*/
 yysetstate:
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
   *yyssp = (yytype_int16) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
@@ -1188,8 +1195,6 @@
     }
 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
   if (yystate == YYFINAL)
     YYACCEPT;
 
@@ -1257,7 +1262,6 @@
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
   YY_IGNORE_MAYBE_UNINITIALIZED_END
-
   goto yynewstate;
 
 
@@ -1292,195 +1296,196 @@
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 2:
-#line 77 "cmExprParser.y" /* yacc.c:1652  */
+  case 2:
+#line 77 "cmExprParser.y"
     {
     cmExpr_yyget_extra(yyscanner)->SetResult((yyvsp[0].Number));
   }
-#line 1301 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1305 "cmExprParser.cxx"
     break;
 
   case 3:
-#line 82 "cmExprParser.y" /* yacc.c:1652  */
+#line 82 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1309 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1313 "cmExprParser.cxx"
     break;
 
   case 4:
-#line 85 "cmExprParser.y" /* yacc.c:1652  */
+#line 85 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) | (yyvsp[0].Number);
   }
-#line 1317 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1321 "cmExprParser.cxx"
     break;
 
   case 5:
-#line 90 "cmExprParser.y" /* yacc.c:1652  */
+#line 90 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1325 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1329 "cmExprParser.cxx"
     break;
 
   case 6:
-#line 93 "cmExprParser.y" /* yacc.c:1652  */
+#line 93 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) ^ (yyvsp[0].Number);
   }
-#line 1333 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1337 "cmExprParser.cxx"
     break;
 
   case 7:
-#line 98 "cmExprParser.y" /* yacc.c:1652  */
+#line 98 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1341 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1345 "cmExprParser.cxx"
     break;
 
   case 8:
-#line 101 "cmExprParser.y" /* yacc.c:1652  */
+#line 101 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) & (yyvsp[0].Number);
   }
-#line 1349 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1353 "cmExprParser.cxx"
     break;
 
   case 9:
-#line 106 "cmExprParser.y" /* yacc.c:1652  */
+#line 106 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1357 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1361 "cmExprParser.cxx"
     break;
 
   case 10:
-#line 109 "cmExprParser.y" /* yacc.c:1652  */
+#line 109 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) << (yyvsp[0].Number);
   }
-#line 1365 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1369 "cmExprParser.cxx"
     break;
 
   case 11:
-#line 112 "cmExprParser.y" /* yacc.c:1652  */
+#line 112 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) >> (yyvsp[0].Number);
   }
-#line 1373 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1377 "cmExprParser.cxx"
     break;
 
   case 12:
-#line 117 "cmExprParser.y" /* yacc.c:1652  */
+#line 117 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1381 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1385 "cmExprParser.cxx"
     break;
 
   case 13:
-#line 120 "cmExprParser.y" /* yacc.c:1652  */
+#line 120 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) + (yyvsp[0].Number);
   }
-#line 1389 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1393 "cmExprParser.cxx"
     break;
 
   case 14:
-#line 123 "cmExprParser.y" /* yacc.c:1652  */
+#line 123 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) - (yyvsp[0].Number);
   }
-#line 1397 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1401 "cmExprParser.cxx"
     break;
 
   case 15:
-#line 128 "cmExprParser.y" /* yacc.c:1652  */
+#line 128 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1405 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1409 "cmExprParser.cxx"
     break;
 
   case 16:
-#line 131 "cmExprParser.y" /* yacc.c:1652  */
+#line 131 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) * (yyvsp[0].Number);
   }
-#line 1413 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1417 "cmExprParser.cxx"
     break;
 
   case 17:
-#line 134 "cmExprParser.y" /* yacc.c:1652  */
+#line 134 "cmExprParser.y"
     {
     if (yyvsp[0].Number == 0) {
       throw std::overflow_error("divide by zero");
     }
     (yyval.Number) = (yyvsp[-2].Number) / (yyvsp[0].Number);
   }
-#line 1424 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1428 "cmExprParser.cxx"
     break;
 
   case 18:
-#line 140 "cmExprParser.y" /* yacc.c:1652  */
+#line 140 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-2].Number) % (yyvsp[0].Number);
   }
-#line 1432 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1436 "cmExprParser.cxx"
     break;
 
   case 19:
-#line 145 "cmExprParser.y" /* yacc.c:1652  */
+#line 145 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1440 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1444 "cmExprParser.cxx"
     break;
 
   case 20:
-#line 148 "cmExprParser.y" /* yacc.c:1652  */
+#line 148 "cmExprParser.y"
     {
     (yyval.Number) = + (yyvsp[0].Number);
   }
-#line 1448 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1452 "cmExprParser.cxx"
     break;
 
   case 21:
-#line 151 "cmExprParser.y" /* yacc.c:1652  */
+#line 151 "cmExprParser.y"
     {
     (yyval.Number) = - (yyvsp[0].Number);
   }
-#line 1456 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1460 "cmExprParser.cxx"
     break;
 
   case 22:
-#line 154 "cmExprParser.y" /* yacc.c:1652  */
+#line 154 "cmExprParser.y"
     {
     (yyval.Number) = ~ (yyvsp[0].Number);
   }
-#line 1464 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1468 "cmExprParser.cxx"
     break;
 
   case 23:
-#line 159 "cmExprParser.y" /* yacc.c:1652  */
+#line 159 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[0].Number);
   }
-#line 1472 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1476 "cmExprParser.cxx"
     break;
 
   case 24:
-#line 162 "cmExprParser.y" /* yacc.c:1652  */
+#line 162 "cmExprParser.y"
     {
     (yyval.Number) = (yyvsp[-1].Number);
   }
-#line 1480 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1484 "cmExprParser.cxx"
     break;
 
 
-#line 1484 "cmExprParser.cxx" /* yacc.c:1652  */
+#line 1488 "cmExprParser.cxx"
+
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1713,7 +1718,7 @@
 #endif
   return yyresult;
 }
-#line 167 "cmExprParser.y" /* yacc.c:1918  */
+#line 167 "cmExprParser.y"
 
 /* End of grammar */
 
diff --git a/Source/LexerParser/cmExprParserTokens.h b/Source/LexerParser/cmExprParserTokens.h
index 5ffd7c5..e30a832 100644
--- a/Source/LexerParser/cmExprParserTokens.h
+++ b/Source/LexerParser/cmExprParserTokens.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
diff --git a/Source/LexerParser/cmFortranParser.cxx b/Source/LexerParser/cmFortranParser.cxx
index 2ca7927..2494aad 100644
--- a/Source/LexerParser/cmFortranParser.cxx
+++ b/Source/LexerParser/cmFortranParser.cxx
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
@@ -48,7 +48,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.3.2"
+#define YYBISON_VERSION "3.4.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -72,7 +72,7 @@
 
 
 /* First part of user prologue.  */
-#line 1 "cmFortranParser.y" /* yacc.c:337  */
+#line 1 "cmFortranParser.y"
 
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
@@ -135,7 +135,8 @@
 # pragma GCC diagnostic ignored "-Wconversion"
 #endif
 
-#line 139 "cmFortranParser.cxx" /* yacc.c:337  */
+#line 139 "cmFortranParser.cxx"
+
 # ifndef YY_NULLPTR
 #  if defined __cplusplus
 #   if 201103L <= __cplusplus
@@ -156,8 +157,8 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-/* In a future release of Bison, this section will be replaced
-   by #include "cmFortranParserTokens.h".  */
+/* Use api.header.include to #include this header
+   instead of duplicating it here.  */
 #ifndef YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
 # define YY_CMFORTRAN_YY_CMFORTRANPARSERTOKENS_H_INCLUDED
 /* Debug traces.  */
@@ -255,16 +256,15 @@
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
 union YYSTYPE
 {
-#line 73 "cmFortranParser.y" /* yacc.c:352  */
+#line 73 "cmFortranParser.y"
 
   char* string;
 
-#line 266 "cmFortranParser.cxx" /* yacc.c:352  */
-};
+#line 266 "cmFortranParser.cxx"
 
+};
 typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
@@ -378,6 +378,8 @@
 #endif
 
 
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -509,16 +511,16 @@
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  2
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   593
+#define YYLAST   594
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  41
 /* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  14
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  63
+#define YYNRULES  64
 /* YYNSTATES -- Number of states.  */
-#define YYNSTATES  126
+#define YYNSTATES  127
 
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   295
@@ -574,7 +576,7 @@
      220,   220,   221,   221,   222,   222,   223,   223,   224,   224,
      225,   225,   226,   226,   227,   227,   228,   228,   231,   232,
      233,   234,   235,   236,   237,   238,   239,   240,   241,   242,
-     243,   244,   245,   246
+     243,   244,   245,   246,   247
 };
 #endif
 
@@ -626,16 +628,16 @@
      -39,    21,   -39,     1,   -39,   -20,   -39,   -39,   -39,   -39,
      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,
      -39,   -39,   -39,   -39,   -39,   -39,   -24,   -18,    20,    -8,
-      -3,    39,   -39,    15,    16,    18,    19,    33,   -39,   -39,
+      -3,    40,   -39,    15,    16,    17,    19,    34,   -39,   -39,
      -39,   -39,   -39,   -39,    59,   -39,   -39,   -39,   -39,   -39,
-      35,    36,    37,   -39,   -39,   -39,   -39,   -39,   -39,    76,
-     114,   129,   167,   182,   -39,   -39,   -39,   -39,   -39,   -39,
+      36,    37,    38,   -39,   -39,   -39,   -39,   -39,   -39,    77,
+     115,   130,   168,   183,   -39,   -39,   -39,   -39,   -39,   -39,
      -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,   -39,
-     -39,   -39,   220,   235,   273,   288,   -21,    26,   -39,   326,
-     341,   379,   394,   432,   447,   -39,   -39,   -39,   -39,   -39,
-     -39,   -39,   -39,   -39,    38,    40,    41,   485,   -39,   -39,
-     -39,   -39,   -39,   -39,    45,   -39,   -39,   -39,    43,   500,
-     538,   -39,   -39,   -39,   553,   -39
+     -39,   -39,   -39,   221,   236,   274,   289,   -21,    26,   -39,
+     327,   342,   380,   395,   433,   448,   -39,   -39,   -39,   -39,
+     -39,   -39,   -39,   -39,   -39,    39,    41,    42,   486,   -39,
+     -39,   -39,   -39,   -39,   -39,    18,   -39,   -39,   -39,    43,
+     501,   539,   -39,   -39,   -39,   554,   -39
 };
 
   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -649,13 +651,13 @@
        0,     0,     3,     0,     0,     0,     0,     0,    46,    46,
       46,    46,    26,    46,     0,    46,    46,     4,    46,    46,
        0,     0,     0,    46,    46,    46,    46,    46,    46,     0,
-       0,     0,     0,     0,    15,    57,    56,    62,    58,    59,
-      60,    61,    63,    55,    48,    49,    50,    51,    52,    53,
-      54,    47,     0,     0,     0,     0,     0,     0,    46,     0,
-       0,     0,     0,     0,     0,    21,    22,    23,    24,    14,
-      10,    13,     9,     6,     0,     0,     0,     0,     5,    16,
-      17,    18,    19,    20,     0,    46,    46,    11,     0,     0,
-       0,    46,     7,    12,     0,     8
+       0,     0,     0,     0,    15,    57,    56,    64,    62,    58,
+      59,    60,    61,    63,    55,    48,    49,    50,    51,    52,
+      53,    54,    47,     0,     0,     0,     0,     0,     0,    46,
+       0,     0,     0,     0,     0,     0,    21,    22,    23,    24,
+      14,    10,    13,     9,     6,     0,     0,     0,     0,     5,
+      16,    17,    18,    19,    20,     0,    46,    46,    11,     0,
+       0,     0,    46,     7,    12,     0,     8
 };
 
   /* YYPGOTO[NTERM-NUM].  */
@@ -669,7 +671,7 @@
 static const yytype_int8 yydefgoto[] =
 {
       -1,     1,    32,    33,    34,    35,    36,    37,    38,    39,
-      40,    41,    44,    81
+      40,    41,    44,    82
 };
 
   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
@@ -677,66 +679,66 @@
      number is the opposite.  If YYTABLE_NINF, syntax error.  */
 static const yytype_uint8 yytable[] =
 {
-      59,    60,    61,    62,    42,    63,   104,    82,    83,   105,
-      84,    85,    43,    45,    46,    89,    90,    91,    92,    93,
-      94,     2,     3,    47,     4,    49,    50,     5,     6,     7,
+      59,    60,    61,    62,    42,    63,   105,    83,    84,   106,
+      85,    86,    43,    45,    46,    90,    91,    92,    93,    94,
+      95,     2,     3,    47,     4,    49,    50,     5,     6,     7,
        8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
-      18,    19,    20,    21,    22,    23,    24,    54,     0,    55,
-     107,    56,    57,    48,   106,    25,    26,    27,    28,    29,
-      30,    31,    64,    65,    66,    51,    58,    52,    86,    87,
-      88,   114,    53,   115,   116,   118,   121,   119,   120,    95,
-      65,    66,     0,   124,     0,    67,    68,    69,    70,    71,
-      72,    73,    74,     0,    75,    76,    77,    78,    79,    80,
-       0,     0,    67,    68,    69,    70,    71,    72,    73,    74,
-       0,    75,    76,    77,    78,    79,    80,    96,    65,    66,
+      18,    19,    20,    21,    22,    23,    24,    54,   119,    55,
+      56,   108,    57,    48,   107,    25,    26,    27,    28,    29,
+      30,    31,    64,    65,    66,    67,    51,    58,    52,    87,
+      88,    89,   115,    53,   116,   117,   122,     0,   120,   121,
+      96,    65,    66,    67,   125,    68,    69,    70,    71,    72,
+      73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
+       0,     0,     0,    68,    69,    70,    71,    72,    73,    74,
+      75,     0,    76,    77,    78,    79,    80,    81,    97,    65,
+      66,    67,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,    98,    65,    66,    67,     0,     0,     0,
+       0,    68,    69,    70,    71,    72,    73,    74,    75,     0,
+      76,    77,    78,    79,    80,    81,    68,    69,    70,    71,
+      72,    73,    74,    75,     0,    76,    77,    78,    79,    80,
+      81,    99,    65,    66,    67,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,   100,    65,    66,    67,
+       0,     0,     0,     0,    68,    69,    70,    71,    72,    73,
+      74,    75,     0,    76,    77,    78,    79,    80,    81,    68,
+      69,    70,    71,    72,    73,    74,    75,     0,    76,    77,
+      78,    79,    80,    81,   101,    65,    66,    67,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   102,
+      65,    66,    67,     0,     0,     0,     0,    68,    69,    70,
+      71,    72,    73,    74,    75,     0,    76,    77,    78,    79,
+      80,    81,    68,    69,    70,    71,    72,    73,    74,    75,
+       0,    76,    77,    78,    79,    80,    81,   103,    65,    66,
+      67,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,   104,    65,    66,    67,     0,     0,     0,     0,
+      68,    69,    70,    71,    72,    73,    74,    75,     0,    76,
+      77,    78,    79,    80,    81,    68,    69,    70,    71,    72,
+      73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
+     109,    65,    66,    67,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   110,    65,    66,    67,     0,
+       0,     0,     0,    68,    69,    70,    71,    72,    73,    74,
+      75,     0,    76,    77,    78,    79,    80,    81,    68,    69,
+      70,    71,    72,    73,    74,    75,     0,    76,    77,    78,
+      79,    80,    81,   111,    65,    66,    67,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   112,    65,
+      66,    67,     0,     0,     0,     0,    68,    69,    70,    71,
+      72,    73,    74,    75,     0,    76,    77,    78,    79,    80,
+      81,    68,    69,    70,    71,    72,    73,    74,    75,     0,
+      76,    77,    78,    79,    80,    81,   113,    65,    66,    67,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,    97,    65,    66,     0,     0,     0,     0,     0,
-      67,    68,    69,    70,    71,    72,    73,    74,     0,    75,
-      76,    77,    78,    79,    80,    67,    68,    69,    70,    71,
-      72,    73,    74,     0,    75,    76,    77,    78,    79,    80,
-      98,    65,    66,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,    99,    65,    66,     0,     0,
-       0,     0,     0,    67,    68,    69,    70,    71,    72,    73,
-      74,     0,    75,    76,    77,    78,    79,    80,    67,    68,
-      69,    70,    71,    72,    73,    74,     0,    75,    76,    77,
-      78,    79,    80,   100,    65,    66,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,   101,    65,
-      66,     0,     0,     0,     0,     0,    67,    68,    69,    70,
-      71,    72,    73,    74,     0,    75,    76,    77,    78,    79,
-      80,    67,    68,    69,    70,    71,    72,    73,    74,     0,
-      75,    76,    77,    78,    79,    80,   102,    65,    66,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,   103,    65,    66,     0,     0,     0,     0,     0,    67,
-      68,    69,    70,    71,    72,    73,    74,     0,    75,    76,
-      77,    78,    79,    80,    67,    68,    69,    70,    71,    72,
-      73,    74,     0,    75,    76,    77,    78,    79,    80,   108,
-      65,    66,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,   109,    65,    66,     0,     0,     0,
-       0,     0,    67,    68,    69,    70,    71,    72,    73,    74,
-       0,    75,    76,    77,    78,    79,    80,    67,    68,    69,
-      70,    71,    72,    73,    74,     0,    75,    76,    77,    78,
-      79,    80,   110,    65,    66,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,   111,    65,    66,
-       0,     0,     0,     0,     0,    67,    68,    69,    70,    71,
-      72,    73,    74,     0,    75,    76,    77,    78,    79,    80,
-      67,    68,    69,    70,    71,    72,    73,    74,     0,    75,
-      76,    77,    78,    79,    80,   112,    65,    66,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     113,    65,    66,     0,     0,     0,     0,     0,    67,    68,
-      69,    70,    71,    72,    73,    74,     0,    75,    76,    77,
-      78,    79,    80,    67,    68,    69,    70,    71,    72,    73,
-      74,     0,    75,    76,    77,    78,    79,    80,   117,    65,
-      66,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   122,    65,    66,     0,     0,     0,     0,
-       0,    67,    68,    69,    70,    71,    72,    73,    74,     0,
-      75,    76,    77,    78,    79,    80,    67,    68,    69,    70,
-      71,    72,    73,    74,     0,    75,    76,    77,    78,    79,
-      80,   123,    65,    66,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,   125,    65,    66,     0,
-       0,     0,     0,     0,    67,    68,    69,    70,    71,    72,
-      73,    74,     0,    75,    76,    77,    78,    79,    80,    67,
-      68,    69,    70,    71,    72,    73,    74,     0,    75,    76,
-      77,    78,    79,    80
+       0,   114,    65,    66,    67,     0,     0,     0,     0,    68,
+      69,    70,    71,    72,    73,    74,    75,     0,    76,    77,
+      78,    79,    80,    81,    68,    69,    70,    71,    72,    73,
+      74,    75,     0,    76,    77,    78,    79,    80,    81,   118,
+      65,    66,    67,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   123,    65,    66,    67,     0,     0,
+       0,     0,    68,    69,    70,    71,    72,    73,    74,    75,
+       0,    76,    77,    78,    79,    80,    81,    68,    69,    70,
+      71,    72,    73,    74,    75,     0,    76,    77,    78,    79,
+      80,    81,   124,    65,    66,    67,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,   126,    65,    66,
+      67,     0,     0,     0,     0,    68,    69,    70,    71,    72,
+      73,    74,    75,     0,    76,    77,    78,    79,    80,    81,
+      68,    69,    70,    71,    72,    73,    74,    75,     0,    76,
+      77,    78,    79,    80,    81
 };
 
 static const yytype_int8 yycheck[] =
@@ -745,62 +747,62 @@
       48,    49,    32,    37,    32,    53,    54,    55,    56,    57,
       58,     0,     1,     3,     3,    33,    29,     6,     7,     8,
        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
-      19,    20,    21,    22,    23,    24,    25,    32,    -1,    33,
-      88,    33,    33,    33,    28,    34,    35,    36,    37,    38,
-      39,    40,     3,     4,     5,    26,    33,    28,    33,    33,
-      33,    33,    33,    33,    33,    30,    33,   115,   116,     3,
-       4,     5,    -1,   121,    -1,    26,    27,    28,    29,    30,
+      19,    20,    21,    22,    23,    24,    25,    32,    30,    33,
+      33,    89,    33,    33,    28,    34,    35,    36,    37,    38,
+      39,    40,     3,     4,     5,     6,    26,    33,    28,    33,
+      33,    33,    33,    33,    33,    33,    33,    -1,   116,   117,
+       3,     4,     5,     6,   122,    26,    27,    28,    29,    30,
       31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
-      -1,    -1,    26,    27,    28,    29,    30,    31,    32,    33,
-      -1,    35,    36,    37,    38,    39,    40,     3,     4,     5,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,     3,     4,     5,    -1,    -1,    -1,    -1,    -1,
-      26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
-      36,    37,    38,    39,    40,    26,    27,    28,    29,    30,
-      31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
-       3,     4,     5,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,     3,     4,     5,    -1,    -1,
       -1,    -1,    -1,    26,    27,    28,    29,    30,    31,    32,
-      33,    -1,    35,    36,    37,    38,    39,    40,    26,    27,
-      28,    29,    30,    31,    32,    33,    -1,    35,    36,    37,
-      38,    39,    40,     3,     4,     5,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
-       5,    -1,    -1,    -1,    -1,    -1,    26,    27,    28,    29,
-      30,    31,    32,    33,    -1,    35,    36,    37,    38,    39,
-      40,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
-      35,    36,    37,    38,    39,    40,     3,     4,     5,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,     3,     4,     5,    -1,    -1,    -1,    -1,    -1,    26,
-      27,    28,    29,    30,    31,    32,    33,    -1,    35,    36,
-      37,    38,    39,    40,    26,    27,    28,    29,    30,    31,
-      32,    33,    -1,    35,    36,    37,    38,    39,    40,     3,
-       4,     5,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,     3,     4,     5,    -1,    -1,    -1,
-      -1,    -1,    26,    27,    28,    29,    30,    31,    32,    33,
-      -1,    35,    36,    37,    38,    39,    40,    26,    27,    28,
-      29,    30,    31,    32,    33,    -1,    35,    36,    37,    38,
-      39,    40,     3,     4,     5,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,
-      -1,    -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,
-      31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
-      26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
-      36,    37,    38,    39,    40,     3,     4,     5,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-       3,     4,     5,    -1,    -1,    -1,    -1,    -1,    26,    27,
-      28,    29,    30,    31,    32,    33,    -1,    35,    36,    37,
-      38,    39,    40,    26,    27,    28,    29,    30,    31,    32,
       33,    -1,    35,    36,    37,    38,    39,    40,     3,     4,
-       5,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,     3,     4,     5,    -1,    -1,    -1,    -1,
+       5,     6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,     3,     4,     5,     6,    -1,    -1,    -1,
       -1,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
       35,    36,    37,    38,    39,    40,    26,    27,    28,    29,
       30,    31,    32,    33,    -1,    35,    36,    37,    38,    39,
-      40,     3,     4,     5,    -1,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,    -1,
+      40,     3,     4,     5,     6,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,
       -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,    31,
       32,    33,    -1,    35,    36,    37,    38,    39,    40,    26,
       27,    28,    29,    30,    31,    32,    33,    -1,    35,    36,
-      37,    38,    39,    40
+      37,    38,    39,    40,     3,     4,     5,     6,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,
+       4,     5,     6,    -1,    -1,    -1,    -1,    26,    27,    28,
+      29,    30,    31,    32,    33,    -1,    35,    36,    37,    38,
+      39,    40,    26,    27,    28,    29,    30,    31,    32,    33,
+      -1,    35,    36,    37,    38,    39,    40,     3,     4,     5,
+       6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,     3,     4,     5,     6,    -1,    -1,    -1,    -1,
+      26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
+      36,    37,    38,    39,    40,    26,    27,    28,    29,    30,
+      31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
+       3,     4,     5,     6,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,
+      -1,    -1,    -1,    26,    27,    28,    29,    30,    31,    32,
+      33,    -1,    35,    36,    37,    38,    39,    40,    26,    27,
+      28,    29,    30,    31,    32,    33,    -1,    35,    36,    37,
+      38,    39,    40,     3,     4,     5,     6,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,
+       5,     6,    -1,    -1,    -1,    -1,    26,    27,    28,    29,
+      30,    31,    32,    33,    -1,    35,    36,    37,    38,    39,
+      40,    26,    27,    28,    29,    30,    31,    32,    33,    -1,
+      35,    36,    37,    38,    39,    40,     3,     4,     5,     6,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,     3,     4,     5,     6,    -1,    -1,    -1,    -1,    26,
+      27,    28,    29,    30,    31,    32,    33,    -1,    35,    36,
+      37,    38,    39,    40,    26,    27,    28,    29,    30,    31,
+      32,    33,    -1,    35,    36,    37,    38,    39,    40,     3,
+       4,     5,     6,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,     3,     4,     5,     6,    -1,    -1,
+      -1,    -1,    26,    27,    28,    29,    30,    31,    32,    33,
+      -1,    35,    36,    37,    38,    39,    40,    26,    27,    28,
+      29,    30,    31,    32,    33,    -1,    35,    36,    37,    38,
+      39,    40,     3,     4,     5,     6,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,     3,     4,     5,
+       6,    -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,
+      31,    32,    33,    -1,    35,    36,    37,    38,    39,    40,
+      26,    27,    28,    29,    30,    31,    32,    33,    -1,    35,
+      36,    37,    38,    39,    40
 };
 
   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -813,13 +815,13 @@
       39,    40,    43,    44,    45,    46,    47,    48,    49,    50,
       51,    52,     3,    32,    53,    37,    32,     3,    33,    33,
       29,    26,    28,    33,    32,    33,    33,    33,    33,    53,
-      53,    53,    53,    53,     3,     4,     5,    26,    27,    28,
-      29,    30,    31,    32,    33,    35,    36,    37,    38,    39,
-      40,    54,    53,    53,    53,    53,    33,    33,    33,    53,
-      53,    53,    53,    53,    53,     3,     3,     3,     3,     3,
-       3,     3,     3,     3,    27,    30,    28,    53,     3,     3,
-       3,     3,     3,     3,    33,    33,    33,     3,    30,    53,
-      53,    33,     3,     3,    53,     3
+      53,    53,    53,    53,     3,     4,     5,     6,    26,    27,
+      28,    29,    30,    31,    32,    33,    35,    36,    37,    38,
+      39,    40,    54,    53,    53,    53,    53,    33,    33,    33,
+      53,    53,    53,    53,    53,    53,     3,     3,     3,     3,
+       3,     3,     3,     3,     3,    27,    30,    28,    53,     3,
+       3,     3,     3,     3,     3,    33,    33,    33,     3,    30,
+      53,    53,    33,     3,     3,    53,     3
 };
 
   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
@@ -831,7 +833,7 @@
       45,    45,    46,    46,    47,    47,    48,    48,    49,    49,
       50,    50,    51,    51,    52,    52,    53,    53,    54,    54,
       54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
-      54,    54,    54,    54
+      54,    54,    54,    54,    54
 };
 
   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
@@ -843,7 +845,7 @@
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     0,     2,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1
+       1,     1,     1,     1,     1
 };
 
 
@@ -930,7 +932,9 @@
   if (yytype < YYNTOKENS)
     YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
 # endif
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
@@ -1368,6 +1372,8 @@
 | yynewstate -- set current state (the top of the stack) to yystate.  |
 `--------------------------------------------------------------------*/
 yysetstate:
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
   *yyssp = (yytype_int16) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
@@ -1430,8 +1436,6 @@
     }
 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
   if (yystate == YYFINAL)
     YYACCEPT;
 
@@ -1499,7 +1503,6 @@
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
   YY_IGNORE_MAYBE_UNINITIALIZED_END
-
   goto yynewstate;
 
 
@@ -1534,27 +1537,27 @@
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 4:
-#line 104 "cmFortranParser.y" /* yacc.c:1652  */
+  case 4:
+#line 104 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_SetInInterface(parser, true);
   }
-#line 1544 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1547 "cmFortranParser.cxx"
     break;
 
   case 5:
-#line 108 "cmFortranParser.y" /* yacc.c:1652  */
+#line 108 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1554 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1557 "cmFortranParser.cxx"
     break;
 
   case 6:
-#line 113 "cmFortranParser.y" /* yacc.c:1652  */
+#line 113 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     if (cmsysString_strcasecmp((yyvsp[-2].string), "function") != 0 &&
@@ -1564,22 +1567,22 @@
     }
     free((yyvsp[-2].string));
   }
-#line 1568 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1571 "cmFortranParser.cxx"
     break;
 
   case 7:
-#line 122 "cmFortranParser.y" /* yacc.c:1652  */
+#line 122 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleSubmodule(parser, (yyvsp[-4].string), (yyvsp[-2].string));
     free((yyvsp[-4].string));
     free((yyvsp[-2].string));
   }
-#line 1579 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1582 "cmFortranParser.cxx"
     break;
 
   case 8:
-#line 128 "cmFortranParser.y" /* yacc.c:1652  */
+#line 128 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleSubmoduleNested(parser, (yyvsp[-6].string), (yyvsp[-4].string), (yyvsp[-2].string));
@@ -1587,40 +1590,40 @@
     free((yyvsp[-4].string));
     free((yyvsp[-2].string));
   }
-#line 1591 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1594 "cmFortranParser.cxx"
     break;
 
   case 9:
-#line 135 "cmFortranParser.y" /* yacc.c:1652  */
+#line 135 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_SetInInterface(parser, true);
     free((yyvsp[-2].string));
   }
-#line 1601 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1604 "cmFortranParser.cxx"
     break;
 
   case 10:
-#line 140 "cmFortranParser.y" /* yacc.c:1652  */
+#line 140 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_SetInInterface(parser, false);
   }
-#line 1610 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1613 "cmFortranParser.cxx"
     break;
 
   case 11:
-#line 144 "cmFortranParser.y" /* yacc.c:1652  */
+#line 144 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1620 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1623 "cmFortranParser.cxx"
     break;
 
   case 12:
-#line 149 "cmFortranParser.y" /* yacc.c:1652  */
+#line 149 "cmFortranParser.y"
     {
     if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) {
       cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
@@ -1629,139 +1632,140 @@
     free((yyvsp[-4].string));
     free((yyvsp[-2].string));
   }
-#line 1633 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1636 "cmFortranParser.cxx"
     break;
 
   case 13:
-#line 157 "cmFortranParser.y" /* yacc.c:1652  */
+#line 157 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1643 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1646 "cmFortranParser.cxx"
     break;
 
   case 14:
-#line 162 "cmFortranParser.y" /* yacc.c:1652  */
+#line 162 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1653 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1656 "cmFortranParser.cxx"
     break;
 
   case 15:
-#line 167 "cmFortranParser.y" /* yacc.c:1652  */
+#line 167 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1663 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1666 "cmFortranParser.cxx"
     break;
 
   case 16:
-#line 172 "cmFortranParser.y" /* yacc.c:1652  */
+#line 172 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1673 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1676 "cmFortranParser.cxx"
     break;
 
   case 17:
-#line 177 "cmFortranParser.y" /* yacc.c:1652  */
+#line 177 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleDefine(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1683 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1686 "cmFortranParser.cxx"
     break;
 
   case 18:
-#line 182 "cmFortranParser.y" /* yacc.c:1652  */
+#line 182 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleUndef(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1693 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1696 "cmFortranParser.cxx"
     break;
 
   case 19:
-#line 187 "cmFortranParser.y" /* yacc.c:1652  */
+#line 187 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1703 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1706 "cmFortranParser.cxx"
     break;
 
   case 20:
-#line 192 "cmFortranParser.y" /* yacc.c:1652  */
+#line 192 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string));
     free((yyvsp[-2].string));
   }
-#line 1713 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1716 "cmFortranParser.cxx"
     break;
 
   case 21:
-#line 197 "cmFortranParser.y" /* yacc.c:1652  */
+#line 197 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleIf(parser);
   }
-#line 1722 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1725 "cmFortranParser.cxx"
     break;
 
   case 22:
-#line 201 "cmFortranParser.y" /* yacc.c:1652  */
+#line 201 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleElif(parser);
   }
-#line 1731 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1734 "cmFortranParser.cxx"
     break;
 
   case 23:
-#line 205 "cmFortranParser.y" /* yacc.c:1652  */
+#line 205 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleElse(parser);
   }
-#line 1740 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1743 "cmFortranParser.cxx"
     break;
 
   case 24:
-#line 209 "cmFortranParser.y" /* yacc.c:1652  */
+#line 209 "cmFortranParser.y"
     {
     cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
     cmFortranParser_RuleEndif(parser);
   }
-#line 1749 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1752 "cmFortranParser.cxx"
     break;
 
   case 48:
-#line 231 "cmFortranParser.y" /* yacc.c:1652  */
+#line 231 "cmFortranParser.y"
     { free ((yyvsp[0].string)); }
-#line 1755 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1758 "cmFortranParser.cxx"
     break;
 
   case 55:
-#line 238 "cmFortranParser.y" /* yacc.c:1652  */
+#line 238 "cmFortranParser.y"
     { free ((yyvsp[0].string)); }
-#line 1761 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1764 "cmFortranParser.cxx"
     break;
 
 
-#line 1765 "cmFortranParser.cxx" /* yacc.c:1652  */
+#line 1768 "cmFortranParser.cxx"
+
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1994,6 +1998,6 @@
 #endif
   return yyresult;
 }
-#line 249 "cmFortranParser.y" /* yacc.c:1918  */
+#line 250 "cmFortranParser.y"
 
 /* End of grammar */
diff --git a/Source/LexerParser/cmFortranParser.y b/Source/LexerParser/cmFortranParser.y
index 87f3e0a..1b54dd9 100644
--- a/Source/LexerParser/cmFortranParser.y
+++ b/Source/LexerParser/cmFortranParser.y
@@ -244,6 +244,7 @@
 | RPAREN
 | COMMA
 | UNTERMINATED_STRING
+| CPP_LINE_DIRECTIVE
 ;
 
 %%
diff --git a/Source/LexerParser/cmFortranParserTokens.h b/Source/LexerParser/cmFortranParserTokens.h
index 0da4c1c..f66a15c 100644
--- a/Source/LexerParser/cmFortranParserTokens.h
+++ b/Source/LexerParser/cmFortranParserTokens.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.3.2.  */
+/* A Bison parser, made by GNU Bison 3.4.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
@@ -131,16 +131,15 @@
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
 union YYSTYPE
 {
-#line 73 "cmFortranParser.y" /* yacc.c:1921  */
+#line 73 "cmFortranParser.y"
 
   char* string;
 
-#line 142 "cmFortranParserTokens.h" /* yacc.c:1921  */
-};
+#line 141 "cmFortranParserTokens.h"
 
+};
 typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index cb89d19..98dd0e2 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -178,6 +178,10 @@
   target_sources(cmake-gui PRIVATE $<TARGET_OBJECTS:CMakeVersion>)
 endif()
 
+if(CMake_JOB_POOL_LINK_BIN)
+  set_property(TARGET cmake-gui PROPERTY JOB_POOL_LINK "link-bin")
+endif()
+
 # cmake-gui has not been updated for `include-what-you-use`.
 # Block the tool until this is done.
 set_target_properties(cmake-gui PROPERTIES
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index b85cc33..0b2750d 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -64,32 +64,36 @@
  */
 #include "bindexplib.h"
 
-#include <iostream>
+#include <cstddef>
 #include <sstream>
 #include <vector>
 
-#include <windows.h>
+#ifdef _WIN32
+#  include <windows.h>
 
-#include "cmsys/Encoding.hxx"
+#  include "cmsys/Encoding.hxx"
+#endif
+
 #include "cmsys/FStream.hxx"
 
 #include "cmSystemTools.h"
 
-#ifndef IMAGE_FILE_MACHINE_ARM
-#  define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian
-#endif
+#ifdef _WIN32
+#  ifndef IMAGE_FILE_MACHINE_ARM
+#    define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian
+#  endif
 
-#ifndef IMAGE_FILE_MACHINE_THUMB
-#  define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian
-#endif
+#  ifndef IMAGE_FILE_MACHINE_THUMB
+#    define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian
+#  endif
 
-#ifndef IMAGE_FILE_MACHINE_ARMNT
-#  define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian
-#endif
+#  ifndef IMAGE_FILE_MACHINE_ARMNT
+#    define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian
+#  endif
 
-#ifndef IMAGE_FILE_MACHINE_ARM64
-#  define IMAGE_FILE_MACHINE_ARM64 0xaa64 // ARM64 Little-Endian
-#endif
+#  ifndef IMAGE_FILE_MACHINE_ARM64
+#    define IMAGE_FILE_MACHINE_ARM64 0xaa64 // ARM64 Little-Endian
+#  endif
 
 typedef struct cmANON_OBJECT_HEADER_BIGOBJ
 {
@@ -306,6 +310,7 @@
   SymbolTableType* SymbolTable;
   bool IsI386;
 };
+#endif
 
 bool DumpFileWithLlvmNm(std::string const& nmPath, const char* filename,
                         std::set<std::string>& symbols,
@@ -315,15 +320,15 @@
   // break up command line into a vector
   std::vector<std::string> command;
   command.push_back(nmPath);
-  command.push_back("--no-weak");
-  command.push_back("--defined-only");
-  command.push_back("--format=posix");
-  command.push_back(filename);
+  command.emplace_back("--no-weak");
+  command.emplace_back("--defined-only");
+  command.emplace_back("--format=posix");
+  command.emplace_back(filename);
 
   // run the command
   int exit_code = 0;
-  cmSystemTools::RunSingleCommand(command, &output, &output, &exit_code, "",
-                                  cmSystemTools::OUTPUT_NONE);
+  cmSystemTools::RunSingleCommand(command, &output, &output, &exit_code,
+                                  nullptr, cmSystemTools::OUTPUT_NONE);
 
   if (exit_code != 0) {
     fprintf(stderr, "llvm-nm returned an error: %s\n", output.c_str());
@@ -336,7 +341,7 @@
     if (line.empty()) { // last line
       continue;
     }
-    size_t sym_end = line.find(" ");
+    size_t sym_end = line.find(' ');
     if (sym_end == std::string::npos) {
       fprintf(stderr, "Couldn't parse llvm-nm output line: %s\n",
               line.c_str());
@@ -366,6 +371,9 @@
               std::set<std::string>& symbols,
               std::set<std::string>& dataSymbols)
 {
+#ifndef _WIN32
+  return DumpFileWithLlvmNm(nmPath, filename, symbols, dataSymbols);
+#else
   HANDLE hFile;
   HANDLE hFileMapping;
   LPVOID lpFileBase;
@@ -446,6 +454,7 @@
   CloseHandle(hFileMapping);
   CloseHandle(hFile);
   return true;
+#endif
 }
 
 bool bindexplib::AddObjectFile(const char* filename)
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 6e04ce5..52fc5d5 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -343,7 +343,7 @@
     // Target is empty, use the output.
     mf.AddCustomCommandToOutput(
       output, byproducts, depends, main_dependency, implicit_depends,
-      commandLines, comment, working.c_str(), false, escapeOldStyle,
+      commandLines, comment, working.c_str(), nullptr, false, escapeOldStyle,
       uses_terminal, command_expand_lists, depfile, job_pool);
   } else if (!byproducts.empty()) {
     status.SetError("BYPRODUCTS may not be specified with SOURCE signatures");
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index e27b126..aa98d89 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -6,7 +6,6 @@
 
 #include "cmCheckCustomOutputs.h"
 #include "cmCustomCommandLines.h"
-#include "cmCustomCommandTypes.h"
 #include "cmExecutionStatus.h"
 #include "cmGeneratorExpression.h"
 #include "cmGlobalGenerator.h"
@@ -215,9 +214,9 @@
   // Add the utility target to the makefile.
   bool escapeOldStyle = !verbatim;
   cmTarget* target = mf.AddUtilityCommand(
-    targetName, cmCommandOrigin::Project, excludeFromAll,
-    working_directory.c_str(), byproducts, depends, commandLines,
-    escapeOldStyle, comment, uses_terminal, command_expand_lists, job_pool);
+    targetName, excludeFromAll, working_directory.c_str(), byproducts, depends,
+    commandLines, escapeOldStyle, comment, uses_terminal, command_expand_lists,
+    job_pool);
 
   // Add additional user-specified source files to the target.
   target->AddSources(sources);
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index e0d27ee..def3ac7 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -8,6 +8,7 @@
 #include <algorithm>
 #include <functional>
 #include <iterator>
+#include <memory>
 #include <unordered_set>
 #include <utility>
 #include <vector>
@@ -144,6 +145,21 @@
                 ContainerAlgorithms::DefaultDeleter<Range>());
 }
 
+template <typename T>
+void cmAppend(std::vector<std::unique_ptr<T>>& v,
+              std::vector<std::unique_ptr<T>>&& r)
+{
+  std::transform(r.begin(), r.end(), std::back_inserter(v),
+                 [](std::unique_ptr<T>& item) { return std::move(item); });
+}
+
+template <typename T>
+void cmAppend(std::vector<T*>& v, std::vector<std::unique_ptr<T>> const& r)
+{
+  std::transform(r.begin(), r.end(), std::back_inserter(v),
+                 [](const std::unique_ptr<T>& item) { return item.get(); });
+}
+
 template <typename T, typename Range>
 void cmAppend(std::vector<T>& v, Range const& r)
 {
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 177bca8..b5c7e96 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -221,10 +221,10 @@
 
   // Pass the call to the makefile instance.
   std::vector<std::string> no_byproducts;
-  mf->AddUtilityCommand(utilityName, cmCommandOrigin::Project,
-                        (all ? false : true), nullptr, no_byproducts, depends2,
-                        commandLines);
+  mf->AddUtilityCommand(utilityName, (all ? false : true), nullptr,
+                        no_byproducts, depends2, commandLines);
 }
+
 void CCONV cmAddCustomCommand(void* arg, const char* source,
                               const char* command, int numArgs,
                               const char** args, int numDepends,
diff --git a/Source/cmCPluginAPI.h b/Source/cmCPluginAPI.h
index 6a95148..19626f0 100644
--- a/Source/cmCPluginAPI.h
+++ b/Source/cmCPluginAPI.h
@@ -36,7 +36,7 @@
   of functions are utility functions that are specific to the plugin API
   =========================================================================*/
   /* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how
-     information is passed from the InitialPass to FInalPass for commands
+     information is passed from the InitialPass to FinalPass for commands
      that need a FinalPass and need information from the InitialPass */
   void*(CCONV* GetClientData)(void* info);
   /* return the summed size in characters of all the arguments */
@@ -44,7 +44,7 @@
   /* free all the memory associated with an argc, argv pair */
   void(CCONV* FreeArguments)(int argc, char** argv);
   /* set/Get the ClientData in the cmLoadedCommandInfo structure, this is how
-     information is passed from the InitialPass to FInalPass for commands
+     information is passed from the InitialPass to FinalPass for commands
      that need a FinalPass and need information from the InitialPass */
   void(CCONV* SetClientData)(void* info, void* cd);
   /* when an error occurs, call this function to set the error string */
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 6eae26e..76a2bba 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -21,6 +21,7 @@
 #include "cmsys/FStream.hxx"
 #include "cmsys/Glob.hxx"
 #include "cmsys/Process.h"
+#include "cmsys/RegularExpression.hxx"
 #include "cmsys/SystemInformation.hxx"
 
 #include "cm_curl.h"
@@ -83,8 +84,8 @@
     std::string Name;
   };
 
-  int RepeatTests = 1; // default to run each test once
-  bool RepeatUntilFail = false;
+  int RepeatCount = 1; // default to run each test once
+  cmCTest::Repeat RepeatMode = cmCTest::Repeat::Never;
   std::string ConfigType;
   std::string ScheduleType;
   std::chrono::system_clock::time_point StopTime;
@@ -1839,11 +1840,16 @@
     this->SetParallelLevel(plevel);
     this->Impl->ParallelLevelSetInCli = true;
   }
+
   if (this->CheckArgument(arg, "--repeat-until-fail")) {
     if (i >= args.size() - 1) {
       errormsg = "'--repeat-until-fail' requires an argument";
       return false;
     }
+    if (this->Impl->RepeatMode != cmCTest::Repeat::Never) {
+      errormsg = "At most one '--repeat' option may be used.";
+      return false;
+    }
     i++;
     long repeat = 1;
     if (!cmStrToLong(args[i], &repeat)) {
@@ -1851,9 +1857,42 @@
         "'--repeat-until-fail' given non-integer value '" + args[i] + "'";
       return false;
     }
-    this->Impl->RepeatTests = static_cast<int>(repeat);
+    this->Impl->RepeatCount = static_cast<int>(repeat);
     if (repeat > 1) {
-      this->Impl->RepeatUntilFail = true;
+      this->Impl->RepeatMode = cmCTest::Repeat::UntilFail;
+    }
+  }
+
+  if (this->CheckArgument(arg, "--repeat")) {
+    if (i >= args.size() - 1) {
+      errormsg = "'--repeat' requires an argument";
+      return false;
+    }
+    if (this->Impl->RepeatMode != cmCTest::Repeat::Never) {
+      errormsg = "At most one '--repeat' option may be used.";
+      return false;
+    }
+    i++;
+    cmsys::RegularExpression repeatRegex(
+      "^(until-fail|until-pass|after-timeout):([0-9]+)$");
+    if (repeatRegex.find(args[i])) {
+      std::string const& count = repeatRegex.match(2);
+      unsigned long n = 1;
+      cmStrToULong(count, &n); // regex guarantees success
+      this->Impl->RepeatCount = static_cast<int>(n);
+      if (this->Impl->RepeatCount > 1) {
+        std::string const& mode = repeatRegex.match(1);
+        if (mode == "until-fail") {
+          this->Impl->RepeatMode = cmCTest::Repeat::UntilFail;
+        } else if (mode == "until-pass") {
+          this->Impl->RepeatMode = cmCTest::Repeat::UntilPass;
+        } else if (mode == "after-timeout") {
+          this->Impl->RepeatMode = cmCTest::Repeat::AfterTimeout;
+        }
+      }
+    } else {
+      errormsg = "'--repeat' given invalid value '" + args[i] + "'";
+      return false;
     }
   }
 
@@ -2847,14 +2886,14 @@
   return this->Impl->Definitions;
 }
 
-int cmCTest::GetTestRepeat() const
+int cmCTest::GetRepeatCount() const
 {
-  return this->Impl->RepeatTests;
+  return this->Impl->RepeatCount;
 }
 
-bool cmCTest::GetRepeatUntilFail() const
+cmCTest::Repeat cmCTest::GetRepeatMode() const
 {
-  return this->Impl->RepeatUntilFail;
+  return this->Impl->RepeatMode;
 }
 
 void cmCTest::SetBuildID(const std::string& id)
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 82a6f4c..e0ae100 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -431,10 +431,16 @@
   const std::map<std::string, std::string>& GetDefinitions() const;
 
   /** Return the number of times a test should be run */
-  int GetTestRepeat() const;
+  int GetRepeatCount() const;
 
-  /** Return true if test should run until fail */
-  bool GetRepeatUntilFail() const;
+  enum class Repeat
+  {
+    Never,
+    UntilFail,
+    UntilPass,
+    AfterTimeout,
+  };
+  Repeat GetRepeatMode() const;
 
   void GenerateSubprojectsOutput(cmXMLWriter& xml);
   std::vector<std::string> GetLabelsForSubprojects();
diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx
index 6f19697..896b6a9 100644
--- a/Source/cmCommands.cxx
+++ b/Source/cmCommands.cxx
@@ -198,6 +198,7 @@
 #if !defined(CMAKE_BOOTSTRAP)
   state->AddBuiltinCommand("cmake_host_system_information",
                            cmCMakeHostSystemInformationCommand);
+  state->AddBuiltinCommand("load_cache", cmLoadCacheCommand);
   state->AddBuiltinCommand("remove", cmRemoveCommand);
   state->AddBuiltinCommand("variable_watch", cmVariableWatchCommand);
   state->AddBuiltinCommand("write_file", cmWriteFileCommand);
@@ -279,7 +280,6 @@
   state->AddBuiltinCommand("link_libraries", cmLinkLibrariesCommand);
   state->AddBuiltinCommand("target_link_directories",
                            cmTargetLinkDirectoriesCommand);
-  state->AddBuiltinCommand("load_cache", cmLoadCacheCommand);
   state->AddBuiltinCommand("qt_wrap_cpp", cmQTWrapCPPCommand);
   state->AddBuiltinCommand("qt_wrap_ui", cmQTWrapUICommand);
   state->AddBuiltinCommand("remove_definitions", cmRemoveDefinitionsCommand);
@@ -339,7 +339,6 @@
   CM_UNEXPECTED_PROJECT_COMMAND("install");
   CM_UNEXPECTED_PROJECT_COMMAND("link_directories");
   CM_UNEXPECTED_PROJECT_COMMAND("link_libraries");
-  CM_UNEXPECTED_PROJECT_COMMAND("load_cache");
   CM_UNEXPECTED_PROJECT_COMMAND("project");
   CM_UNEXPECTED_PROJECT_COMMAND("qt_wrap_cpp");
   CM_UNEXPECTED_PROJECT_COMMAND("qt_wrap_ui");
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 162bab2..c22cf4a 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -4,6 +4,7 @@
 
 #include <cassert>
 #include <cstdio>
+#include <memory>
 #include <sstream>
 #include <utility>
 
@@ -160,12 +161,10 @@
   std::vector<cmLocalGenerator*> const& lgens =
     this->GlobalGenerator->GetLocalGenerators();
   for (cmLocalGenerator* lgen : lgens) {
-    const std::vector<cmGeneratorTarget*>& targets =
-      lgen->GetGeneratorTargets();
-    for (cmGeneratorTarget const* ti : targets) {
+    for (const auto& ti : lgen->GetGeneratorTargets()) {
       int index = static_cast<int>(this->Targets.size());
-      this->TargetIndex[ti] = index;
-      this->Targets.push_back(ti);
+      this->TargetIndex[ti.get()] = index;
+      this->Targets.push_back(ti.get());
     }
   }
 }
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 09d269b..7cc3c04 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -5,26 +5,22 @@
 #include <utility>
 
 #include "cmAlgorithms.h"
-#include "cmMakefile.h"
 
-cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
-                                 std::vector<std::string> outputs,
+cmCustomCommand::cmCustomCommand(std::vector<std::string> outputs,
                                  std::vector<std::string> byproducts,
                                  std::vector<std::string> depends,
                                  cmCustomCommandLines commandLines,
-                                 const char* comment,
+                                 cmListFileBacktrace lfbt, const char* comment,
                                  const char* workingDirectory)
   : Outputs(std::move(outputs))
   , Byproducts(std::move(byproducts))
   , Depends(std::move(depends))
   , CommandLines(std::move(commandLines))
+  , Backtrace(std::move(lfbt))
   , Comment(comment ? comment : "")
   , WorkingDirectory(workingDirectory ? workingDirectory : "")
   , HaveComment(comment != nullptr)
 {
-  if (mf) {
-    this->Backtrace = mf->GetBacktrace();
-  }
 }
 
 const std::vector<std::string>& cmCustomCommand::GetOutputs() const
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index 4689ace..d300fa5 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -12,8 +12,6 @@
 #include "cmCustomCommandLines.h"
 #include "cmListFileCache.h"
 
-class cmMakefile;
-
 class cmImplicitDependsList
   : public std::vector<std::pair<std::string, std::string>>
 {
@@ -28,11 +26,11 @@
 {
 public:
   /** Main constructor specifies all information for the command.  */
-  cmCustomCommand(cmMakefile const* mf, std::vector<std::string> outputs,
+  cmCustomCommand(std::vector<std::string> outputs,
                   std::vector<std::string> byproducts,
                   std::vector<std::string> depends,
-                  cmCustomCommandLines commandLines, const char* comment,
-                  const char* workingDirectory);
+                  cmCustomCommandLines commandLines, cmListFileBacktrace lfbt,
+                  const char* comment, const char* workingDirectory);
 
   /** Get the output file produced by the command.  */
   const std::vector<std::string>& GetOutputs() const;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 6d29c99..987ec9e 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -258,15 +258,7 @@
 
 void cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string& input)
 {
-  std::string::size_type pos = 0;
-  std::string::size_type lastPos = pos;
-
-  while ((pos = input.find("$<INSTALL_PREFIX>", lastPos)) !=
-         std::string::npos) {
-    std::string::size_type endPos = pos + sizeof("$<INSTALL_PREFIX>") - 1;
-    input.replace(pos, endPos - pos, "${_IMPORT_PREFIX}");
-    lastPos = endPos;
-  }
+  cmGeneratorExpression::ReplaceInstallPrefix(input, "${_IMPORT_PREFIX}");
 }
 
 bool cmExportInstallFileGenerator::GenerateImportFileConfig(
@@ -525,13 +517,14 @@
 }
 
 std::string cmExportInstallFileGenerator::InstallNameDir(
-  cmGeneratorTarget* target, const std::string& /*config*/)
+  cmGeneratorTarget* target, const std::string& config)
 {
   std::string install_name_dir;
 
   cmMakefile* mf = target->Target->GetMakefile();
   if (mf->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) {
-    install_name_dir = target->GetInstallNameDirForInstallTree();
+    install_name_dir =
+      target->GetInstallNameDirForInstallTree(config, "${_IMPORT_PREFIX}");
   }
 
   return install_name_dir;
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index 89093e9..dfc8de5 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -12,6 +12,7 @@
 #include "cmExecutionStatus.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGlobalGenerator.h"
+#include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
@@ -20,6 +21,8 @@
 #include "cmTargetLinkLibraryType.h"
 #include "cmake.h"
 
+class cmListFileBacktrace;
+
 static void FinalAction(cmMakefile& makefile, std::string const& filename,
                         bool append)
 {
@@ -150,9 +153,9 @@
 
   std::string const& filename = args[0];
   bool const append = args.size() > 1 && args[1] == "APPEND";
-  status.GetMakefile().AddFinalAction(
-    [filename, append](cmMakefile& makefile) {
-      FinalAction(makefile, filename, append);
+  status.GetMakefile().AddGeneratorAction(
+    [filename, append](cmLocalGenerator& lg, const cmListFileBacktrace&) {
+      FinalAction(*lg.GetMakefile(), filename, append);
     });
 
   return true;
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 5a5d959..d1da2d7 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -3,6 +3,7 @@
 #include "cmExtraCodeBlocksGenerator.h"
 
 #include <map>
+#include <memory>
 #include <ostream>
 #include <set>
 #include <utility>
@@ -283,8 +284,8 @@
   // add all executable and library targets and some of the GLOBAL
   // and UTILITY targets
   for (cmLocalGenerator* lg : lgs) {
-    const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
-    for (cmGeneratorTarget* target : targets) {
+    const auto& targets = lg->GetGeneratorTargets();
+    for (const auto& target : targets) {
       std::string targetName = target->GetName();
       switch (target->GetType()) {
         case cmStateEnums::GLOBAL_TARGET: {
@@ -315,7 +316,7 @@
         case cmStateEnums::SHARED_LIBRARY:
         case cmStateEnums::MODULE_LIBRARY:
         case cmStateEnums::OBJECT_LIBRARY: {
-          cmGeneratorTarget* gt = target;
+          cmGeneratorTarget* gt = target.get();
           this->AppendTarget(xml, targetName, gt, make, lg, compiler,
                              makeArgs);
           std::string fastTarget = cmStrCat(targetName, "/fast");
@@ -341,8 +342,8 @@
 
   for (cmLocalGenerator* lg : lgs) {
     cmMakefile* makefile = lg->GetMakefile();
-    const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
-    for (cmGeneratorTarget* target : targets) {
+    const auto& targets = lg->GetGeneratorTargets();
+    for (const auto& target : targets) {
       switch (target->GetType()) {
         case cmStateEnums::EXECUTABLE:
         case cmStateEnums::STATIC_LIBRARY:
@@ -352,13 +353,12 @@
         case cmStateEnums::UTILITY: // can have sources since 2.6.3
         {
           std::vector<cmSourceFile*> sources;
-          cmGeneratorTarget* gt = target;
-          gt->GetSourceFiles(sources,
-                             makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
+          target->GetSourceFiles(
+            sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
           for (cmSourceFile* s : sources) {
             // don't add source files from UTILITY target which have the
             // GENERATED property set:
-            if (gt->GetType() == cmStateEnums::UTILITY &&
+            if (target->GetType() == cmStateEnums::UTILITY &&
                 s->GetIsGenerated()) {
               continue;
             }
@@ -391,7 +391,7 @@
             }
 
             CbpUnit& cbpUnit = allFiles[fullPath];
-            cbpUnit.Targets.push_back(target);
+            cbpUnit.Targets.push_back(target.get());
           }
         }
         default: // intended fallthrough
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index c7b7457..3557e5c 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -4,6 +4,7 @@
 
 #include <cstring>
 #include <map>
+#include <memory>
 #include <set>
 #include <sstream>
 #include <utility>
@@ -119,7 +120,7 @@
   const std::vector<cmLocalGenerator*>& lgs =
     this->GlobalGenerator->GetLocalGenerators();
   for (cmLocalGenerator* lg : lgs) {
-    for (cmGeneratorTarget* lt : lg->GetGeneratorTargets()) {
+    for (const auto& lt : lg->GetGeneratorTargets()) {
       cmStateEnums::TargetType type = lt->GetType();
       std::string const& outputDir = lg->GetCurrentBinaryDirectory();
       std::string targetName = lt->GetName();
@@ -142,7 +143,7 @@
           xml->Attribute("Active", "No");
           xml->EndElement();
 
-          CreateNewProjectFile(lt, filename);
+          CreateNewProjectFile(lt.get(), filename);
           break;
         default:
           break;
@@ -269,9 +270,9 @@
 
   for (cmLocalGenerator* lg : lgs) {
     cmMakefile* makefile = lg->GetMakefile();
-    const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
-    for (cmGeneratorTarget* target : targets) {
-      projectType = CollectSourceFiles(makefile, target, cFiles, otherFiles);
+    for (const auto& target : lg->GetGeneratorTargets()) {
+      projectType =
+        CollectSourceFiles(makefile, target.get(), cFiles, otherFiles);
     }
   }
 
@@ -634,7 +635,10 @@
   if (generator == "NMake Makefiles" || generator == "Ninja") {
     ss << make;
   } else if (generator == "MinGW Makefiles" || generator == "Unix Makefiles") {
-    ss << make << " -f$(ProjectPath)/Makefile -j " << this->CpuCount;
+    ss << make << " -f$(ProjectPath)/Makefile";
+    if (this->CpuCount > 0) {
+      ss << " -j " << this->CpuCount;
+    }
   }
   if (!targetName.empty()) {
     ss << " " << targetName;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index b286acf..cf79375 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -6,6 +6,7 @@
 #include <cassert>
 #include <cstdio>
 #include <map>
+#include <memory>
 #include <sstream>
 #include <utility>
 
@@ -496,9 +497,9 @@
 
   for (cmLocalGenerator* lg : this->GlobalGenerator->GetLocalGenerators()) {
     cmMakefile* makefile = lg->GetMakefile();
-    const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
+    const auto& targets = lg->GetGeneratorTargets();
 
-    for (cmGeneratorTarget* target : targets) {
+    for (const auto& target : targets) {
       std::string linkName2 = cmStrCat(linkName, '/');
       switch (target->GetType()) {
         case cmStateEnums::EXECUTABLE:
@@ -519,10 +520,9 @@
           std::vector<cmSourceGroup> sourceGroups =
             makefile->GetSourceGroups();
           // get the files from the source lists then add them to the groups
-          cmGeneratorTarget* gt = const_cast<cmGeneratorTarget*>(target);
           std::vector<cmSourceFile*> files;
-          gt->GetSourceFiles(files,
-                             makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
+          target->GetSourceFiles(
+            files, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
           for (cmSourceFile* sf : files) {
             // Add the file to the list of sources.
             std::string const& source = sf->ResolveFullPath();
@@ -860,15 +860,14 @@
   // include dirs
   emmited.clear();
   for (cmLocalGenerator* lgen : this->GlobalGenerator->GetLocalGenerators()) {
-    const std::vector<cmGeneratorTarget*>& targets =
-      lgen->GetGeneratorTargets();
-    for (cmGeneratorTarget* target : targets) {
+    const auto& targets = lgen->GetGeneratorTargets();
+    for (const auto& target : targets) {
       if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
         continue;
       }
       std::vector<std::string> includeDirs;
       std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE");
-      lgen->GetIncludeDirectories(includeDirs, target, "C", config);
+      lgen->GetIncludeDirectories(includeDirs, target.get(), "C", config);
       this->AppendIncludeDirectories(xml, includeDirs, emmited);
     }
   }
@@ -916,15 +915,14 @@
   // add all executable and library targets and some of the GLOBAL
   // and UTILITY targets
   for (cmLocalGenerator* lgen : this->GlobalGenerator->GetLocalGenerators()) {
-    const std::vector<cmGeneratorTarget*>& targets =
-      lgen->GetGeneratorTargets();
+    const auto& targets = lgen->GetGeneratorTargets();
     std::string subdir = lgen->MaybeConvertToRelativePath(
       this->HomeOutputDirectory, lgen->GetCurrentBinaryDirectory());
     if (subdir == ".") {
       subdir.clear();
     }
 
-    for (cmGeneratorTarget* target : targets) {
+    for (const auto& target : targets) {
       std::string targetName = target->GetName();
       switch (target->GetType()) {
         case cmStateEnums::GLOBAL_TARGET: {
@@ -975,8 +973,7 @@
             std::string cleanArgs =
               cmStrCat("-E chdir \"", lgen->GetCurrentBinaryDirectory(),
                        "\" \"", cmSystemTools::GetCMakeCommand(), "\" -P \"");
-            cmGeneratorTarget* gt = target;
-            cleanArgs += lgen->GetTargetDirectory(gt);
+            cleanArgs += lgen->GetTargetDirectory(target.get());
             cleanArgs += "/cmake_clean.cmake\"";
             cmExtraEclipseCDT4Generator::AppendTarget(
               xml, "Clean", cmSystemTools::GetCMakeCommand(), cleanArgs,
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index e8c9dd0..bbbc281 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -3,6 +3,7 @@
 #include "cmExtraKateGenerator.h"
 
 #include <cstring>
+#include <memory>
 #include <ostream>
 #include <set>
 #include <vector>
@@ -111,12 +112,11 @@
   // and UTILITY targets
   for (cmLocalGenerator* localGen :
        this->GlobalGenerator->GetLocalGenerators()) {
-    const std::vector<cmGeneratorTarget*>& targets =
-      localGen->GetGeneratorTargets();
+    const auto& targets = localGen->GetGeneratorTargets();
     std::string currentDir = localGen->GetCurrentBinaryDirectory();
     bool topLevel = (currentDir == localGen->GetBinaryDirectory());
 
-    for (cmGeneratorTarget* target : targets) {
+    for (const auto& target : targets) {
       std::string const& targetName = target->GetName();
       switch (target->GetType()) {
         case cmStateEnums::GLOBAL_TARGET: {
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 495324c..603fea3 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -3,6 +3,7 @@
 #include "cmExtraSublimeTextGenerator.h"
 
 #include <cstring>
+#include <memory>
 #include <set>
 #include <sstream>
 #include <utility>
@@ -182,8 +183,8 @@
   // and UTILITY targets
   for (cmLocalGenerator* lg : lgs) {
     cmMakefile* makefile = lg->GetMakefile();
-    const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
-    for (cmGeneratorTarget* target : targets) {
+    const auto& targets = lg->GetGeneratorTargets();
+    for (const auto& target : targets) {
       std::string targetName = target->GetName();
       switch (target->GetType()) {
         case cmStateEnums::GLOBAL_TARGET: {
@@ -216,11 +217,11 @@
         case cmStateEnums::SHARED_LIBRARY:
         case cmStateEnums::MODULE_LIBRARY:
         case cmStateEnums::OBJECT_LIBRARY: {
-          this->AppendTarget(fout, targetName, lg, target, make.c_str(),
+          this->AppendTarget(fout, targetName, lg, target.get(), make.c_str(),
                              makefile, compiler.c_str(), sourceFileFlags,
                              false);
           std::string fastTarget = cmStrCat(targetName, "/fast");
-          this->AppendTarget(fout, fastTarget, lg, target, make.c_str(),
+          this->AppendTarget(fout, fastTarget, lg, target.get(), make.c_str(),
                              makefile, compiler.c_str(), sourceFileFlags,
                              false);
         } break;
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 11844e4..d88617a 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -6,15 +6,20 @@
 
 #include "cmCustomCommandLines.h"
 #include "cmExecutionStatus.h"
+#include "cmListFileCache.h"
+#include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmMessageType.h"
 #include "cmRange.h"
 #include "cmSourceFile.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
+#include "cmake.h"
 
 class cmTarget;
 
-static void FinalAction(cmMakefile& makefile, std::string const& name)
+static void FinalAction(cmMakefile& makefile, std::string const& name,
+                        const cmListFileBacktrace& lfbt)
 {
   // people should add the srcs to the target themselves, but the old command
   // didn't support that, so check and see if they added the files in and if
@@ -26,7 +31,8 @@
       ".  The problem was found while processing the source directory: ",
       makefile.GetCurrentSourceDirectory(),
       ".  This FLTK_WRAP_UI call will be ignored.");
-    cmSystemTools::Message(msg, "Warning");
+    makefile.GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_ERROR, msg,
+                                              lfbt);
   }
 }
 
@@ -116,7 +122,9 @@
   std::string const varName = target + "_FLTK_UI_SRCS";
   mf.AddDefinition(varName, sourceListValue);
 
-  mf.AddFinalAction(
-    [target](cmMakefile& makefile) { FinalAction(makefile, target); });
+  mf.AddGeneratorAction(
+    [target](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
+      FinalAction(*lg.GetMakefile(), target, lfbt);
+    });
   return true;
 }
diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx
index e90f571..6010233 100644
--- a/Source/cmFileLock.cxx
+++ b/Source/cmFileLock.cxx
@@ -3,11 +3,23 @@
 #include "cmFileLock.h"
 
 #include <cassert>
+#include <utility>
 
 #include "cmFileLockResult.h"
 
 // Common implementation
 
+cmFileLock::cmFileLock(cmFileLock&& other) noexcept
+{
+  this->File = other.File;
+#if defined(_WIN32)
+  other.File = INVALID_HANDLE_VALUE;
+#else
+  other.File = -1;
+#endif
+  this->Filename = std::move(other.Filename);
+}
+
 cmFileLock::~cmFileLock()
 {
   if (!this->Filename.empty()) {
@@ -17,6 +29,19 @@
   }
 }
 
+cmFileLock& cmFileLock::operator=(cmFileLock&& other) noexcept
+{
+  this->File = other.File;
+#if defined(_WIN32)
+  other.File = INVALID_HANDLE_VALUE;
+#else
+  other.File = -1;
+#endif
+  this->Filename = std::move(other.Filename);
+
+  return *this;
+}
+
 cmFileLockResult cmFileLock::Lock(const std::string& filename,
                                   unsigned long timeout)
 {
diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h
index 2130d65..5fe068e 100644
--- a/Source/cmFileLock.h
+++ b/Source/cmFileLock.h
@@ -26,7 +26,9 @@
   ~cmFileLock();
 
   cmFileLock(cmFileLock const&) = delete;
+  cmFileLock(cmFileLock&&) noexcept;
   cmFileLock& operator=(cmFileLock const&) = delete;
+  cmFileLock& operator=(cmFileLock&&) noexcept;
 
   /**
    * @brief Lock the file.
diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx
index 8db2db2..e1f6e94 100644
--- a/Source/cmFileLockPool.cxx
+++ b/Source/cmFileLockPool.cxx
@@ -3,40 +3,34 @@
 #include "cmFileLockPool.h"
 
 #include <cassert>
+#include <utility>
 
-#include "cmAlgorithms.h"
 #include "cmFileLock.h"
 #include "cmFileLockResult.h"
 
 cmFileLockPool::cmFileLockPool() = default;
 
-cmFileLockPool::~cmFileLockPool()
-{
-  cmDeleteAll(this->FunctionScopes);
-  cmDeleteAll(this->FileScopes);
-}
+cmFileLockPool::~cmFileLockPool() = default;
 
 void cmFileLockPool::PushFunctionScope()
 {
-  this->FunctionScopes.push_back(new ScopePool());
+  this->FunctionScopes.push_back(ScopePool());
 }
 
 void cmFileLockPool::PopFunctionScope()
 {
   assert(!this->FunctionScopes.empty());
-  delete this->FunctionScopes.back();
   this->FunctionScopes.pop_back();
 }
 
 void cmFileLockPool::PushFileScope()
 {
-  this->FileScopes.push_back(new ScopePool());
+  this->FileScopes.push_back(ScopePool());
 }
 
 void cmFileLockPool::PopFileScope()
 {
   assert(!this->FileScopes.empty());
-  delete this->FileScopes.back();
   this->FileScopes.pop_back();
 }
 
@@ -49,7 +43,7 @@
   if (this->FunctionScopes.empty()) {
     return cmFileLockResult::MakeNoFunction();
   }
-  return this->FunctionScopes.back()->Lock(filename, timeoutSec);
+  return this->FunctionScopes.back().Lock(filename, timeoutSec);
 }
 
 cmFileLockResult cmFileLockPool::LockFileScope(const std::string& filename,
@@ -59,7 +53,7 @@
     return cmFileLockResult::MakeAlreadyLocked();
   }
   assert(!this->FileScopes.empty());
-  return this->FileScopes.back()->Lock(filename, timeoutSec);
+  return this->FileScopes.back().Lock(filename, timeoutSec);
 }
 
 cmFileLockResult cmFileLockPool::LockProcessScope(const std::string& filename,
@@ -74,14 +68,14 @@
 cmFileLockResult cmFileLockPool::Release(const std::string& filename)
 {
   for (auto& funcScope : this->FunctionScopes) {
-    const cmFileLockResult result = funcScope->Release(filename);
+    const cmFileLockResult result = funcScope.Release(filename);
     if (!result.IsOk()) {
       return result;
     }
   }
 
   for (auto& fileScope : this->FileScopes) {
-    const cmFileLockResult result = fileScope->Release(filename);
+    const cmFileLockResult result = fileScope.Release(filename);
     if (!result.IsOk()) {
       return result;
     }
@@ -93,14 +87,14 @@
 bool cmFileLockPool::IsAlreadyLocked(const std::string& filename) const
 {
   for (auto const& funcScope : this->FunctionScopes) {
-    const bool result = funcScope->IsAlreadyLocked(filename);
+    const bool result = funcScope.IsAlreadyLocked(filename);
     if (result) {
       return true;
     }
   }
 
   for (auto const& fileScope : this->FileScopes) {
-    const bool result = fileScope->IsAlreadyLocked(filename);
+    const bool result = fileScope.IsAlreadyLocked(filename);
     if (result) {
       return true;
     }
@@ -111,21 +105,29 @@
 
 cmFileLockPool::ScopePool::ScopePool() = default;
 
-cmFileLockPool::ScopePool::~ScopePool()
+cmFileLockPool::ScopePool::~ScopePool() = default;
+
+cmFileLockPool::ScopePool::ScopePool(ScopePool&&) noexcept = default;
+
+cmFileLockPool::ScopePool& cmFileLockPool::ScopePool::operator=(
+  ScopePool&& other) noexcept
 {
-  cmDeleteAll(this->Locks);
+  if (this != &other) {
+    this->Locks = std::move(other.Locks);
+  }
+
+  return *this;
 }
 
 cmFileLockResult cmFileLockPool::ScopePool::Lock(const std::string& filename,
                                                  unsigned long timeoutSec)
 {
-  cmFileLock* lock = new cmFileLock();
-  const cmFileLockResult result = lock->Lock(filename, timeoutSec);
+  cmFileLock lock;
+  const cmFileLockResult result = lock.Lock(filename, timeoutSec);
   if (result.IsOk()) {
-    this->Locks.push_back(lock);
+    this->Locks.push_back(std::move(lock));
     return cmFileLockResult::MakeOk();
   }
-  delete lock;
   return result;
 }
 
@@ -133,8 +135,8 @@
   const std::string& filename)
 {
   for (auto& lock : this->Locks) {
-    if (lock->IsLocked(filename)) {
-      return lock->Release();
+    if (lock.IsLocked(filename)) {
+      return lock.Release();
     }
   }
   return cmFileLockResult::MakeOk();
@@ -144,7 +146,7 @@
   const std::string& filename) const
 {
   for (auto const& lock : this->Locks) {
-    if (lock->IsLocked(filename)) {
+    if (lock.IsLocked(filename)) {
       return true;
     }
   }
diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h
index dae68dd..d45c82c 100644
--- a/Source/cmFileLockPool.h
+++ b/Source/cmFileLockPool.h
@@ -8,7 +8,8 @@
 #include <string>
 #include <vector>
 
-class cmFileLock;
+#include "cmFileLock.h"
+
 class cmFileLockResult;
 
 class cmFileLockPool
@@ -64,7 +65,9 @@
     ~ScopePool();
 
     ScopePool(ScopePool const&) = delete;
+    ScopePool(ScopePool&&) noexcept;
     ScopePool& operator=(ScopePool const&) = delete;
+    ScopePool& operator=(ScopePool&&) noexcept;
 
     cmFileLockResult Lock(const std::string& filename,
                           unsigned long timeoutSec);
@@ -72,17 +75,12 @@
     bool IsAlreadyLocked(const std::string& filename) const;
 
   private:
-    using List = std::vector<cmFileLock*>;
-    using It = List::iterator;
-    using CIt = List::const_iterator;
+    using List = std::vector<cmFileLock>;
 
     List Locks;
   };
 
-  using List = std::vector<ScopePool*>;
-
-  using It = List::iterator;
-  using CIt = List::const_iterator;
+  using List = std::vector<ScopePool>;
 
   List FunctionScopes;
   List FileScopes;
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 44392ba..ac48287 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -2,8 +2,16 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmForEachCommand.h"
 
-#include <cstdio>
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+// NOTE The declaration of `std::abs` has moved to `cmath` since C++17
+// See https://en.cppreference.com/w/cpp/numeric/math/abs
+// ALERT But IWYU used to lint `#include`s do not "understand"
+// conditional compilation (i.e. `#if __cplusplus >= 201703L`)
 #include <cstdlib>
+#include <iterator>
+#include <map>
 #include <utility>
 
 #include <cm/memory>
@@ -21,12 +29,10 @@
 #include "cmSystemTools.h"
 
 namespace {
-bool HandleInMode(std::vector<std::string> const& args, cmMakefile& makefile);
-
 class cmForEachFunctionBlocker : public cmFunctionBlocker
 {
 public:
-  cmForEachFunctionBlocker(cmMakefile* mf);
+  explicit cmForEachFunctionBlocker(cmMakefile* mf);
   ~cmForEachFunctionBlocker() override;
 
   cm::string_view StartCommandName() const override { return "foreach"_s; }
@@ -38,10 +44,33 @@
   bool Replay(std::vector<cmListFileFunction> functions,
               cmExecutionStatus& inStatus) override;
 
+  void SetIterationVarsCount(const std::size_t varsCount)
+  {
+    this->IterationVarsCount = varsCount;
+  }
+  void SetZipLists() { this->ZipLists = true; }
+
   std::vector<std::string> Args;
 
 private:
+  struct InvokeResult
+  {
+    bool Restore;
+    bool Break;
+  };
+
+  bool ReplayItems(std::vector<cmListFileFunction> const& functions,
+                   cmExecutionStatus& inStatus);
+
+  bool ReplayZipLists(std::vector<cmListFileFunction> const& functions,
+                      cmExecutionStatus& inStatus);
+
+  InvokeResult invoke(std::vector<cmListFileFunction> const& functions,
+                      cmExecutionStatus& inStatus, cmMakefile& mf);
+
   cmMakefile* Makefile;
+  std::size_t IterationVarsCount = 0u;
+  bool ZipLists = false;
 };
 
 cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf)
@@ -60,53 +89,273 @@
 {
   std::vector<std::string> expandedArguments;
   mf.ExpandArguments(lff.Arguments, expandedArguments);
-  return expandedArguments.empty() || expandedArguments[0] == this->Args[0];
+  return expandedArguments.empty() ||
+    expandedArguments.front() == this->Args.front();
 }
 
 bool cmForEachFunctionBlocker::Replay(
   std::vector<cmListFileFunction> functions, cmExecutionStatus& inStatus)
 {
-  cmMakefile& mf = inStatus.GetMakefile();
-  // at end of for each execute recorded commands
+  return this->ZipLists ? this->ReplayZipLists(functions, inStatus)
+                        : this->ReplayItems(functions, inStatus);
+}
+
+bool cmForEachFunctionBlocker::ReplayItems(
+  std::vector<cmListFileFunction> const& functions,
+  cmExecutionStatus& inStatus)
+{
+  assert("Unexpected number of iteration variables" &&
+         this->IterationVarsCount == 1);
+
+  auto& mf = inStatus.GetMakefile();
+
+  // At end of for each execute recorded commands
   // store the old value
   std::string oldDef;
-  if (mf.GetDefinition(this->Args[0])) {
-    oldDef = mf.GetDefinition(this->Args[0]);
+  if (mf.GetDefinition(this->Args.front())) {
+    oldDef = mf.GetDefinition(this->Args.front());
   }
 
+  auto restore = false;
   for (std::string const& arg : cmMakeRange(this->Args).advance(1)) {
-    // set the variable to the loop value
-    mf.AddDefinition(this->Args[0], arg);
+    // Set the variable to the loop value
+    mf.AddDefinition(this->Args.front(), arg);
     // Invoke all the functions that were collected in the block.
-    for (cmListFileFunction const& func : functions) {
-      cmExecutionStatus status(mf);
-      mf.ExecuteCommand(func, status);
-      if (status.GetReturnInvoked()) {
-        inStatus.SetReturnInvoked();
-        // restore the variable to its prior value
-        mf.AddDefinition(this->Args[0], oldDef);
-        return true;
-      }
-      if (status.GetBreakInvoked()) {
-        // restore the variable to its prior value
-        mf.AddDefinition(this->Args[0], oldDef);
-        return true;
-      }
-      if (status.GetContinueInvoked()) {
-        break;
-      }
-      if (cmSystemTools::GetFatalErrorOccured()) {
-        return true;
-      }
+    auto r = this->invoke(functions, inStatus, mf);
+    restore = r.Restore;
+    if (r.Break) {
+      break;
     }
   }
 
-  // restore the variable to its prior value
-  mf.AddDefinition(this->Args[0], oldDef);
+  if (restore) {
+    // restore the variable to its prior value
+    mf.AddDefinition(this->Args.front(), oldDef);
+  }
   return true;
 }
+
+bool cmForEachFunctionBlocker::ReplayZipLists(
+  std::vector<cmListFileFunction> const& functions,
+  cmExecutionStatus& inStatus)
+{
+  assert("Unexpected number of iteration variables" &&
+         this->IterationVarsCount >= 1);
+
+  auto& mf = inStatus.GetMakefile();
+
+  // Expand the list of list-variables into a list of lists of strings
+  std::vector<std::vector<std::string>> values;
+  values.reserve(this->Args.size() - this->IterationVarsCount);
+  // Also track the longest list size
+  std::size_t maxItems = 0u;
+  for (auto const& var :
+       cmMakeRange(this->Args).advance(this->IterationVarsCount)) {
+    std::vector<std::string> items;
+    auto const& value = mf.GetSafeDefinition(var);
+    if (!value.empty()) {
+      cmExpandList(value, items, true);
+    }
+    maxItems = std::max(maxItems, items.size());
+    values.emplace_back(std::move(items));
+  }
+
+  // Form the list of iteration variables
+  std::vector<std::string> iterationVars;
+  if (this->IterationVarsCount > 1) {
+    // If multiple iteration variables has given,
+    // just copy them to the `iterationVars` list.
+    iterationVars.reserve(values.size());
+    std::copy(this->Args.begin(),
+              this->Args.begin() + this->IterationVarsCount,
+              std::back_inserter(iterationVars));
+  } else {
+    // In case of the only iteration variable,
+    // generate names as `var_name_N`,
+    // where `N` is the count of lists to zip
+    iterationVars.resize(values.size());
+    const auto iter_var_prefix = this->Args.front() + "_";
+    auto i = 0u;
+    std::generate(
+      iterationVars.begin(), iterationVars.end(),
+      [&]() -> std::string { return iter_var_prefix + std::to_string(i++); });
+  }
+  assert("Sanity check" && iterationVars.size() == values.size());
+
+  // Store old values for iteration variables
+  std::map<std::string, std::string> oldDefs;
+  for (auto i = 0u; i < values.size(); ++i) {
+    if (mf.GetDefinition(iterationVars[i])) {
+      oldDefs.emplace(iterationVars[i], mf.GetDefinition(iterationVars[i]));
+    }
+  }
+
+  // Form a vector of current positions in all lists (Ok, vectors) of values
+  std::vector<decltype(values)::value_type::iterator> positions;
+  positions.reserve(values.size());
+  std::transform(
+    values.begin(), values.end(), std::back_inserter(positions),
+    // Set the initial position to the beginning of every list
+    [](decltype(values)::value_type& list) { return list.begin(); });
+  assert("Sanity check" && positions.size() == values.size());
+
+  auto restore = false;
+  // Iterate over all the lists simulateneously
+  for (auto i = 0u; i < maxItems; ++i) {
+    // Declare iteration variables
+    for (auto j = 0u; j < values.size(); ++j) {
+      // Define (or not) the iteration variable if the current position
+      // still not at the end...
+      if (positions[j] != values[j].end()) {
+        mf.AddDefinition(iterationVars[j], *positions[j]);
+        ++positions[j];
+      } else {
+        mf.RemoveDefinition(iterationVars[j]);
+      }
+    }
+    // Invoke all the functions that were collected in the block.
+    auto r = this->invoke(functions, inStatus, mf);
+    restore = r.Restore;
+    if (r.Break) {
+      break;
+    }
+  }
+
+  // Restore the variables to its prior value
+  if (restore) {
+    for (auto const& p : oldDefs) {
+      mf.AddDefinition(p.first, p.second);
+    }
+  }
+  return true;
 }
 
+auto cmForEachFunctionBlocker::invoke(
+  std::vector<cmListFileFunction> const& functions,
+  cmExecutionStatus& inStatus, cmMakefile& mf) -> InvokeResult
+{
+  InvokeResult result = { true, false };
+  // Invoke all the functions that were collected in the block.
+  for (cmListFileFunction const& func : functions) {
+    cmExecutionStatus status(mf);
+    mf.ExecuteCommand(func, status);
+    if (status.GetReturnInvoked()) {
+      inStatus.SetReturnInvoked();
+      result.Break = true;
+      break;
+    }
+    if (status.GetBreakInvoked()) {
+      result.Break = true;
+      break;
+    }
+    if (status.GetContinueInvoked()) {
+      break;
+    }
+    if (cmSystemTools::GetFatalErrorOccured()) {
+      result.Restore = false;
+      result.Break = true;
+      break;
+    }
+  }
+  return result;
+}
+
+bool HandleInMode(std::vector<std::string> const& args,
+                  std::vector<std::string>::const_iterator kwInIter,
+                  cmMakefile& makefile)
+{
+  assert("A valid iterator expected" && kwInIter != args.end());
+
+  auto fb = cm::make_unique<cmForEachFunctionBlocker>(&makefile);
+
+  // Copy iteration variable names first
+  std::copy(args.begin(), kwInIter, std::back_inserter(fb->Args));
+  // Remember the count of given iteration variable names
+  const auto varsCount = fb->Args.size();
+  fb->SetIterationVarsCount(varsCount);
+
+  enum Doing
+  {
+    DoingNone,
+    DoingLists,
+    DoingItems,
+    DoingZipLists
+  };
+  Doing doing = DoingNone;
+  // Iterate over arguments past the "IN" keyword
+  for (std::string const& arg : cmMakeRange(++kwInIter, args.end())) {
+    if (arg == "LISTS") {
+      if (doing == DoingZipLists) {
+        makefile.IssueMessage(MessageType::FATAL_ERROR,
+                              "ZIP_LISTS can not be used with LISTS or ITEMS");
+        return true;
+      }
+      if (varsCount != 1u) {
+        makefile.IssueMessage(
+          MessageType::FATAL_ERROR,
+          "ITEMS or LISTS require exactly one iteration variable");
+        return true;
+      }
+      doing = DoingLists;
+
+    } else if (arg == "ITEMS") {
+      if (doing == DoingZipLists) {
+        makefile.IssueMessage(MessageType::FATAL_ERROR,
+                              "ZIP_LISTS can not be used with LISTS or ITEMS");
+        return true;
+      }
+      if (varsCount != 1u) {
+        makefile.IssueMessage(
+          MessageType::FATAL_ERROR,
+          "ITEMS or LISTS require exactly one iteration variable");
+        return true;
+      }
+      doing = DoingItems;
+
+    } else if (arg == "ZIP_LISTS") {
+      if (doing != DoingNone) {
+        makefile.IssueMessage(MessageType::FATAL_ERROR,
+                              "ZIP_LISTS can not be used with LISTS or ITEMS");
+        return true;
+      }
+      doing = DoingZipLists;
+      fb->SetZipLists();
+
+    } else if (doing == DoingLists) {
+      auto const& value = makefile.GetSafeDefinition(arg);
+      if (!value.empty()) {
+        cmExpandList(value, fb->Args, true);
+      }
+
+    } else if (doing == DoingItems || doing == DoingZipLists) {
+      fb->Args.push_back(arg);
+
+    } else {
+      makefile.IssueMessage(MessageType::FATAL_ERROR,
+                            cmStrCat("Unknown argument:\n", "  ", arg, "\n"));
+      return true;
+    }
+  }
+
+  // If `ZIP_LISTS` given and variables count more than 1,
+  // make sure the given lists count matches variables...
+  if (doing == DoingZipLists && varsCount > 1u &&
+      (2u * varsCount) != fb->Args.size()) {
+    makefile.IssueMessage(
+      MessageType::FATAL_ERROR,
+      cmStrCat("Expected ", std::to_string(varsCount),
+               " list variables, but given ",
+               std::to_string(fb->Args.size() - varsCount)));
+    return true;
+  }
+
+  makefile.AddFunctionBlocker(std::move(fb));
+
+  return true;
+}
+
+} // anonymous namespace
+
 bool cmForEachCommand(std::vector<std::string> const& args,
                       cmExecutionStatus& status)
 {
@@ -114,8 +363,9 @@
     status.SetError("called with incorrect number of arguments");
     return false;
   }
-  if (args.size() > 1 && args[1] == "IN") {
-    return HandleInMode(args, status.GetMakefile());
+  auto kwInIter = std::find(args.begin(), args.end(), "IN");
+  if (kwInIter != args.end()) {
+    return HandleInMode(args, kwInIter, status.GetMakefile());
   }
 
   // create a function blocker
@@ -126,16 +376,16 @@
       int stop = 0;
       int step = 0;
       if (args.size() == 3) {
-        stop = atoi(args[2].c_str());
+        stop = std::stoi(args[2]);
       }
       if (args.size() == 4) {
-        start = atoi(args[2].c_str());
-        stop = atoi(args[3].c_str());
+        start = std::stoi(args[2]);
+        stop = std::stoi(args[3]);
       }
       if (args.size() == 5) {
-        start = atoi(args[2].c_str());
-        stop = atoi(args[3].c_str());
-        step = atoi(args[4].c_str());
+        start = std::stoi(args[2]);
+        stop = std::stoi(args[3]);
+        step = std::stoi(args[4]);
       }
       if (step == 0) {
         if (start > stop) {
@@ -151,67 +401,33 @@
                    ", stop ", stop, ", step ", step));
         return false;
       }
-      std::vector<std::string> range;
-      char buffer[100];
-      range.push_back(args[0]);
-      int cc;
-      for (cc = start;; cc += step) {
-        if ((step > 0 && cc > stop) || (step < 0 && cc < stop)) {
-          break;
-        }
-        sprintf(buffer, "%d", cc);
-        range.emplace_back(buffer);
-        if (cc == stop) {
-          break;
-        }
-      }
-      fb->Args = range;
+
+      // Calculate expected iterations count and reserve enough space
+      // in the `fb->Args` vector. The first item is the iteration variable
+      // name...
+      const std::size_t iter_cnt = 2u +
+        int(start < stop) * (stop - start) / std::abs(step) +
+        int(start > stop) * (start - stop) / std::abs(step);
+      fb->Args.resize(iter_cnt);
+      fb->Args.front() = args.front();
+      auto cc = start;
+      auto generator = [&cc, step]() -> std::string {
+        auto result = std::to_string(cc);
+        cc += step;
+        return result;
+      };
+      // Fill the `range` vector w/ generated string values
+      // (starting from 2nd position)
+      std::generate(++fb->Args.begin(), fb->Args.end(), generator);
     } else {
       fb->Args = args;
     }
   } else {
     fb->Args = args;
   }
+
+  fb->SetIterationVarsCount(1u);
   status.GetMakefile().AddFunctionBlocker(std::move(fb));
 
   return true;
 }
-
-namespace {
-bool HandleInMode(std::vector<std::string> const& args, cmMakefile& makefile)
-{
-  auto fb = cm::make_unique<cmForEachFunctionBlocker>(&makefile);
-  fb->Args.push_back(args[0]);
-
-  enum Doing
-  {
-    DoingNone,
-    DoingLists,
-    DoingItems
-  };
-  Doing doing = DoingNone;
-  for (unsigned int i = 2; i < args.size(); ++i) {
-    if (doing == DoingItems) {
-      fb->Args.push_back(args[i]);
-    } else if (args[i] == "LISTS") {
-      doing = DoingLists;
-    } else if (args[i] == "ITEMS") {
-      doing = DoingItems;
-    } else if (doing == DoingLists) {
-      const char* value = makefile.GetDefinition(args[i]);
-      if (value && *value) {
-        cmExpandList(value, fb->Args, true);
-      }
-    } else {
-      makefile.IssueMessage(
-        MessageType::FATAL_ERROR,
-        cmStrCat("Unknown argument:\n", "  ", args[i], "\n"));
-      return true;
-    }
-  }
-
-  makefile.AddFunctionBlocker(std::move(fb));
-
-  return true;
-}
-}
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index b7f7d1d..81d1e46 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -8,7 +8,6 @@
 
 #include "cmsys/RegularExpression.hxx"
 
-#include "cmAlgorithms.h"
 #include "cmGeneratorExpressionContext.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorExpressionEvaluator.h"
@@ -22,6 +21,8 @@
 {
 }
 
+cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression() = default;
+
 cmGeneratorExpression::~cmGeneratorExpression() = default;
 
 std::unique_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
@@ -86,7 +87,7 @@
 
   this->Output.clear();
 
-  for (const cmGeneratorExpressionEvaluator* it : this->Evaluators) {
+  for (const auto& it : this->Evaluators) {
     this->Output += it->Evaluate(&context, dagChecker);
 
     this->SeenTargetProperties.insert(context.SeenTargetProperties.cbegin(),
@@ -129,11 +130,6 @@
   }
 }
 
-cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression()
-{
-  cmDeleteAll(this->Evaluators);
-}
-
 std::string cmGeneratorExpression::StripEmptyListElements(
   const std::string& input)
 {
@@ -385,6 +381,20 @@
   return targetNameValidator.find(input);
 }
 
+void cmGeneratorExpression::ReplaceInstallPrefix(
+  std::string& input, const std::string& replacement)
+{
+  std::string::size_type pos = 0;
+  std::string::size_type lastPos = pos;
+
+  while ((pos = input.find("$<INSTALL_PREFIX>", lastPos)) !=
+         std::string::npos) {
+    std::string::size_type endPos = pos + sizeof("$<INSTALL_PREFIX>") - 1;
+    input.replace(pos, endPos - pos, replacement);
+    lastPos = endPos;
+  }
+}
+
 void cmCompiledGeneratorExpression::GetMaxLanguageStandard(
   const cmGeneratorTarget* tgt, std::map<std::string, std::string>& mapping)
 {
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 4bd1c9f..c4be3a1 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -87,6 +87,9 @@
     return input != nullptr && input[0] == '$' && input[1] == '<';
   }
 
+  static void ReplaceInstallPrefix(std::string& input,
+                                   const std::string& replacement);
+
 private:
   cmListFileBacktrace Backtrace;
 };
@@ -160,7 +163,7 @@
   friend class cmGeneratorExpression;
 
   cmListFileBacktrace Backtrace;
-  std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
+  std::vector<std::unique_ptr<cmGeneratorExpressionEvaluator>> Evaluators;
   const std::string Input;
   bool NeedsEvaluation;
   bool EvaluateForBuildsystem;
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index e0ae170..4129a0c 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -2,10 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGeneratorExpressionEvaluator.h"
 
-#include <algorithm>
 #include <sstream>
 
-#include "cmAlgorithms.h"
 #include "cmGeneratorExpressionContext.h"
 #include "cmGeneratorExpressionNode.h"
 
@@ -16,6 +14,8 @@
 {
 }
 
+GeneratorExpressionContent::~GeneratorExpressionContent() = default;
+
 std::string GeneratorExpressionContent::GetOriginalExpression() const
 {
   return std::string(this->StartContent, this->ContentLength);
@@ -25,14 +25,13 @@
   const cmGeneratorExpressionNode* node, const std::string& identifier,
   cmGeneratorExpressionContext* context,
   cmGeneratorExpressionDAGChecker* dagChecker,
-  std::vector<std::vector<cmGeneratorExpressionEvaluator*>>::const_iterator
-    pit) const
+  std::vector<cmGeneratorExpressionEvaluatorVector>::const_iterator pit) const
 {
   std::string result;
 
   const auto pend = this->ParamChildren.end();
   for (; pit != pend; ++pit) {
-    for (cmGeneratorExpressionEvaluator* pExprEval : *pit) {
+    for (auto& pExprEval : *pit) {
       if (node->RequiresLiteralInput()) {
         if (pExprEval->GetType() != cmGeneratorExpressionEvaluator::Text) {
           reportError(context, this->GetOriginalExpression(),
@@ -64,8 +63,7 @@
 {
   std::string identifier;
   {
-    for (cmGeneratorExpressionEvaluator* pExprEval :
-         this->IdentifierChildren) {
+    for (auto& pExprEval : this->IdentifierChildren) {
       identifier += pExprEval->Evaluate(context, dagChecker);
       if (context->HadError) {
         return std::string();
@@ -126,7 +124,7 @@
         return std::string();
       }
       std::string parameter;
-      for (cmGeneratorExpressionEvaluator* pExprEval : *pit) {
+      for (auto& pExprEval : *pit) {
         parameter += pExprEval->Evaluate(context, dagChecker);
         if (context->HadError) {
           return std::string();
@@ -174,10 +172,3 @@
   }
   return std::string();
 }
-
-GeneratorExpressionContent::~GeneratorExpressionContent()
-{
-  cmDeleteAll(this->IdentifierChildren);
-  std::for_each(this->ParamChildren.begin(), this->ParamChildren.end(),
-                cmDeleteAll<std::vector<cmGeneratorExpressionEvaluator*>>);
-}
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index b10bb5b..10496fd 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -6,6 +6,7 @@
 #include "cmConfigure.h" // IWYU pragma: keep
 
 #include <cstddef>
+#include <memory>
 #include <string>
 #include <utility>
 #include <vector>
@@ -36,6 +37,9 @@
                                cmGeneratorExpressionDAGChecker*) const = 0;
 };
 
+using cmGeneratorExpressionEvaluatorVector =
+  std::vector<std::unique_ptr<cmGeneratorExpressionEvaluator>>;
+
 struct TextContent : public cmGeneratorExpressionEvaluator
 {
   TextContent(const char* start, size_t length)
@@ -68,13 +72,13 @@
 {
   GeneratorExpressionContent(const char* startContent, size_t length);
 
-  void SetIdentifier(std::vector<cmGeneratorExpressionEvaluator*> identifier)
+  void SetIdentifier(cmGeneratorExpressionEvaluatorVector&& identifier)
   {
     this->IdentifierChildren = std::move(identifier);
   }
 
   void SetParameters(
-    std::vector<std::vector<cmGeneratorExpressionEvaluator*>> parameters)
+    std::vector<cmGeneratorExpressionEvaluatorVector>&& parameters)
   {
     this->ParamChildren = std::move(parameters);
   }
@@ -102,12 +106,12 @@
     const cmGeneratorExpressionNode* node, const std::string& identifier,
     cmGeneratorExpressionContext* context,
     cmGeneratorExpressionDAGChecker* dagChecker,
-    std::vector<std::vector<cmGeneratorExpressionEvaluator*>>::const_iterator
-      pit) const;
+    std::vector<cmGeneratorExpressionEvaluatorVector>::const_iterator pit)
+    const;
 
 private:
-  std::vector<cmGeneratorExpressionEvaluator*> IdentifierChildren;
-  std::vector<std::vector<cmGeneratorExpressionEvaluator*>> ParamChildren;
+  cmGeneratorExpressionEvaluatorVector IdentifierChildren;
+  std::vector<cmGeneratorExpressionEvaluatorVector> ParamChildren;
   const char* StartContent;
   size_t ContentLength;
 };
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index d6cc6ab..4159a7b 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -6,6 +6,9 @@
 #include <cstddef>
 #include <utility>
 
+#include <cm/memory>
+#include <cmext/memory>
+
 #include "cmAlgorithms.h"
 #include "cmGeneratorExpressionEvaluator.h"
 
@@ -17,7 +20,7 @@
 }
 
 void cmGeneratorExpressionParser::Parse(
-  std::vector<cmGeneratorExpressionEvaluator*>& result)
+  cmGeneratorExpressionEvaluatorVector& result)
 {
   it = this->Tokens.begin();
 
@@ -27,40 +30,38 @@
 }
 
 static void extendText(
-  std::vector<cmGeneratorExpressionEvaluator*>& result,
+  cmGeneratorExpressionEvaluatorVector& result,
   std::vector<cmGeneratorExpressionToken>::const_iterator it)
 {
   if (!result.empty() &&
       (*(result.end() - 1))->GetType() ==
         cmGeneratorExpressionEvaluator::Text) {
-    TextContent* textContent = static_cast<TextContent*>(*(result.end() - 1));
-    textContent->Extend(it->Length);
+    cm::static_reference_cast<TextContent>(*(result.end() - 1))
+      .Extend(it->Length);
   } else {
-    TextContent* textContent = new TextContent(it->Content, it->Length);
-    result.push_back(textContent);
+    auto textContent = cm::make_unique<TextContent>(it->Content, it->Length);
+    result.push_back(std::move(textContent));
   }
 }
 
 static void extendResult(
-  std::vector<cmGeneratorExpressionEvaluator*>& result,
-  const std::vector<cmGeneratorExpressionEvaluator*>& contents)
+  cmGeneratorExpressionParser::cmGeneratorExpressionEvaluatorVector& result,
+  cmGeneratorExpressionParser::cmGeneratorExpressionEvaluatorVector&& contents)
 {
   if (!result.empty() &&
       (*(result.end() - 1))->GetType() ==
         cmGeneratorExpressionEvaluator::Text &&
       contents.front()->GetType() == cmGeneratorExpressionEvaluator::Text) {
-    TextContent* textContent = static_cast<TextContent*>(*(result.end() - 1));
-    textContent->Extend(
-      static_cast<TextContent*>(contents.front())->GetLength());
-    delete contents.front();
-    cmAppend(result, contents.begin() + 1, contents.end());
-  } else {
-    cmAppend(result, contents);
+    cm::static_reference_cast<TextContent>(*(result.end() - 1))
+      .Extend(
+        cm::static_reference_cast<TextContent>(contents.front()).GetLength());
+    contents.erase(contents.begin());
   }
+  cmAppend(result, std::move(contents));
 }
 
 void cmGeneratorExpressionParser::ParseGeneratorExpression(
-  std::vector<cmGeneratorExpressionEvaluator*>& result)
+  cmGeneratorExpressionEvaluatorVector& result)
 {
   assert(this->it != this->Tokens.end());
   unsigned int nestedLevel = this->NestingLevel;
@@ -68,7 +69,7 @@
 
   auto startToken = this->it - 1;
 
-  std::vector<cmGeneratorExpressionEvaluator*> identifier;
+  cmGeneratorExpressionEvaluatorVector identifier;
   while (this->it->TokenType != cmGeneratorExpressionToken::EndExpression &&
          this->it->TokenType != cmGeneratorExpressionToken::ColonSeparator) {
     if (this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator) {
@@ -87,18 +88,18 @@
 
   if (this->it != this->Tokens.end() &&
       this->it->TokenType == cmGeneratorExpressionToken::EndExpression) {
-    GeneratorExpressionContent* content = new GeneratorExpressionContent(
+    auto content = cm::make_unique<GeneratorExpressionContent>(
       startToken->Content,
       this->it->Content - startToken->Content + this->it->Length);
     assert(this->it != this->Tokens.end());
     ++this->it;
     --this->NestingLevel;
     content->SetIdentifier(std::move(identifier));
-    result.push_back(content);
+    result.push_back(std::move(content));
     return;
   }
 
-  std::vector<std::vector<cmGeneratorExpressionEvaluator*>> parameters;
+  std::vector<cmGeneratorExpressionEvaluatorVector> parameters;
   std::vector<std::vector<cmGeneratorExpressionToken>::const_iterator>
     commaTokens;
   std::vector<cmGeneratorExpressionToken>::const_iterator colonToken;
@@ -169,7 +170,7 @@
     // treat the '$<' as having been plain text, along with the
     // corresponding : and , tokens that might have been found.
     extendText(result, startToken);
-    extendResult(result, identifier);
+    extendResult(result, std::move(identifier));
     if (!parameters.empty()) {
       extendText(result, colonToken);
 
@@ -179,7 +180,7 @@
       assert(parameters.size() > commaTokens.size());
       for (; pit != pend; ++pit, ++commaIt) {
         if (!pit->empty() && !emptyParamTermination) {
-          extendResult(result, *pit);
+          extendResult(result, std::move(*pit));
         }
         if (commaIt != commaTokens.end()) {
           extendText(result, *commaIt);
@@ -193,15 +194,15 @@
 
   size_t contentLength =
     ((this->it - 1)->Content - startToken->Content) + (this->it - 1)->Length;
-  GeneratorExpressionContent* content =
-    new GeneratorExpressionContent(startToken->Content, contentLength);
+  auto content = cm::make_unique<GeneratorExpressionContent>(
+    startToken->Content, contentLength);
   content->SetIdentifier(std::move(identifier));
   content->SetParameters(std::move(parameters));
-  result.push_back(content);
+  result.push_back(std::move(content));
 }
 
 void cmGeneratorExpressionParser::ParseContent(
-  std::vector<cmGeneratorExpressionEvaluator*>& result)
+  cmGeneratorExpressionEvaluatorVector& result)
 {
   assert(this->it != this->Tokens.end());
   switch (this->it->TokenType) {
@@ -213,17 +214,16 @@
           // A comma in 'plain text' could have split text that should
           // otherwise be continuous. Extend the last text content instead of
           // creating a new one.
-          TextContent* textContent =
-            static_cast<TextContent*>(*(result.end() - 1));
-          textContent->Extend(this->it->Length);
+          cm::static_reference_cast<TextContent>(*(result.end() - 1))
+            .Extend(this->it->Length);
           assert(this->it != this->Tokens.end());
           ++this->it;
           return;
         }
       }
-      cmGeneratorExpressionEvaluator* n =
-        new TextContent(this->it->Content, this->it->Length);
-      result.push_back(n);
+      auto n =
+        cm::make_unique<TextContent>(this->it->Content, this->it->Length);
+      result.push_back(std::move(n));
       assert(this->it != this->Tokens.end());
       ++this->it;
       return;
diff --git a/Source/cmGeneratorExpressionParser.h b/Source/cmGeneratorExpressionParser.h
index e663496..1ba1654 100644
--- a/Source/cmGeneratorExpressionParser.h
+++ b/Source/cmGeneratorExpressionParser.h
@@ -5,6 +5,7 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
+#include <memory>
 #include <vector>
 
 #include "cmGeneratorExpressionLexer.h"
@@ -15,11 +16,14 @@
 {
   cmGeneratorExpressionParser(std::vector<cmGeneratorExpressionToken> tokens);
 
-  void Parse(std::vector<cmGeneratorExpressionEvaluator*>& result);
+  using cmGeneratorExpressionEvaluatorVector =
+    std::vector<std::unique_ptr<cmGeneratorExpressionEvaluator>>;
+
+  void Parse(cmGeneratorExpressionEvaluatorVector& result);
 
 private:
-  void ParseContent(std::vector<cmGeneratorExpressionEvaluator*>&);
-  void ParseGeneratorExpression(std::vector<cmGeneratorExpressionEvaluator*>&);
+  void ParseContent(cmGeneratorExpressionEvaluatorVector&);
+  void ParseGeneratorExpression(cmGeneratorExpressionEvaluatorVector&);
 
 private:
   std::vector<cmGeneratorExpressionToken>::const_iterator it;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 171c3ed..a4a074f 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -10,11 +10,11 @@
 #include <cstdlib>
 #include <cstring>
 #include <iterator>
-#include <memory>
 #include <sstream>
 #include <unordered_set>
 #include <utility>
 
+#include <cm/memory>
 #include <cm/string_view>
 
 #include <queue>
@@ -162,7 +162,8 @@
   cmListFileBacktrace Backtrace;
 };
 
-cmGeneratorTarget::TargetPropertyEntry* CreateTargetPropertyEntry(
+std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>
+CreateTargetPropertyEntry(
   const std::string& propertyValue,
   cmListFileBacktrace backtrace = cmListFileBacktrace(),
   bool evaluateForBuildsystem = false)
@@ -172,15 +173,18 @@
     std::unique_ptr<cmCompiledGeneratorExpression> cge =
       ge.Parse(propertyValue);
     cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
-    return new TargetPropertyEntryGenex(std::move(cge));
+    return std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>(
+      cm::make_unique<TargetPropertyEntryGenex>(std::move(cge)));
   }
 
-  return new TargetPropertyEntryString(propertyValue, std::move(backtrace));
+  return std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>(
+    cm::make_unique<TargetPropertyEntryString>(propertyValue,
+                                               std::move(backtrace)));
 }
 
 void CreatePropertyGeneratorExpressions(
   cmStringRange entries, cmBacktraceRange backtraces,
-  std::vector<cmGeneratorTarget::TargetPropertyEntry*>& items,
+  std::vector<std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>>& items,
   bool evaluateForBuildsystem = false)
 {
   auto btIt = backtraces.begin();
@@ -219,13 +223,13 @@
 EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry(
   cmGeneratorTarget const* thisTarget, std::string const& config,
   std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker,
-  cmGeneratorTarget::TargetPropertyEntry* entry)
+  cmGeneratorTarget::TargetPropertyEntry& entry)
 {
-  EvaluatedTargetPropertyEntry ee(entry->LinkImplItem, entry->GetBacktrace());
-  cmExpandList(entry->Evaluate(thisTarget->GetLocalGenerator(), config,
-                               thisTarget, dagChecker, lang),
+  EvaluatedTargetPropertyEntry ee(entry.LinkImplItem, entry.GetBacktrace());
+  cmExpandList(entry.Evaluate(thisTarget->GetLocalGenerator(), config,
+                              thisTarget, dagChecker, lang),
                ee.Values);
-  if (entry->GetHadContextSensitiveCondition()) {
+  if (entry.GetHadContextSensitiveCondition()) {
     ee.ContextDependent = true;
   }
   return ee;
@@ -234,13 +238,14 @@
 std::vector<EvaluatedTargetPropertyEntry> EvaluateTargetPropertyEntries(
   cmGeneratorTarget const* thisTarget, std::string const& config,
   std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker,
-  std::vector<cmGeneratorTarget::TargetPropertyEntry*> const& in)
+  std::vector<std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>> const&
+    in)
 {
   std::vector<EvaluatedTargetPropertyEntry> out;
   out.reserve(in.size());
-  for (cmGeneratorTarget::TargetPropertyEntry* entry : in) {
+  for (auto& entry : in) {
     out.emplace_back(EvaluateTargetPropertyEntry(thisTarget, config, lang,
-                                                 dagChecker, entry));
+                                                 dagChecker, *entry));
   }
   return out;
 }
@@ -304,23 +309,12 @@
   this->PolicyMap = t->GetPolicyMap();
 }
 
-cmGeneratorTarget::~cmGeneratorTarget()
-{
-  cmDeleteAll(this->IncludeDirectoriesEntries);
-  cmDeleteAll(this->CompileOptionsEntries);
-  cmDeleteAll(this->CompileFeaturesEntries);
-  cmDeleteAll(this->CompileDefinitionsEntries);
-  cmDeleteAll(this->LinkOptionsEntries);
-  cmDeleteAll(this->LinkDirectoriesEntries);
-  cmDeleteAll(this->PrecompileHeadersEntries);
-  cmDeleteAll(this->SourceEntries);
-  cmDeleteAll(this->LinkInformation);
-}
+cmGeneratorTarget::~cmGeneratorTarget() = default;
 
 const char* cmGeneratorTarget::GetSourcesProperty() const
 {
   std::vector<std::string> values;
-  for (TargetPropertyEntry* se : this->SourceEntries) {
+  for (auto& se : this->SourceEntries) {
     values.push_back(se->GetInput());
   }
   static std::string value;
@@ -1122,7 +1116,8 @@
 }
 
 bool cmGeneratorTarget::MaybeHaveInterfaceProperty(
-  std::string const& prop, cmGeneratorExpressionContext* context) const
+  std::string const& prop, cmGeneratorExpressionContext* context,
+  bool usage_requirements_only) const
 {
   std::string const key = prop + '@' + context->Config;
   auto i = this->MaybeInterfacePropertyExists.find(key);
@@ -1141,7 +1136,7 @@
         context->HeadTarget ? context->HeadTarget : this;
       if (cmLinkInterfaceLibraries const* iface =
             this->GetLinkInterfaceLibraries(context->Config, headTarget,
-                                            true)) {
+                                            usage_requirements_only)) {
         if (iface->HadHeadSensitiveCondition) {
           // With a different head target we may get to a library with
           // this interface property.
@@ -1151,7 +1146,8 @@
           // head target, so we can follow them.
           for (cmLinkItem const& lib : iface->Libraries) {
             if (lib.Target &&
-                lib.Target->MaybeHaveInterfaceProperty(prop, context)) {
+                lib.Target->MaybeHaveInterfaceProperty(
+                  prop, context, usage_requirements_only)) {
               maybeInterfaceProp = true;
               break;
             }
@@ -1165,12 +1161,14 @@
 
 std::string cmGeneratorTarget::EvaluateInterfaceProperty(
   std::string const& prop, cmGeneratorExpressionContext* context,
-  cmGeneratorExpressionDAGChecker* dagCheckerParent) const
+  cmGeneratorExpressionDAGChecker* dagCheckerParent,
+  bool usage_requirements_only) const
 {
   std::string result;
 
   // If the property does not appear transitively at all, we are done.
-  if (!this->MaybeHaveInterfaceProperty(prop, context)) {
+  if (!this->MaybeHaveInterfaceProperty(prop, context,
+                                        usage_requirements_only)) {
     return result;
   }
 
@@ -1202,8 +1200,8 @@
       p, context->LG, context, headTarget, &dagChecker, this);
   }
 
-  if (cmLinkInterfaceLibraries const* iface =
-        this->GetLinkInterfaceLibraries(context->Config, headTarget, true)) {
+  if (cmLinkInterfaceLibraries const* iface = this->GetLinkInterfaceLibraries(
+        context->Config, headTarget, usage_requirements_only)) {
     for (cmLinkItem const& lib : iface->Libraries) {
       // Broken code can have a target in its own link interface.
       // Don't follow such link interface entries so as not to create a
@@ -1246,7 +1244,8 @@
                          std::string const& config, std::string const& prop,
                          std::string const& lang,
                          cmGeneratorExpressionDAGChecker* dagChecker,
-                         std::vector<EvaluatedTargetPropertyEntry>& entries)
+                         std::vector<EvaluatedTargetPropertyEntry>& entries,
+                         bool usage_requirements_only = true)
 {
   if (cmLinkImplementationLibraries const* impl =
         headTarget->GetLinkImplementationLibraries(config)) {
@@ -1259,9 +1258,9 @@
         cmGeneratorExpressionContext context(
           headTarget->GetLocalGenerator(), config, false, headTarget,
           headTarget, true, lib.Backtrace, lang);
-        cmExpandList(
-          lib.Target->EvaluateInterfaceProperty(prop, &context, dagChecker),
-          ee.Values);
+        cmExpandList(lib.Target->EvaluateInterfaceProperty(
+                       prop, &context, dagChecker, usage_requirements_only),
+                     ee.Values);
         ee.ContextDependent = context.HadContextSensitiveCondition;
         entries.emplace_back(std::move(ee));
       }
@@ -1672,6 +1671,19 @@
   }
 }
 
+std::set<std::string> cmGeneratorTarget::GetAllConfigCompileLanguages() const
+{
+  std::set<std::string> languages;
+  std::vector<AllConfigSource> const& sources = this->GetAllConfigSources();
+  for (AllConfigSource const& si : sources) {
+    std::string const& lang = si.Source->GetOrDetermineLanguage();
+    if (!lang.empty()) {
+      languages.emplace(lang);
+    }
+  }
+  return languages;
+}
+
 std::string cmGeneratorTarget::GetCompilePDBName(
   const std::string& config) const
 {
@@ -2114,7 +2126,9 @@
     // If building directly for installation then the build tree install_name
     // is the same as the install tree.
     if (this->MacOSXUseInstallNameDir()) {
-      return this->GetInstallNameDirForInstallTree();
+      std::string installPrefix =
+        this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
+      return this->GetInstallNameDirForInstallTree(config, installPrefix);
     }
 
     // Use the build tree directory for the target.
@@ -2132,7 +2146,8 @@
   return "";
 }
 
-std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
+std::string cmGeneratorTarget::GetInstallNameDirForInstallTree(
+  const std::string& config, const std::string& installPrefix) const
 {
   if (this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) {
     std::string dir;
@@ -2140,7 +2155,13 @@
 
     if (this->CanGenerateInstallNameDir(INSTALL_NAME_FOR_INSTALL)) {
       if (install_name_dir && *install_name_dir) {
-        dir = cmStrCat(install_name_dir, '/');
+        dir = install_name_dir;
+        cmGeneratorExpression::ReplaceInstallPrefix(dir, installPrefix);
+        dir =
+          cmGeneratorExpression::Evaluate(dir, this->LocalGenerator, config);
+        if (!dir.empty()) {
+          dir = cmStrCat(dir, '/');
+        }
       }
     }
     if (!install_name_dir) {
@@ -2492,11 +2513,11 @@
   info.WindowsExportAllSymbols =
     this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS") &&
     this->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS");
-#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
+#if !defined(CMAKE_BOOTSTRAP)
   info.DefFileGenerated =
     info.WindowsExportAllSymbols || info.Sources.size() > 1;
 #else
-  // Our __create_def helper is only available on Windows.
+  // Our __create_def helper is not available during CMake bootstrap.
   info.DefFileGenerated = false;
 #endif
   if (info.DefFileGenerated) {
@@ -3277,10 +3298,10 @@
           CM_FALLTHROUGH;
         }
         case cmPolicies::OLD: {
-          std::unique_ptr<TargetPropertyEntry> entry(
-            CreateTargetPropertyEntry(configProp));
+          std::unique_ptr<TargetPropertyEntry> entry =
+            CreateTargetPropertyEntry(configProp);
           entries.emplace_back(EvaluateTargetPropertyEntry(
-            this, config, language, &dagChecker, entry.get()));
+            this, config, language, &dagChecker, *entry));
         } break;
         case cmPolicies::NEW:
         case cmPolicies::REQUIRED_ALWAYS:
@@ -3647,7 +3668,8 @@
                                   this->LinkOptionsEntries);
 
   AddInterfaceEntries(this, config, "INTERFACE_LINK_OPTIONS", language,
-                      &dagChecker, entries);
+                      &dagChecker, entries,
+                      this->GetPolicyStatusCMP0099() != cmPolicies::NEW);
 
   processOptions(this, entries, result, uniqueOptions, debugOptions,
                  "link options", OptionsParse::Shell);
@@ -3779,10 +3801,10 @@
   if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
     std::vector<std::string> options = cmExpandedList(linkOptions);
     for (const auto& option : options) {
-      std::unique_ptr<TargetPropertyEntry> entry(
-        CreateTargetPropertyEntry(option));
-      entries.emplace_back(EvaluateTargetPropertyEntry(
-        this, config, language, &dagChecker, entry.get()));
+      std::unique_ptr<TargetPropertyEntry> entry =
+        CreateTargetPropertyEntry(option);
+      entries.emplace_back(EvaluateTargetPropertyEntry(this, config, language,
+                                                       &dagChecker, *entry));
     }
   }
   processOptions(this, entries, result, uniqueOptions, false,
@@ -3902,7 +3924,8 @@
                                   this->LinkDirectoriesEntries);
 
   AddInterfaceEntries(this, config, "INTERFACE_LINK_DIRECTORIES", language,
-                      &dagChecker, entries);
+                      &dagChecker, entries,
+                      this->GetPolicyStatusCMP0099() != cmPolicies::NEW);
 
   processLinkDirectories(this, entries, result, uniqueDirectories,
                          debugDirectories);
@@ -3933,14 +3956,15 @@
   if (const char* linkDepends = this->GetProperty("LINK_DEPENDS")) {
     std::vector<std::string> depends = cmExpandedList(linkDepends);
     for (const auto& depend : depends) {
-      std::unique_ptr<TargetPropertyEntry> entry(
-        CreateTargetPropertyEntry(depend));
-      entries.emplace_back(EvaluateTargetPropertyEntry(
-        this, config, language, &dagChecker, entry.get()));
+      std::unique_ptr<TargetPropertyEntry> entry =
+        CreateTargetPropertyEntry(depend);
+      entries.emplace_back(EvaluateTargetPropertyEntry(this, config, language,
+                                                       &dagChecker, *entry));
     }
   }
   AddInterfaceEntries(this, config, "INTERFACE_LINK_DEPENDS", language,
-                      &dagChecker, entries);
+                      &dagChecker, entries,
+                      this->GetPolicyStatusCMP0099() != cmPolicies::NEW);
 
   processOptions(this, entries, result, uniqueOptions, false, "link depends",
                  OptionsParse::None);
@@ -4720,9 +4744,9 @@
 }
 
 void cmGeneratorTarget::CheckPropertyCompatibility(
-  cmComputeLinkInformation* info, const std::string& config) const
+  cmComputeLinkInformation& info, const std::string& config) const
 {
-  const cmComputeLinkInformation::ItemVector& deps = info->GetItems();
+  const cmComputeLinkInformation::ItemVector& deps = info.GetItems();
 
   std::set<std::string> emittedBools;
   static const std::string strBool = "COMPATIBLE_INTERFACE_BOOL";
@@ -5067,10 +5091,11 @@
   }
 
   std::string interfaceProperty = "INTERFACE_" + p;
-  std::unique_ptr<cmGeneratorExpressionInterpreter> genexInterpreter(
-    p == "POSITION_INDEPENDENT_CODE" ? new cmGeneratorExpressionInterpreter(
-                                         tgt->GetLocalGenerator(), config, tgt)
-                                     : nullptr);
+  std::unique_ptr<cmGeneratorExpressionInterpreter> genexInterpreter;
+  if (p == "POSITION_INDEPENDENT_CODE") {
+    genexInterpreter = cm::make_unique<cmGeneratorExpressionInterpreter>(
+      tgt->GetLocalGenerator(), config, tgt);
+  }
 
   for (cmGeneratorTarget const* theTarget : deps) {
     // An error should be reported if one dependency
@@ -5217,22 +5242,19 @@
   auto i = this->LinkInformation.find(key);
   if (i == this->LinkInformation.end()) {
     // Compute information for this configuration.
-    cmComputeLinkInformation* info =
-      new cmComputeLinkInformation(this, config);
-    if (!info || !info->Compute()) {
-      delete info;
-      info = nullptr;
+    auto info = cm::make_unique<cmComputeLinkInformation>(this, config);
+    if (info && !info->Compute()) {
+      info.reset();
     }
 
     // Store the information for this configuration.
-    cmTargetLinkInformationMap::value_type entry(key, info);
-    i = this->LinkInformation.insert(entry).first;
+    i = this->LinkInformation.emplace(key, std::move(info)).first;
 
-    if (info) {
-      this->CheckPropertyCompatibility(info, config);
+    if (i->second) {
+      this->CheckPropertyCompatibility(*i->second, config);
     }
   }
-  return i->second;
+  return i->second.get();
 }
 
 void cmGeneratorTarget::GetTargetVersion(int& major, int& minor) const
@@ -6379,8 +6401,7 @@
       this->GetType() != cmStateEnums::EXECUTABLE) {
     return false;
   }
-  std::set<std::string> languages;
-  this->GetLanguages(languages, "");
+  std::set<std::string> languages = this->GetAllConfigCompileLanguages();
   // Consider an explicit linker language property, but *not* the
   // computed linker language that may depend on linked targets.
   const char* linkLang = this->GetProperty("LINKER_LANGUAGE");
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 493eafc..761e58a 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -7,6 +7,7 @@
 
 #include <cstddef>
 #include <map>
+#include <memory>
 #include <set>
 #include <string>
 #include <unordered_map>
@@ -125,7 +126,7 @@
 
   struct AllConfigSource
   {
-    cmSourceFile const* Source;
+    cmSourceFile* Source;
     cmGeneratorTarget::SourceKind Kind;
     std::vector<size_t> Configs;
   };
@@ -134,6 +135,10 @@
       per-source configurations assigned.  */
   std::vector<AllConfigSource> const& GetAllConfigSources() const;
 
+  /** Get all languages used to compile sources in any configuration.
+      This excludes the languages of objects from object libraries.  */
+  std::set<std::string> GetAllConfigCompileLanguages() const;
+
   void GetObjectSources(std::vector<cmSourceFile const*>&,
                         const std::string& config) const;
   const std::string& GetObjectName(cmSourceFile const* file);
@@ -274,7 +279,8 @@
 
   /** Return the install name directory for the target in the
    * install tree.  For example: "\@rpath/" or "\@loader_path/". */
-  std::string GetInstallNameDirForInstallTree() const;
+  std::string GetInstallNameDirForInstallTree(
+    const std::string& config, const std::string& installPrefix) const;
 
   cmListFileBacktrace GetBacktrace() const;
 
@@ -701,7 +707,8 @@
 
   std::string EvaluateInterfaceProperty(
     std::string const& prop, cmGeneratorExpressionContext* context,
-    cmGeneratorExpressionDAGChecker* dagCheckerParent) const;
+    cmGeneratorExpressionDAGChecker* dagCheckerParent,
+    bool usage_requirements_only = true) const;
 
   bool HaveInstallTreeRPATH(const std::string& config) const;
 
@@ -816,10 +823,10 @@
   mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
 
   using cmTargetLinkInformationMap =
-    std::map<std::string, cmComputeLinkInformation*>;
+    std::map<std::string, std::unique_ptr<cmComputeLinkInformation>>;
   mutable cmTargetLinkInformationMap LinkInformation;
 
-  void CheckPropertyCompatibility(cmComputeLinkInformation* info,
+  void CheckPropertyCompatibility(cmComputeLinkInformation& info,
                                   const std::string& config) const;
 
   struct LinkImplClosure : public std::vector<cmGeneratorTarget const*>
@@ -880,16 +887,20 @@
 
   mutable std::unordered_map<std::string, bool> MaybeInterfacePropertyExists;
   bool MaybeHaveInterfaceProperty(std::string const& prop,
-                                  cmGeneratorExpressionContext* context) const;
+                                  cmGeneratorExpressionContext* context,
+                                  bool usage_requirements_only) const;
 
-  std::vector<TargetPropertyEntry*> IncludeDirectoriesEntries;
-  std::vector<TargetPropertyEntry*> CompileOptionsEntries;
-  std::vector<TargetPropertyEntry*> CompileFeaturesEntries;
-  std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
-  std::vector<TargetPropertyEntry*> LinkOptionsEntries;
-  std::vector<TargetPropertyEntry*> LinkDirectoriesEntries;
-  std::vector<TargetPropertyEntry*> PrecompileHeadersEntries;
-  std::vector<TargetPropertyEntry*> SourceEntries;
+  using TargetPropertyEntryVector =
+    std::vector<std::unique_ptr<TargetPropertyEntry>>;
+
+  TargetPropertyEntryVector IncludeDirectoriesEntries;
+  TargetPropertyEntryVector CompileOptionsEntries;
+  TargetPropertyEntryVector CompileFeaturesEntries;
+  TargetPropertyEntryVector CompileDefinitionsEntries;
+  TargetPropertyEntryVector LinkOptionsEntries;
+  TargetPropertyEntryVector LinkDirectoriesEntries;
+  TargetPropertyEntryVector PrecompileHeadersEntries;
+  TargetPropertyEntryVector SourceEntries;
   mutable std::set<std::string> LinkImplicitNullProperties;
   mutable std::map<std::string, std::string> PchHeaders;
   mutable std::map<std::string, std::string> PchSources;
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index 9fa4467..d6c0a87 100644
--- a/Source/cmGlobalCommonGenerator.cxx
+++ b/Source/cmGlobalCommonGenerator.cxx
@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGlobalCommonGenerator.h"
 
+#include <memory>
 #include <utility>
 
 #include "cmGeneratorTarget.h"
@@ -32,7 +33,7 @@
 
     // The directory-level rule should depend on the target-level rules
     // for all targets in the directory.
-    for (auto gt : lg->GetGeneratorTargets()) {
+    for (const auto& gt : lg->GetGeneratorTargets()) {
       cmStateEnums::TargetType const type = gt->GetType();
       if (type != cmStateEnums::EXECUTABLE &&
           type != cmStateEnums::STATIC_LIBRARY &&
@@ -43,7 +44,7 @@
         continue;
       }
       DirectoryTarget::Target t;
-      t.GT = gt;
+      t.GT = gt.get();
       if (const char* exclude = gt->GetProperty("EXCLUDE_FROM_ALL")) {
         if (cmIsOn(exclude)) {
           // This target has been explicitly excluded.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 09fb87d..0e782f2 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -10,6 +10,9 @@
 #include <initializer_list>
 #include <iterator>
 #include <sstream>
+#include <utility>
+
+#include <cm/memory>
 
 #include "cmsys/Directory.hxx"
 #include "cmsys/FStream.hxx"
@@ -31,6 +34,7 @@
 #include "cmGeneratorTarget.h"
 #include "cmInstallGenerator.h"
 #include "cmLinkLineComputer.h"
+#include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 #include "cmMSVC60LinkLineComputer.h"
 #include "cmMakefile.h"
@@ -121,6 +125,7 @@
 {
   Json::Value generator = Json::objectValue;
   generator["name"] = this->GetName();
+  generator["multiConfig"] = this->IsMultiConfig();
   return generator;
 }
 #endif
@@ -165,7 +170,7 @@
   return false;
 }
 
-bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts,
+bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts, bool,
                                             cmMakefile* mf)
 {
   if (ts.empty()) {
@@ -296,7 +301,7 @@
 {
   bool failed = false;
   for (cmLocalGenerator* localGen : this->LocalGenerators) {
-    for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) {
+    for (const auto& target : localGen->GetGeneratorTargets()) {
       if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET ||
           target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY ||
           target->GetType() == cmStateEnums::TargetType::UTILITY ||
@@ -336,7 +341,7 @@
   }
   bool failed = false;
   for (cmLocalGenerator* generator : this->LocalGenerators) {
-    for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) {
+    for (const auto& target : generator->GetGeneratorTargets()) {
       if (target->GetType() == cmStateEnums::EXECUTABLE &&
           target->GetPropertyAsBool("WIN32_EXECUTABLE")) {
         std::vector<std::string> const& configs =
@@ -364,7 +369,7 @@
   }
   bool failed = false;
   for (cmLocalGenerator* generator : this->LocalGenerators) {
-    for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) {
+    for (const auto& target : generator->GetGeneratorTargets()) {
       if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET ||
           target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY ||
           target->GetType() == cmStateEnums::TargetType::UTILITY ||
@@ -650,7 +655,7 @@
 
     // Tell the generator about the toolset, if any.
     std::string toolset = mf->GetSafeDefinition("CMAKE_GENERATOR_TOOLSET");
-    if (!this->SetGeneratorToolset(toolset, mf)) {
+    if (!this->SetGeneratorToolset(toolset, false, mf)) {
       cmSystemTools::SetFatalErrorOccured();
       return;
     }
@@ -1258,10 +1263,6 @@
                                           "number of local generators",
                                           cmStateEnums::INTERNAL);
 
-  // check for link libraries and include directories containing "NOTFOUND"
-  // and for infinite loops
-  this->CheckTargetProperties();
-
   if (this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) {
     std::ostringstream msg;
     if (cmSystemTools::GetErrorOccuredFlag()) {
@@ -1284,6 +1285,10 @@
 void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
 {
   this->CreateLocalGenerators();
+  // Commit side effects only if we are actually generating
+  if (this->GetConfigureDoneCMP0026()) {
+    this->CheckTargetProperties();
+  }
   this->CreateGeneratorTargets(targetTypes);
   this->ComputeBuildFileGenerators();
 }
@@ -1460,6 +1465,8 @@
 
   this->ProcessEvaluationFiles();
 
+  this->CMakeInstance->UpdateProgress("Generating", 0.1f);
+
   // Generate project files
   for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
     this->SetCurrentMakefile(this->LocalGenerators[i]->GetMakefile());
@@ -1471,8 +1478,9 @@
     this->LocalGenerators[i]->GenerateTestFiles();
     this->CMakeInstance->UpdateProgress(
       "Generating",
-      (static_cast<float>(i) + 1.0f) /
-        static_cast<float>(this->LocalGenerators.size()));
+      0.1f +
+        0.9f * (static_cast<float>(i) + 1.0f) /
+          static_cast<float>(this->LocalGenerators.size()));
   }
   this->SetCurrentMakefile(nullptr);
 
@@ -1557,14 +1565,14 @@
 {
   for (cmLocalGenerator* lg : this->LocalGenerators) {
     lg->CreateEvaluationFileOutputs();
-    for (cmGeneratorTarget* gt : lg->GetGeneratorTargets()) {
+    for (const auto& gt : lg->GetGeneratorTargets()) {
       if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
           gt->GetType() == cmStateEnums::UTILITY ||
           gt->GetType() == cmStateEnums::GLOBAL_TARGET) {
         continue;
       }
-      lg->AddUnityBuild(gt);
-      lg->AddPchDependencies(gt);
+      lg->AddUnityBuild(gt.get());
+      lg->AddPchDependencies(gt.get());
     }
   }
   // The above transformations may have changed the classification of sources.
@@ -1572,7 +1580,7 @@
   // targets so that it will be recomputed correctly by the generators later
   // now that the above transformations are done for all targets.
   for (cmLocalGenerator* lg : this->LocalGenerators) {
-    for (cmGeneratorTarget* gt : lg->GetGeneratorTargets()) {
+    for (const auto& gt : lg->GetGeneratorTargets()) {
       gt->ClearSourcesCache();
     }
   }
@@ -1661,8 +1669,7 @@
   if (targetTypes == AllTargets) {
     for (auto& target : mf->GetTargets()) {
       cmTarget* t = &target.second;
-      cmGeneratorTarget* gt = new cmGeneratorTarget(t, lg);
-      lg->AddGeneratorTarget(gt);
+      lg->AddGeneratorTarget(cm::make_unique<cmGeneratorTarget>(t, lg));
     }
   }
 
@@ -1678,9 +1685,9 @@
     cmMakefile* mf = this->Makefiles[i];
     for (cmTarget* ownedImpTgt : mf->GetOwnedImportedTargets()) {
       cmLocalGenerator* lg = this->LocalGenerators[i];
-      cmGeneratorTarget* gt = new cmGeneratorTarget(ownedImpTgt, lg);
-      lg->AddOwnedImportedGeneratorTarget(gt);
-      importedMap[ownedImpTgt] = gt;
+      auto gt = cm::make_unique<cmGeneratorTarget>(ownedImpTgt, lg);
+      importedMap[ownedImpTgt] = gt.get();
+      lg->AddOwnedImportedGeneratorTarget(std::move(gt));
     }
   }
 
@@ -1722,12 +1729,12 @@
 
 void cmGlobalGenerator::CheckTargetProperties()
 {
+  // check for link libraries and include directories containing "NOTFOUND"
+  // and for infinite loops
   std::map<std::string, std::string> notFoundMap;
-  //  std::set<std::string> notFoundMap;
-  // after it is all done do a ConfigureFinalPass
   cmState* state = this->GetCMakeInstance()->GetState();
   for (unsigned int i = 0; i < this->Makefiles.size(); ++i) {
-    this->Makefiles[i]->ConfigureFinalPass();
+    this->Makefiles[i]->Generate(*this->LocalGenerators[i]);
     for (auto const& target : this->Makefiles[i]->GetTargets()) {
       if (target.second.GetType() == cmStateEnums::INTERFACE_LIBRARY) {
         continue;
@@ -1771,11 +1778,6 @@
         }
       }
     }
-    this->CMakeInstance->UpdateProgress(
-      "Configuring",
-      0.9f +
-        0.1f * (static_cast<float>(i) + 1.0f) /
-          static_cast<float>(this->Makefiles.size()));
   }
 
   if (!notFoundMap.empty()) {
@@ -2025,10 +2027,10 @@
   }
 
   int numGen = atoi(numGenC->c_str());
-  float prog = 0.9f * static_cast<float>(this->Makefiles.size()) /
-    static_cast<float>(numGen);
-  if (prog > 0.9f) {
-    prog = 0.9f;
+  float prog =
+    static_cast<float>(this->Makefiles.size()) / static_cast<float>(numGen);
+  if (prog > 1.0f) {
+    prog = 1.0f;
   }
   this->CMakeInstance->UpdateProgress("Configuring", prog);
 }
@@ -2660,8 +2662,8 @@
   std::vector<std::string> no_byproducts;
   std::vector<std::string> no_depends;
   // Store the custom command in the target.
-  cmCustomCommand cc(nullptr, no_outputs, no_byproducts, no_depends,
-                     gti.CommandLines, nullptr, gti.WorkingDir.c_str());
+  cmCustomCommand cc(no_outputs, no_byproducts, no_depends, gti.CommandLines,
+                     cmListFileBacktrace(), nullptr, gti.WorkingDir.c_str());
   cc.SetUsesTerminal(gti.UsesTerminal);
   target.AddPostBuildCommand(std::move(cc));
   if (!gti.Message.empty()) {
@@ -2777,15 +2779,15 @@
       continue;
     }
     // loop over all the generator targets in the makefile
-    for (cmGeneratorTarget* target : generator->GetGeneratorTargets()) {
-      if (this->IsRootOnlyTarget(target) &&
+    for (const auto& target : generator->GetGeneratorTargets()) {
+      if (this->IsRootOnlyTarget(target.get()) &&
           target->GetLocalGenerator() != root) {
         continue;
       }
       // put the target in the set of original targets
-      originalTargets.insert(target);
+      originalTargets.insert(target.get());
       // Get the set of targets that depend on target
-      this->AddTargetDepends(target, projectTargets);
+      this->AddTargetDepends(target.get(), projectTargets);
     }
   }
 }
@@ -2962,11 +2964,11 @@
   cmGeneratedFileStream fout(fname);
 
   for (cmLocalGenerator* lg : this->LocalGenerators) {
-    for (cmGeneratorTarget* tgt : lg->GetGeneratorTargets()) {
+    for (const auto& tgt : lg->GetGeneratorTargets()) {
       if (tgt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
         continue;
       }
-      this->WriteSummary(tgt);
+      this->WriteSummary(tgt.get());
       fout << tgt->GetSupportDirectory() << "\n";
     }
   }
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index f25ff7b..0e87357 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -128,7 +128,8 @@
 
   /** Set the generator-specific toolset name.  Returns true if toolset
       is supported and false otherwise.  */
-  virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
+  virtual bool SetGeneratorToolset(std::string const& ts, bool build,
+                                   cmMakefile* mf);
 
   /**
    * Create LocalGenerators and process the CMakeLists files. This does not
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 5a708ab..7afcd49 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -64,8 +64,11 @@
 }
 
 bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
-                                                    cmMakefile* mf)
+                                                    bool build, cmMakefile* mf)
 {
+  if (build) {
+    return true;
+  }
   std::string tsp; /* toolset path */
 
   this->GetToolset(mf, tsp, ts);
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index ccfe073..7cd8c79 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -58,7 +58,8 @@
   static bool SupportsPlatform() { return true; }
 
   // Toolset / Platform Support
-  bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override;
+  bool SetGeneratorToolset(std::string const& ts, bool build,
+                           cmMakefile* mf) override;
   bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
 
   /**
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 4c2d69f..dfc495e 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -374,16 +374,15 @@
   for (cmLocalGenerator* lGenerator : lGenerators) {
     lg = static_cast<cmLocalUnixMakefileGenerator3*>(lGenerator);
     // for all of out targets
-    for (cmGeneratorTarget* tgt : lg->GetGeneratorTargets()) {
+    for (const auto& tgt : lg->GetGeneratorTargets()) {
       if ((tgt->GetType() == cmStateEnums::EXECUTABLE) ||
           (tgt->GetType() == cmStateEnums::STATIC_LIBRARY) ||
           (tgt->GetType() == cmStateEnums::SHARED_LIBRARY) ||
           (tgt->GetType() == cmStateEnums::MODULE_LIBRARY) ||
           (tgt->GetType() == cmStateEnums::OBJECT_LIBRARY) ||
           (tgt->GetType() == cmStateEnums::UTILITY)) {
-        cmGeneratorTarget* gt = tgt;
-        std::string tname =
-          cmStrCat(lg->GetRelativeTargetDirectory(gt), "/DependInfo.cmake");
+        std::string tname = cmStrCat(lg->GetRelativeTargetDirectory(tgt.get()),
+                                     "/DependInfo.cmake");
         cmSystemTools::ConvertToUnixSlashes(tname);
         cmakefileStream << "  \"" << tname << "\"\n";
       }
@@ -549,7 +548,7 @@
     cmLocalUnixMakefileGenerator3* lg =
       static_cast<cmLocalUnixMakefileGenerator3*>(localGen);
     // for each target Generate the rule files for each target.
-    for (cmGeneratorTarget* gtarget : lg->GetGeneratorTargets()) {
+    for (const auto& gtarget : lg->GetGeneratorTargets()) {
       // Don't emit the same rule twice (e.g. two targets with the same
       // simple name)
       int type = gtarget->GetType();
@@ -580,7 +579,7 @@
                           depends, commands, true);
 
         // Add a fast rule to build the target
-        std::string localName = lg->GetRelativeTargetDirectory(gtarget);
+        std::string localName = lg->GetRelativeTargetDirectory(gtarget.get());
         std::string makefileName;
         makefileName = cmStrCat(localName, "/build.make");
         depends.clear();
@@ -595,8 +594,8 @@
         // Add a local name for the rule to relink the target before
         // installation.
         if (gtarget->NeedRelinkBeforeInstall(lg->GetConfigName())) {
-          makeTargetName =
-            cmStrCat(lg->GetRelativeTargetDirectory(gtarget), "/preinstall");
+          makeTargetName = cmStrCat(
+            lg->GetRelativeTargetDirectory(gtarget.get()), "/preinstall");
           localName = cmStrCat(name, "/preinstall");
           depends.clear();
           commands.clear();
@@ -625,7 +624,7 @@
   }
 
   // for each target Generate the rule files for each target.
-  for (cmGeneratorTarget* gtarget : lg->GetGeneratorTargets()) {
+  for (const auto& gtarget : lg->GetGeneratorTargets()) {
     int type = gtarget->GetType();
     std::string name = gtarget->GetName();
     if (!name.empty() &&
@@ -637,7 +636,7 @@
          (type == cmStateEnums::UTILITY))) {
       std::string makefileName;
       // Add a rule to build the target by name.
-      localName = lg->GetRelativeTargetDirectory(gtarget);
+      localName = lg->GetRelativeTargetDirectory(gtarget.get());
       makefileName = cmStrCat(localName, "/build.make");
 
       lg->WriteDivider(ruleFileStream);
@@ -661,7 +660,7 @@
       {
         std::ostringstream progressArg;
         const char* sep = "";
-        for (unsigned long progFile : this->ProgressMap[gtarget].Marks) {
+        for (unsigned long progFile : this->ProgressMap[gtarget.get()].Marks) {
           progressArg << sep << progFile;
           sep = ",";
         }
@@ -680,7 +679,7 @@
                        cmLocalUnixMakefileGenerator3::EchoNormal, &progress);
       }
 
-      this->AppendGlobalTargetDepends(depends, gtarget);
+      this->AppendGlobalTargetDepends(depends, gtarget.get());
       lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
                         localName, depends, commands, true);
 
@@ -697,7 +696,8 @@
           cmOutputConverter::SHELL);
         //
         std::set<cmGeneratorTarget const*> emitted;
-        progCmd << " " << this->CountProgressMarksInTarget(gtarget, emitted);
+        progCmd << " "
+                << this->CountProgressMarksInTarget(gtarget.get(), emitted);
         commands.push_back(progCmd.str());
       }
       std::string tmp = "CMakeFiles/Makefile2";
@@ -715,7 +715,8 @@
       if (regenerate) {
         depends.emplace_back("cmake_check_build_system");
       }
-      localName = cmStrCat(lg->GetRelativeTargetDirectory(gtarget), "/rule");
+      localName =
+        cmStrCat(lg->GetRelativeTargetDirectory(gtarget.get()), "/rule");
       lg->WriteMakeRule(ruleFileStream,
                         "Build rule for subdir invocation for target.",
                         localName, depends, commands, true);
@@ -729,8 +730,8 @@
 
       // Add rules to prepare the target for installation.
       if (gtarget->NeedRelinkBeforeInstall(lg->GetConfigName())) {
-        localName =
-          cmStrCat(lg->GetRelativeTargetDirectory(gtarget), "/preinstall");
+        localName = cmStrCat(lg->GetRelativeTargetDirectory(gtarget.get()),
+                             "/preinstall");
         depends.clear();
         commands.clear();
         commands.push_back(lg->GetRecursiveMakeCall(makefileName, localName));
@@ -740,7 +741,7 @@
       }
 
       // add the clean rule
-      localName = lg->GetRelativeTargetDirectory(gtarget);
+      localName = lg->GetRelativeTargetDirectory(gtarget.get());
       makeTargetName = cmStrCat(localName, "/clean");
       depends.clear();
       commands.clear();
@@ -760,7 +761,7 @@
   this->DirectoryTargetsMap.clear();
   // Loop over all targets in all local generators.
   for (cmLocalGenerator* lg : this->LocalGenerators) {
-    for (cmGeneratorTarget* gt : lg->GetGeneratorTargets()) {
+    for (const auto& gt : lg->GetGeneratorTargets()) {
       cmLocalGenerator* tlg = gt->GetLocalGenerator();
 
       if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
@@ -778,12 +779,13 @@
         // This local generator includes the target.
         std::set<cmGeneratorTarget const*>& targetSet =
           this->DirectoryTargetsMap[csnp];
-        targetSet.insert(gt);
+        targetSet.insert(gt.get());
 
         // Add dependencies of the included target.  An excluded
         // target may still be included if it is a dependency of a
         // non-excluded target.
-        for (cmTargetDepend const& tgtdep : this->GetTargetDirectDepends(gt)) {
+        for (cmTargetDepend const& tgtdep :
+             this->GetTargetDirectDepends(gt.get())) {
           targetSet.insert(tgtdep);
         }
       }
@@ -894,7 +896,7 @@
     // the targets
     if (lg2 == lg || lg->IsRootMakefile()) {
       // for each target Generate the rule files for each target.
-      for (cmGeneratorTarget* target : lg2->GetGeneratorTargets()) {
+      for (const auto& target : lg2->GetGeneratorTargets()) {
         cmStateEnums::TargetType type = target->GetType();
         if ((type == cmStateEnums::EXECUTABLE) ||
             (type == cmStateEnums::STATIC_LIBRARY) ||
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 09a49e1..5b83e2f 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -26,6 +26,16 @@
 static const char vs10generatorName[] = "Visual Studio 10 2010";
 static std::map<std::string, std::vector<cmIDEFlagTable>> loadedFlagJsonFiles;
 
+static void ConvertToWindowsSlashes(std::string& s)
+{
+  // first convert all of the slashes
+  for (auto& ch : s) {
+    if (ch == '/') {
+      ch = '\\';
+    }
+  }
+}
+
 // Map generator name without year to name with year.
 static const char* cmVS10GenName(const std::string& name, std::string& genName)
 {
@@ -193,7 +203,7 @@
 }
 
 bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
-  std::string const& ts, cmMakefile* mf)
+  std::string const& ts, bool build, cmMakefile* mf)
 {
   if (this->SystemIsWindowsCE && ts.empty() &&
       this->DefaultPlatformToolset.empty()) {
@@ -208,7 +218,11 @@
     return false;
   }
 
-  if (!this->FindVCTargetsPath(mf)) {
+  if (build) {
+    return true;
+  }
+
+  if (this->CustomVCTargetsPath.empty() && !this->FindVCTargetsPath(mf)) {
     return false;
   }
 
@@ -349,6 +363,11 @@
   if (const char* cudaDir = this->GetPlatformToolsetCudaCustomDir()) {
     mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR", cudaDir);
   }
+  if (const char* vcTargetsDir = this->GetCustomVCTargetsPath()) {
+    mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR",
+                      vcTargetsDir);
+  }
+
   return true;
 }
 
@@ -442,6 +461,11 @@
     this->GeneratorToolsetVersion = value;
     return true;
   }
+  if (key == "VCTargetsPath") {
+    this->CustomVCTargetsPath = value;
+    ConvertToWindowsSlashes(this->CustomVCTargetsPath);
+    return true;
+  }
   return false;
 }
 
@@ -603,6 +627,14 @@
   cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
 }
 
+const char* cmGlobalVisualStudio10Generator::GetCustomVCTargetsPath() const
+{
+  if (this->CustomVCTargetsPath.empty()) {
+    return nullptr;
+  }
+  return this->CustomVCTargetsPath.c_str();
+}
+
 const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
 {
   std::string const& toolset = this->GetPlatformToolsetString();
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 9adcf08..8a76047 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -20,7 +20,8 @@
 
   bool SetSystemName(std::string const& s, cmMakefile* mf) override;
   bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
-  bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override;
+  bool SetGeneratorToolset(std::string const& ts, bool build,
+                           cmMakefile* mf) override;
 
   std::vector<GeneratedMakeCommand> GenerateBuildCommand(
     const std::string& makeProgram, const std::string& projectName,
@@ -45,6 +46,9 @@
   bool IsNsightTegra() const;
   std::string GetNsightTegraVersion() const;
 
+  /** The vctargets path for the target platform.  */
+  const char* GetCustomVCTargetsPath() const;
+
   /** The toolset name for the target platform.  */
   const char* GetPlatformToolset() const;
   std::string const& GetPlatformToolsetString() const;
@@ -155,6 +159,7 @@
   std::string GeneratorToolset;
   std::string GeneratorToolsetVersion;
   std::string GeneratorToolsetHostArchitecture;
+  std::string GeneratorToolsetCustomVCTargetsDir;
   std::string GeneratorToolsetCuda;
   std::string GeneratorToolsetCudaCustomDir;
   std::string DefaultPlatformToolset;
@@ -206,6 +211,7 @@
 
   bool ParseGeneratorToolset(std::string const& ts, cmMakefile* mf);
 
+  std::string CustomVCTargetsPath;
   std::string VCTargetsPath;
   bool FindVCTargetsPath(cmMakefile* mf);
 
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 8e6125b..ea603b0 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGlobalVisualStudio8Generator.h"
 
+#include <cm/memory>
+
 #include "cmCustomCommand.h"
 #include "cmCustomCommandLines.h"
 #include "cmDocumentationEntry.h"
@@ -99,18 +101,18 @@
   std::vector<cmLocalGenerator*> const& generators = this->LocalGenerators;
   cmLocalVisualStudio7Generator* lg =
     static_cast<cmLocalVisualStudio7Generator*>(generators[0]);
-  cmMakefile* mf = lg->GetMakefile();
 
   const char* no_working_directory = nullptr;
   std::vector<std::string> no_byproducts;
   std::vector<std::string> no_depends;
   cmCustomCommandLines no_commands;
-  cmTarget* tgt = mf->AddUtilityCommand(
-    CMAKE_CHECK_BUILD_SYSTEM_TARGET, cmCommandOrigin::Generator, false,
-    no_working_directory, no_byproducts, no_depends, no_commands);
+  cmTarget* tgt = lg->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false,
+                                        no_working_directory, no_byproducts,
+                                        no_depends, no_commands);
 
-  cmGeneratorTarget* gt = new cmGeneratorTarget(tgt, lg);
-  lg->AddGeneratorTarget(gt);
+  auto ptr = cm::make_unique<cmGeneratorTarget>(tgt, lg);
+  auto gt = ptr.get();
+  lg->AddGeneratorTarget(std::move(ptr));
 
   // Organize in the "predefined targets" folder:
   //
@@ -153,7 +155,7 @@
       std::vector<std::string> byproducts;
       byproducts.push_back(cm->GetGlobVerifyStamp());
 
-      mf->AddCustomCommandToTarget(
+      lg->AddCustomCommandToTarget(
         CMAKE_CHECK_BUILD_SYSTEM_TARGET, byproducts, no_depends,
         verifyCommandLines, cmCustomCommandType::PRE_BUILD,
         "Checking File Globs", no_working_directory, false);
@@ -185,7 +187,7 @@
     // (this could be avoided with per-target source files)
     std::string no_main_dependency;
     cmImplicitDependsList no_implicit_depends;
-    if (cmSourceFile* file = mf->AddCustomCommandToOutput(
+    if (cmSourceFile* file = lg->AddCustomCommandToOutput(
           stamps, no_byproducts, listFiles, no_main_dependency,
           no_implicit_depends, commandLines, "Checking Build System",
           no_working_directory, true, false)) {
@@ -203,10 +205,9 @@
   cmGlobalVisualStudio7Generator::AddExtraIDETargets();
   if (this->AddCheckTarget()) {
     for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
-      const std::vector<cmGeneratorTarget*>& tgts =
-        this->LocalGenerators[i]->GetGeneratorTargets();
+      const auto& tgts = this->LocalGenerators[i]->GetGeneratorTargets();
       // All targets depend on the build-system check target.
-      for (cmGeneratorTarget const* ti : tgts) {
+      for (const auto& ti : tgts) {
         if (ti->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
           ti->Target->AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
         }
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index ed0cba7..be5cfd4 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -7,6 +7,7 @@
 #include <iostream>
 
 #include <cm/iterator>
+#include <cm/memory>
 
 #include <windows.h>
 
@@ -196,12 +197,12 @@
     if (!gen.empty()) {
       // Use no actual command lines so that the target itself is not
       // considered always out of date.
-      cmTarget* allBuild = gen[0]->GetMakefile()->AddUtilityCommand(
-        "ALL_BUILD", cmCommandOrigin::Generator, true, no_working_dir,
-        no_byproducts, no_depends, no_commands, false, "Build all projects");
+      cmTarget* allBuild = gen[0]->AddUtilityCommand(
+        "ALL_BUILD", true, no_working_dir, no_byproducts, no_depends,
+        no_commands, false, "Build all projects");
 
-      cmGeneratorTarget* gt = new cmGeneratorTarget(allBuild, gen[0]);
-      gen[0]->AddGeneratorTarget(gt);
+      gen[0]->AddGeneratorTarget(
+        cm::make_unique<cmGeneratorTarget>(allBuild, gen[0]));
 
       //
       // Organize in the "predefined targets" folder:
@@ -212,12 +213,12 @@
 
       // Now make all targets depend on the ALL_BUILD target
       for (cmLocalGenerator const* i : gen) {
-        for (cmGeneratorTarget* tgt : i->GetGeneratorTargets()) {
+        for (const auto& tgt : i->GetGeneratorTargets()) {
           if (tgt->GetType() == cmStateEnums::GLOBAL_TARGET ||
               tgt->IsImported()) {
             continue;
           }
-          if (!this->IsExcluded(gen[0], tgt)) {
+          if (!this->IsExcluded(gen[0], tgt.get())) {
             allBuild->AddUtility(tgt->GetName());
           }
         }
@@ -389,8 +390,8 @@
   }
   for (auto const& it : this->ProjectMap) {
     for (const cmLocalGenerator* i : it.second) {
-      for (cmGeneratorTarget* ti : i->GetGeneratorTargets()) {
-        this->ComputeVSTargetDepends(ti);
+      for (const auto& ti : i->GetGeneratorTargets()) {
+        this->ComputeVSTargetDepends(ti.get());
       }
     }
   }
@@ -799,19 +800,9 @@
 bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
   cmGeneratorTarget const* gt)
 {
-  // check to see if this is a fortran build
-  {
-    // Issue diagnostic if the source files depend on the config.
-    std::vector<cmSourceFile*> sources;
-    if (!gt->GetConfigCommonSourceFiles(sources)) {
-      return false;
-    }
-  }
-
   // If there's only one source language, Fortran has to be used
   // in order for the sources to compile.
-  std::set<std::string> languages;
-  gt->GetLanguages(languages, "");
+  std::set<std::string> languages = gt->GetAllConfigCompileLanguages();
   // Consider an explicit linker language property, but *not* the
   // computed linker language that may depend on linked targets.
   // This allows the project to control the language choice in
@@ -939,9 +930,10 @@
 
   cmCustomCommandLines commandLines = cmMakeSingleCommandLine(
     { cmakeCommand, "-E", "__create_def", mdi->DefFile, objs_file });
-  cmCustomCommand command(gt->Target->GetMakefile(), outputs, empty, empty,
-                          commandLines, "Auto build dll exports", ".");
-  commands.push_back(command);
+  cmCustomCommand command(outputs, empty, empty, commandLines,
+                          gt->Target->GetMakefile()->GetBacktrace(),
+                          "Auto build dll exports", ".");
+  commands.push_back(std::move(command));
 }
 
 static bool OpenSolution(std::string sln)
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3002b2a..d75c489 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGlobalXCodeGenerator.h"
 
+#include <algorithm>
 #include <cassert>
 #include <cstdio>
 #include <cstring>
@@ -267,7 +268,7 @@
 }
 
 bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts,
-                                                 cmMakefile* mf)
+                                                 bool build, cmMakefile* mf)
 {
   if (ts.find_first_of(",=") != std::string::npos) {
     std::ostringstream e;
@@ -283,6 +284,9 @@
     return false;
   }
   this->GeneratorToolset = ts;
+  if (build) {
+    return true;
+  }
   if (!this->GeneratorToolset.empty()) {
     mf->AddDefinition("CMAKE_XCODE_PLATFORM_TOOLSET", this->GeneratorToolset);
   }
@@ -409,10 +413,10 @@
 {
   size_t index = 0;
   auto const& lgens = this->GetLocalGenerators();
-  for (cmLocalGenerator* lgen : lgens) {
-    auto const& targets = lgen->GetGeneratorTargets();
-    for (cmGeneratorTarget const* gt : targets) {
-      this->ComputeTargetOrder(gt, index);
+  for (auto const& lgen : lgens) {
+    const auto& targets = lgen->GetGeneratorTargets();
+    for (const auto& gt : targets) {
+      this->ComputeTargetOrder(gt.get(), index);
     }
   }
   assert(index == this->TargetOrderIndex.size());
@@ -496,20 +500,16 @@
 void cmGlobalXCodeGenerator::AddExtraTargets(
   cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens)
 {
-  cmMakefile* mf = root->GetMakefile();
-
   const char* no_working_directory = nullptr;
   std::vector<std::string> no_byproducts;
   std::vector<std::string> no_depends;
 
   // Add ALL_BUILD
-  cmTarget* allbuild = mf->AddUtilityCommand(
-    "ALL_BUILD", cmCommandOrigin::Generator, true, no_working_directory,
-    no_byproducts, no_depends,
+  cmTarget* allbuild = root->AddUtilityCommand(
+    "ALL_BUILD", true, no_working_directory, no_byproducts, no_depends,
     cmMakeSingleCommandLine({ "echo", "Build all projects" }));
 
-  cmGeneratorTarget* allBuildGt = new cmGeneratorTarget(allbuild, root);
-  root->AddGeneratorTarget(allBuildGt);
+  root->AddGeneratorTarget(cm::make_unique<cmGeneratorTarget>(allbuild, root));
 
   // Add XCODE depend helper
   std::string dir = root->GetCurrentBinaryDirectory();
@@ -520,7 +520,7 @@
   // Add ZERO_CHECK
   bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
   bool generateTopLevelProjectOnly =
-    mf->IsOn("CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY");
+    root->GetMakefile()->IsOn("CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY");
   bool isTopLevel =
     !root->GetStateSnapshot().GetBuildsystemDirectoryParent().IsValid();
   if (regenerate && (isTopLevel || !generateTopLevelProjectOnly)) {
@@ -528,19 +528,18 @@
     std::string file =
       this->ConvertToRelativeForMake(this->CurrentReRunCMakeMakefile);
     cmSystemTools::ReplaceString(file, "\\ ", " ");
-    cmTarget* check = mf->AddUtilityCommand(
-      CMAKE_CHECK_BUILD_SYSTEM_TARGET, cmCommandOrigin::Generator, true,
-      no_working_directory, no_byproducts, no_depends,
-      cmMakeSingleCommandLine({ "make", "-f", file }));
+    cmTarget* check =
+      root->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, true,
+                              no_working_directory, no_byproducts, no_depends,
+                              cmMakeSingleCommandLine({ "make", "-f", file }));
 
-    cmGeneratorTarget* checkGt = new cmGeneratorTarget(check, root);
-    root->AddGeneratorTarget(checkGt);
+    root->AddGeneratorTarget(cm::make_unique<cmGeneratorTarget>(check, root));
   }
 
   // now make the allbuild depend on all the non-utility targets
   // in the project
   for (auto& gen : gens) {
-    for (auto target : gen->GetGeneratorTargets()) {
+    for (const auto& target : gen->GetGeneratorTargets()) {
       if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
         continue;
       }
@@ -557,14 +556,14 @@
       if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
         commandLines.front().back() = // fill placeholder
           this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)");
-        gen->GetMakefile()->AddCustomCommandToTarget(
+        gen->AddCustomCommandToTarget(
           target->GetName(), no_byproducts, no_depends, commandLines,
           cmCustomCommandType::POST_BUILD, "Depend check for xcode",
           dir.c_str(), true, false, "", "", false,
           cmObjectLibraryCommands::Accept);
       }
 
-      if (!this->IsExcluded(gens[0], target)) {
+      if (!this->IsExcluded(gens[0], target.get())) {
         allbuild->AddUtility(target->GetName());
       }
     }
@@ -1093,8 +1092,8 @@
   cmLocalGenerator* gen, std::vector<cmXCodeObject*>& targets)
 {
   this->SetCurrentLocalGenerator(gen);
-  std::vector<cmGeneratorTarget*> gts =
-    this->CurrentLocalGenerator->GetGeneratorTargets();
+  std::vector<cmGeneratorTarget*> gts;
+  cmAppend(gts, this->CurrentLocalGenerator->GetGeneratorTargets());
   std::sort(gts.begin(), gts.end(),
             [this](cmGeneratorTarget const* l, cmGeneratorTarget const* r) {
               return this->TargetOrderIndex[l] < this->TargetOrderIndex[r];
@@ -1366,9 +1365,9 @@
 {
   for (auto localGenerator : this->LocalGenerators) {
     // All targets depend on the build-system check target.
-    for (auto tgt : localGenerator->GetGeneratorTargets()) {
+    for (const auto& tgt : localGenerator->GetGeneratorTargets()) {
       // This makes sure all targets link using the proper language.
-      this->ForceLinkerLanguage(tgt);
+      this->ForceLinkerLanguage(tgt.get());
     }
   }
 }
@@ -1460,12 +1459,12 @@
       { cmSystemTools::GetCMakeCommand(), "-E", "cmake_symlink_library",
         str_file, str_so_file, str_link_file });
 
-    cmCustomCommand command(this->CurrentMakefile, std::vector<std::string>(),
-                            std::vector<std::string>(),
-                            std::vector<std::string>(), cmd,
-                            "Creating symlinks", "");
+    cmCustomCommand command(
+      std::vector<std::string>(), std::vector<std::string>(),
+      std::vector<std::string>(), cmd, this->CurrentMakefile->GetBacktrace(),
+      "Creating symlinks", "");
 
-    postbuild.push_back(command);
+    postbuild.push_back(std::move(command));
   }
 
   std::vector<cmSourceFile*> classes;
@@ -2834,7 +2833,7 @@
   for (auto& generator : generators) {
     cmMakefile* mf = generator->GetMakefile();
     std::vector<cmSourceGroup> sourceGroups = mf->GetSourceGroups();
-    for (auto gtgt : generator->GetGeneratorTargets()) {
+    for (const auto& gtgt : generator->GetGeneratorTargets()) {
       // Same skipping logic here as in CreateXCodeTargets so that we do not
       // end up with (empty anyhow) ZERO_CHECK, install, or test source
       // groups:
@@ -2849,11 +2848,12 @@
         continue;
       }
 
-      auto addSourceToGroup = [this, mf, gtgt,
+      auto addSourceToGroup = [this, mf, &gtgt,
                                &sourceGroups](std::string const& source) {
         cmSourceGroup* sourceGroup = mf->FindSourceGroup(source, sourceGroups);
-        cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup);
-        std::string key = GetGroupMapKeyFromPath(gtgt, source);
+        cmXCodeObject* pbxgroup =
+          this->CreateOrGetPBXGroup(gtgt.get(), sourceGroup);
+        std::string key = GetGroupMapKeyFromPath(gtgt.get(), source);
         this->GroupMap[key] = pbxgroup;
       };
 
@@ -2879,7 +2879,7 @@
 
       // Add the Info.plist we are about to generate for an App Bundle.
       if (gtgt->GetPropertyAsBool("MACOSX_BUNDLE")) {
-        std::string plist = this->ComputeInfoPListLocation(gtgt);
+        std::string plist = this->ComputeInfoPListLocation(gtgt.get());
         cmSourceFile* sf = gtgt->Makefile->GetOrCreateSource(
           plist, true, cmSourceFileLocationKind::Known);
         addSourceToGroup(sf->ResolveFullPath());
@@ -3415,7 +3415,7 @@
           (root->GetMakefile()->GetCMakeInstance()->GetIsInTryCompile() ||
            obj->GetTarget()->GetPropertyAsBool("XCODE_GENERATE_SCHEME"))) {
         const std::string& targetName = obj->GetTarget()->GetName();
-        cmXCodeScheme schm(obj, testables[targetName],
+        cmXCodeScheme schm(root, obj, testables[targetName],
                            this->CurrentConfigurationTypes,
                            this->XcodeVersion);
         schm.WriteXCodeSharedScheme(xcProjDir,
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index af905d0..f60ea72 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -103,7 +103,8 @@
 
   bool ShouldStripResourcePath(cmMakefile*) const override;
 
-  bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override;
+  bool SetGeneratorToolset(std::string const& ts, bool build,
+                           cmMakefile* mf) override;
   void AppendFlag(std::string& flags, std::string const& flag) const;
 
 protected:
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index e0d545d..9c1a924 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -2,176 +2,192 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGraphVizWriter.h"
 
-#include <cstddef>
+#include <cctype>
 #include <iostream>
 #include <memory>
-#include <sstream>
+#include <set>
 #include <utility>
 
+#include <cm/memory>
+
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorTarget.h"
 #include "cmGlobalGenerator.h"
+#include "cmLinkItem.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmState.h"
 #include "cmStateSnapshot.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
-#include "cmTarget.h"
 #include "cmake.h"
 
 namespace {
-enum LinkLibraryScopeType
-{
-  LLT_SCOPE_PUBLIC,
-  LLT_SCOPE_PRIVATE,
-  LLT_SCOPE_INTERFACE
-};
 
-const char* const GRAPHVIZ_PRIVATE_EDEGE_STYLE = "dashed";
-const char* const GRAPHVIZ_INTERFACE_EDEGE_STYLE = "dotted";
+char const* const GRAPHVIZ_EDGE_STYLE_PUBLIC = "solid";
+char const* const GRAPHVIZ_EDGE_STYLE_INTERFACE = "dashed";
+char const* const GRAPHVIZ_EDGE_STYLE_PRIVATE = "dotted";
 
-std::string getLinkLibraryStyle(const LinkLibraryScopeType& type)
-{
-  std::string style;
-  switch (type) {
-    case LLT_SCOPE_PRIVATE:
-      style = "[style = " + std::string(GRAPHVIZ_PRIVATE_EDEGE_STYLE) + "]";
-      break;
-    case LLT_SCOPE_INTERFACE:
-      style = "[style = " + std::string(GRAPHVIZ_INTERFACE_EDEGE_STYLE) + "]";
-      break;
-    default:
-      break;
-  }
-  return style;
-}
+char const* const GRAPHVIZ_NODE_SHAPE_EXECUTABLE = "egg"; // egg-xecutable
 
-const char* getShapeForTarget(const cmGeneratorTarget* target)
+// Normal libraries.
+char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_STATIC = "octagon";
+char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_SHARED = "doubleoctagon";
+char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_MODULE = "tripleoctagon";
+
+char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_INTERFACE = "pentagon";
+char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_OBJECT = "hexagon";
+char const* const GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN = "septagon";
+
+char const* const GRAPHVIZ_NODE_SHAPE_UTILITY = "box";
+
+const char* getShapeForTarget(const cmLinkItem& item)
 {
-  if (!target) {
-    return "ellipse";
+  if (item.Target == nullptr) {
+    return GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN;
   }
 
-  switch (target->GetType()) {
+  switch (item.Target->GetType()) {
     case cmStateEnums::EXECUTABLE:
-      return "house";
+      return GRAPHVIZ_NODE_SHAPE_EXECUTABLE;
     case cmStateEnums::STATIC_LIBRARY:
-      return "diamond";
+      return GRAPHVIZ_NODE_SHAPE_LIBRARY_STATIC;
     case cmStateEnums::SHARED_LIBRARY:
-      return "polygon";
+      return GRAPHVIZ_NODE_SHAPE_LIBRARY_SHARED;
     case cmStateEnums::MODULE_LIBRARY:
-      return "octagon";
+      return GRAPHVIZ_NODE_SHAPE_LIBRARY_MODULE;
+    case cmStateEnums::OBJECT_LIBRARY:
+      return GRAPHVIZ_NODE_SHAPE_LIBRARY_OBJECT;
+    case cmStateEnums::UTILITY:
+      return GRAPHVIZ_NODE_SHAPE_UTILITY;
+    case cmStateEnums::INTERFACE_LIBRARY:
+      return GRAPHVIZ_NODE_SHAPE_LIBRARY_INTERFACE;
+    case cmStateEnums::UNKNOWN_LIBRARY:
     default:
-      break;
+      return GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN;
   }
-
-  return "box";
-}
-
-std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
-  cmTarget* Target, const cmGlobalGenerator* globalGenerator)
-{
-  char sep = ';';
-  std::map<std::string, LinkLibraryScopeType> tokens;
-  size_t start = 0;
-  size_t end = 0;
-
-  const char* pInterfaceLinkLibraries =
-    Target->GetProperty("INTERFACE_LINK_LIBRARIES");
-  const char* pLinkLibraries = Target->GetProperty("LINK_LIBRARIES");
-
-  if (!pInterfaceLinkLibraries && !pLinkLibraries) {
-    return tokens; // target is not linked against any other libraries
-  }
-
-  // make sure we don't touch a null-ptr
-  auto interfaceLinkLibraries =
-    std::string(pInterfaceLinkLibraries ? pInterfaceLinkLibraries : "");
-  auto linkLibraries = std::string(pLinkLibraries ? pLinkLibraries : "");
-
-  // first extract interfaceLinkLibraries
-  while (start < interfaceLinkLibraries.length()) {
-
-    if ((end = interfaceLinkLibraries.find(sep, start)) == std::string::npos) {
-      end = interfaceLinkLibraries.length();
-    }
-
-    std::string element = interfaceLinkLibraries.substr(start, end - start);
-    if (globalGenerator->IsAlias(element)) {
-      const auto tgt = globalGenerator->FindTarget(element);
-      if (tgt) {
-        element = tgt->GetName();
-      }
-    }
-
-    if (std::string::npos == element.find("$<LINK_ONLY:", 0)) {
-      // we assume first, that this library is an interface library.
-      // if we find it again in the linklibraries property, we promote it to an
-      // public library.
-      tokens[element] = LLT_SCOPE_INTERFACE;
-    } else {
-      // this is an private linked static library.
-      // we take care of this case in the second iterator.
-    }
-    start = end + 1;
-  }
-
-  // second extract linkLibraries
-  start = 0;
-  while (start < linkLibraries.length()) {
-
-    if ((end = linkLibraries.find(sep, start)) == std::string::npos) {
-      end = linkLibraries.length();
-    }
-
-    std::string element = linkLibraries.substr(start, end - start);
-    if (globalGenerator->IsAlias(element)) {
-      const auto tgt = globalGenerator->FindTarget(element);
-      if (tgt) {
-        element = tgt->GetName();
-      }
-    }
-
-    if (tokens.find(element) == tokens.end()) {
-      // this library is not found in interfaceLinkLibraries but in
-      // linkLibraries.
-      // this results in a private linked library.
-      tokens[element] = LLT_SCOPE_PRIVATE;
-    } else if (LLT_SCOPE_INTERFACE == tokens[element]) {
-      // this library is found in interfaceLinkLibraries and linkLibraries.
-      // this results in a public linked library.
-      tokens[element] = LLT_SCOPE_PUBLIC;
-    } else {
-      // private and public linked libraries should not be changed anymore.
-    }
-
-    start = end + 1;
-  }
-
-  return tokens;
 }
 }
 
-cmGraphVizWriter::cmGraphVizWriter(const cmGlobalGenerator* globalGenerator)
-  : GraphType("digraph")
-  , GraphName("GG")
+cmGraphVizWriter::cmGraphVizWriter(std::string const& fileName,
+                                   const cmGlobalGenerator* globalGenerator)
+  : FileName(fileName)
+  , GlobalFileStream(fileName)
+  , GraphName(globalGenerator->GetSafeGlobalSetting("CMAKE_PROJECT_NAME"))
   , GraphHeader("node [\n  fontsize = \"12\"\n];")
   , GraphNodePrefix("node")
   , GlobalGenerator(globalGenerator)
-  , LocalGenerators(globalGenerator->GetLocalGenerators())
+  , NextNodeId(0)
   , GenerateForExecutables(true)
   , GenerateForStaticLibs(true)
   , GenerateForSharedLibs(true)
   , GenerateForModuleLibs(true)
-  , GenerateForInterface(true)
+  , GenerateForInterfaceLibs(true)
+  , GenerateForObjectLibs(true)
+  , GenerateForUnknownLibs(true)
+  , GenerateForCustomTargets(false)
   , GenerateForExternals(true)
   , GeneratePerTarget(true)
   , GenerateDependers(true)
-  , HaveTargetsAndLibs(false)
 {
 }
 
+cmGraphVizWriter::~cmGraphVizWriter()
+{
+  this->WriteFooter(this->GlobalFileStream);
+
+  for (auto& fileStream : this->PerTargetFileStreams) {
+    this->WriteFooter(*fileStream.second);
+  }
+
+  for (auto& fileStream : this->TargetDependersFileStreams) {
+    this->WriteFooter(*fileStream.second);
+  }
+}
+
+void cmGraphVizWriter::VisitGraph(std::string const&)
+{
+  this->WriteHeader(GlobalFileStream, this->GraphName);
+  this->WriteLegend(GlobalFileStream);
+}
+
+void cmGraphVizWriter::OnItem(cmLinkItem const& item)
+{
+  if (this->ItemExcluded(item)) {
+    return;
+  }
+
+  NodeNames[item.AsStr()] = cmStrCat(GraphNodePrefix, NextNodeId);
+  ++NextNodeId;
+
+  this->WriteNode(this->GlobalFileStream, item);
+
+  if (this->GeneratePerTarget) {
+    this->CreateTargetFile(this->PerTargetFileStreams, item);
+  }
+
+  if (this->GenerateDependers) {
+    this->CreateTargetFile(this->TargetDependersFileStreams, item,
+                           ".dependers");
+  }
+}
+
+void cmGraphVizWriter::CreateTargetFile(FileStreamMap& fileStreamMap,
+                                        cmLinkItem const& item,
+                                        std::string const& fileNameSuffix)
+{
+  auto const pathSafeItemName = PathSafeString(item.AsStr());
+  auto const perTargetFileName =
+    cmStrCat(this->FileName, '.', pathSafeItemName, fileNameSuffix);
+  auto perTargetFileStream =
+    cm::make_unique<cmGeneratedFileStream>(perTargetFileName);
+
+  this->WriteHeader(*perTargetFileStream, item.AsStr());
+  this->WriteNode(*perTargetFileStream, item);
+
+  fileStreamMap.emplace(item.AsStr(), std::move(perTargetFileStream));
+}
+
+void cmGraphVizWriter::OnDirectLink(cmLinkItem const& depender,
+                                    cmLinkItem const& dependee,
+                                    DependencyType dt)
+{
+  this->VisitLink(depender, dependee, true, GetEdgeStyle(dt));
+}
+
+void cmGraphVizWriter::OnIndirectLink(cmLinkItem const& depender,
+                                      cmLinkItem const& dependee)
+{
+  this->VisitLink(depender, dependee, false);
+}
+
+void cmGraphVizWriter::VisitLink(cmLinkItem const& depender,
+                                 cmLinkItem const& dependee, bool isDirectLink,
+                                 std::string const& scopeType)
+{
+  if (this->ItemExcluded(depender) || this->ItemExcluded(dependee)) {
+    return;
+  }
+
+  if (!isDirectLink) {
+    return;
+  }
+
+  this->WriteConnection(this->GlobalFileStream, depender, dependee, scopeType);
+
+  if (this->GeneratePerTarget) {
+    auto fileStream = PerTargetFileStreams[depender.AsStr()].get();
+    this->WriteNode(*fileStream, dependee);
+    this->WriteConnection(*fileStream, depender, dependee, scopeType);
+  }
+
+  if (this->GenerateDependers) {
+    auto fileStream = TargetDependersFileStreams[dependee.AsStr()].get();
+    this->WriteNode(*fileStream, depender);
+    this->WriteConnection(*fileStream, depender, dependee, scopeType);
+  }
+}
+
 void cmGraphVizWriter::ReadSettings(
   const std::string& settingsFileName,
   const std::string& fallbackSettingsFileName)
@@ -208,7 +224,6 @@
     }                                                                         \
   } while (false)
 
-  __set_if_set(this->GraphType, "GRAPHVIZ_GRAPH_TYPE");
   __set_if_set(this->GraphName, "GRAPHVIZ_GRAPH_NAME");
   __set_if_set(this->GraphHeader, "GRAPHVIZ_GRAPH_HEADER");
   __set_if_set(this->GraphNodePrefix, "GRAPHVIZ_NODE_PREFIX");
@@ -225,7 +240,10 @@
   __set_bool_if_set(this->GenerateForStaticLibs, "GRAPHVIZ_STATIC_LIBS");
   __set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS");
   __set_bool_if_set(this->GenerateForModuleLibs, "GRAPHVIZ_MODULE_LIBS");
-  __set_bool_if_set(this->GenerateForInterface, "GRAPHVIZ_INTERFACE");
+  __set_bool_if_set(this->GenerateForInterfaceLibs, "GRAPHVIZ_INTERFACE_LIBS");
+  __set_bool_if_set(this->GenerateForObjectLibs, "GRAPHVIZ_OBJECT_LIBS");
+  __set_bool_if_set(this->GenerateForUnknownLibs, "GRAPHVIZ_UNKNOWN_LIBS");
+  __set_bool_if_set(this->GenerateForCustomTargets, "GRAPHVIZ_CUSTOM_TARGETS");
   __set_bool_if_set(this->GenerateForExternals, "GRAPHVIZ_EXTERNAL_LIBS");
   __set_bool_if_set(this->GeneratePerTarget, "GRAPHVIZ_GENERATE_PER_TARGET");
   __set_bool_if_set(this->GenerateDependers, "GRAPHVIZ_GENERATE_DEPENDERS");
@@ -248,329 +266,170 @@
   }
 }
 
-// Iterate over all targets and write for each one a graph which shows
-// which other targets depend on it.
-void cmGraphVizWriter::WriteTargetDependersFiles(const std::string& fileName)
+void cmGraphVizWriter::Write()
 {
-  if (!this->GenerateDependers) {
-    return;
-  }
+  auto gg = this->GlobalGenerator;
 
-  this->CollectTargetsAndLibs();
+  this->VisitGraph(gg->GetName());
 
-  for (auto const& ptr : this->TargetPtrs) {
-    if (ptr.second == nullptr) {
-      continue;
-    }
+  // We want to traverse in a determined order, such that the output is always
+  // the same for a given project (this makes tests reproducible, etc.)
+  std::set<cmGeneratorTarget const*, cmGeneratorTarget::StrictTargetComparison>
+    sortedGeneratorTargets;
 
-    if (!this->GenerateForTargetType(ptr.second->GetType())) {
-      continue;
-    }
-
-    std::string currentFilename =
-      cmStrCat(fileName, '.', ptr.first, ".dependers");
-
-    cmGeneratedFileStream str(currentFilename);
-    if (!str) {
-      return;
-    }
-
-    std::set<std::string> insertedConnections;
-    std::set<std::string> insertedNodes;
-
-    std::cout << "Writing " << currentFilename << "..." << std::endl;
-    this->WriteHeader(str);
-
-    this->WriteDependerConnections(ptr.first, insertedNodes,
-                                   insertedConnections, str);
-
-    this->WriteFooter(str);
-  }
-}
-
-// Iterate over all targets and write for each one a graph which shows
-// on which targets it depends.
-void cmGraphVizWriter::WritePerTargetFiles(const std::string& fileName)
-{
-  if (!this->GeneratePerTarget) {
-    return;
-  }
-
-  this->CollectTargetsAndLibs();
-
-  for (auto const& ptr : this->TargetPtrs) {
-    if (ptr.second == nullptr) {
-      continue;
-    }
-
-    if (!this->GenerateForTargetType(ptr.second->GetType())) {
-      continue;
-    }
-
-    std::set<std::string> insertedConnections;
-    std::set<std::string> insertedNodes;
-
-    std::string currentFilename = cmStrCat(fileName, '.', ptr.first);
-    cmGeneratedFileStream str(currentFilename);
-    if (!str) {
-      return;
-    }
-
-    std::cout << "Writing " << currentFilename << "..." << std::endl;
-    this->WriteHeader(str);
-
-    this->WriteConnections(ptr.first, insertedNodes, insertedConnections, str);
-    this->WriteFooter(str);
-  }
-}
-
-void cmGraphVizWriter::WriteGlobalFile(const std::string& fileName)
-{
-  this->CollectTargetsAndLibs();
-
-  cmGeneratedFileStream str(fileName);
-  if (!str) {
-    return;
-  }
-  this->WriteHeader(str);
-
-  std::cout << "Writing " << fileName << "..." << std::endl;
-
-  std::set<std::string> insertedConnections;
-  std::set<std::string> insertedNodes;
-
-  for (auto const& ptr : this->TargetPtrs) {
-    if (ptr.second == nullptr) {
-      continue;
-    }
-
-    if (!this->GenerateForTargetType(ptr.second->GetType())) {
-      continue;
-    }
-
-    this->WriteConnections(ptr.first, insertedNodes, insertedConnections, str);
-  }
-  this->WriteFooter(str);
-}
-
-void cmGraphVizWriter::WriteHeader(cmGeneratedFileStream& str) const
-{
-  str << this->GraphType << " \"" << this->GraphName << "\" {" << std::endl;
-  str << this->GraphHeader << std::endl;
-}
-
-void cmGraphVizWriter::WriteFooter(cmGeneratedFileStream& str) const
-{
-  str << "}" << std::endl;
-}
-
-void cmGraphVizWriter::WriteConnections(
-  const std::string& targetName, std::set<std::string>& insertedNodes,
-  std::set<std::string>& insertedConnections, cmGeneratedFileStream& str) const
-{
-  auto targetPtrIt = this->TargetPtrs.find(targetName);
-
-  if (targetPtrIt == this->TargetPtrs.end()) // not found at all
-  {
-    return;
-  }
-
-  this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str);
-
-  if (targetPtrIt->second == nullptr) // it's an external library
-  {
-    return;
-  }
-
-  std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
-  std::map<std::string, LinkLibraryScopeType> ll =
-    getScopedLinkLibrariesFromTarget(targetPtrIt->second->Target,
-                                     GlobalGenerator);
-
-  for (auto const& llit : ll) {
-    const std::string& libName = llit.first;
-    auto libNameIt = this->TargetNamesNodes.find(libName);
-
-    // can happen e.g. if GRAPHVIZ_TARGET_IGNORE_REGEX is used
-    if (libNameIt == this->TargetNamesNodes.end()) {
-      continue;
-    }
-
-    std::string connectionName = cmStrCat(myNodeName, '-', libNameIt->second);
-    if (insertedConnections.find(connectionName) ==
-        insertedConnections.end()) {
-      insertedConnections.insert(connectionName);
-      this->WriteNode(libName, this->TargetPtrs.find(libName)->second,
-                      insertedNodes, str);
-
-      str << "    \"" << myNodeName << "\" -> \"" << libNameIt->second << "\"";
-
-      str << getLinkLibraryStyle(llit.second);
-
-      str << " // " << targetName << " -> " << libName << std::endl;
-      this->WriteConnections(libName, insertedNodes, insertedConnections, str);
-    }
-  }
-}
-
-void cmGraphVizWriter::WriteDependerConnections(
-  const std::string& targetName, std::set<std::string>& insertedNodes,
-  std::set<std::string>& insertedConnections, cmGeneratedFileStream& str) const
-{
-  auto targetPtrIt = this->TargetPtrs.find(targetName);
-
-  if (targetPtrIt == this->TargetPtrs.end()) // not found at all
-  {
-    return;
-  }
-
-  this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str);
-
-  if (targetPtrIt->second == nullptr) // it's an external library
-  {
-    return;
-  }
-
-  std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
-
-  // now search who links against me
-  for (auto const& tptr : this->TargetPtrs) {
-    if (tptr.second == nullptr) {
-      continue;
-    }
-
-    if (!this->GenerateForTargetType(tptr.second->GetType())) {
-      continue;
-    }
-
-    // Now we have a target, check whether it links against targetName.
-    // If so, draw a connection, and then continue with dependers on that one.
-    std::map<std::string, LinkLibraryScopeType> ll =
-      getScopedLinkLibrariesFromTarget(tptr.second->Target, GlobalGenerator);
-
-    for (auto const& llit : ll) {
-      if (llit.first == targetName) {
-        // So this target links against targetName.
-        auto dependerNodeNameIt = this->TargetNamesNodes.find(tptr.first);
-
-        if (dependerNodeNameIt != this->TargetNamesNodes.end()) {
-          std::string connectionName =
-            cmStrCat(dependerNodeNameIt->second, '-', myNodeName);
-
-          if (insertedConnections.find(connectionName) ==
-              insertedConnections.end()) {
-            insertedConnections.insert(connectionName);
-            this->WriteNode(tptr.first, tptr.second, insertedNodes, str);
-
-            str << "    \"" << dependerNodeNameIt->second << "\" -> \""
-                << myNodeName << "\"";
-            str << " // " << targetName << " -> " << tptr.first << std::endl;
-            str << getLinkLibraryStyle(llit.second);
-            this->WriteDependerConnections(tptr.first, insertedNodes,
-                                           insertedConnections, str);
-          }
-        }
-        break;
+  for (cmLocalGenerator const* lg : gg->GetLocalGenerators()) {
+    for (const auto& gt : lg->GetGeneratorTargets()) {
+      // Reserved targets have inconsistent names across platforms (e.g. 'all'
+      // vs. 'ALL_BUILD'), which can disrupt the traversal ordering.
+      // We don't need or want them anyway.
+      if (!cmGlobalGenerator::IsReservedTarget(gt->GetName())) {
+        sortedGeneratorTargets.insert(gt.get());
       }
     }
   }
-}
 
-void cmGraphVizWriter::WriteNode(const std::string& targetName,
-                                 const cmGeneratorTarget* target,
-                                 std::set<std::string>& insertedNodes,
-                                 cmGeneratedFileStream& str) const
-{
-  if (insertedNodes.find(targetName) == insertedNodes.end()) {
-    insertedNodes.insert(targetName);
-    auto nameIt = this->TargetNamesNodes.find(targetName);
-
-    str << "    \"" << nameIt->second << "\" [ label=\"" << targetName
-        << "\" shape=\"" << getShapeForTarget(target) << "\"];" << std::endl;
+  for (auto const gt : sortedGeneratorTargets) {
+    auto item = cmLinkItem(gt, gt->GetBacktrace());
+    this->VisitItem(item);
   }
 }
 
-void cmGraphVizWriter::CollectTargetsAndLibs()
+void cmGraphVizWriter::WriteHeader(cmGeneratedFileStream& fs,
+                                   const std::string& name)
 {
-  if (!this->HaveTargetsAndLibs) {
-    this->HaveTargetsAndLibs = true;
-    int cnt = this->CollectAllTargets();
-    if (this->GenerateForExternals) {
-      this->CollectAllExternalLibs(cnt);
-    }
-  }
+  auto const escapedGraphName = EscapeForDotFile(name);
+  fs << "digraph \"" << escapedGraphName << "\" {" << std::endl;
+  fs << this->GraphHeader << std::endl;
 }
 
-int cmGraphVizWriter::CollectAllTargets()
+void cmGraphVizWriter::WriteFooter(cmGeneratedFileStream& fs)
 {
-  int cnt = 0;
-  // First pass get the list of all cmake targets
-  for (cmLocalGenerator* lg : this->LocalGenerators) {
-    const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
-    for (cmGeneratorTarget* target : targets) {
-      const std::string& realTargetName = target->GetName();
-      if (this->IgnoreThisTarget(realTargetName)) {
-        // Skip ignored targets
-        continue;
-      }
-      // std::cout << "Found target: " << tit->first << std::endl;
-      std::ostringstream ostr;
-      ostr << this->GraphNodePrefix << cnt++;
-      this->TargetNamesNodes[realTargetName] = ostr.str();
-      this->TargetPtrs[realTargetName] = target;
+  fs << "}" << std::endl;
+}
+
+void cmGraphVizWriter::WriteLegend(cmGeneratedFileStream& fs)
+{
+  // Note that the subgraph name must start with "cluster", as done here, to
+  // make Graphviz layout engines do the right thing and keep the nodes
+  // together.
+  fs << "subgraph clusterLegend {" << std::endl;
+  fs << "  label = \"Legend\";" << std::endl;
+  // Set the color of the box surrounding the legend.
+  fs << "  color = black;" << std::endl;
+  // We use invisible edges just to enforce the layout.
+  fs << "  edge [ style = invis ];" << std::endl;
+
+  // Nodes.
+  fs << "  legendNode0 [ label = \"Executable\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_EXECUTABLE << " ];" << std::endl;
+
+  fs << "  legendNode1 [ label = \"Static Library\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_LIBRARY_STATIC << " ];" << std::endl;
+  fs << "  legendNode2 [ label = \"Shared Library\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_LIBRARY_SHARED << " ];" << std::endl;
+  fs << "  legendNode3 [ label = \"Module Library\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_LIBRARY_MODULE << " ];" << std::endl;
+
+  fs << "  legendNode4 [ label = \"Interface Library\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_LIBRARY_INTERFACE << " ];" << std::endl;
+  fs << "  legendNode5 [ label = \"Object Library\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_LIBRARY_OBJECT << " ];" << std::endl;
+  fs << "  legendNode6 [ label = \"Unknown Library\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_LIBRARY_UNKNOWN << " ];" << std::endl;
+
+  fs << "  legendNode7 [ label = \"Custom Target\", shape = "
+     << GRAPHVIZ_NODE_SHAPE_UTILITY << " ];" << std::endl;
+
+  // Edges.
+  // Some of those are dummy (invisible) edges to enforce a layout.
+  fs << "  legendNode0 -> legendNode1 [ style = " << GRAPHVIZ_EDGE_STYLE_PUBLIC
+     << " ];" << std::endl;
+  fs << "  legendNode0 -> legendNode2 [ style = " << GRAPHVIZ_EDGE_STYLE_PUBLIC
+     << " ];" << std::endl;
+  fs << "  legendNode0 -> legendNode3;" << std::endl;
+
+  fs << "  legendNode1 -> legendNode4 [ label = \"Interface\", style = "
+     << GRAPHVIZ_EDGE_STYLE_INTERFACE << " ];" << std::endl;
+  fs << "  legendNode2 -> legendNode5 [ label = \"Private\", style = "
+     << GRAPHVIZ_EDGE_STYLE_PRIVATE << " ];" << std::endl;
+  fs << "  legendNode3 -> legendNode6 [ style = " << GRAPHVIZ_EDGE_STYLE_PUBLIC
+     << " ];" << std::endl;
+
+  fs << "  legendNode0 -> legendNode7;" << std::endl;
+
+  fs << "}" << std::endl;
+}
+
+void cmGraphVizWriter::WriteNode(cmGeneratedFileStream& fs,
+                                 cmLinkItem const& item)
+{
+  auto const& itemName = item.AsStr();
+  auto const& nodeName = this->NodeNames[itemName];
+
+  auto const itemNameWithAliases = ItemNameWithAliases(itemName);
+  auto const escapedLabel = EscapeForDotFile(itemNameWithAliases);
+
+  fs << "    \"" << nodeName << "\" [ label = \"" << escapedLabel
+     << "\", shape = " << getShapeForTarget(item) << " ];" << std::endl;
+}
+
+void cmGraphVizWriter::WriteConnection(cmGeneratedFileStream& fs,
+                                       cmLinkItem const& depender,
+                                       cmLinkItem const& dependee,
+                                       std::string const& edgeStyle)
+{
+  auto const& dependerName = depender.AsStr();
+  auto const& dependeeName = dependee.AsStr();
+
+  fs << "    \"" << this->NodeNames[dependerName] << "\" -> \""
+     << this->NodeNames[dependeeName] << "\" ";
+
+  fs << edgeStyle;
+
+  fs << " // " << dependerName << " -> " << dependeeName << std::endl;
+}
+
+bool cmGraphVizWriter::ItemExcluded(cmLinkItem const& item)
+{
+  auto const itemName = item.AsStr();
+
+  if (this->ItemNameFilteredOut(itemName)) {
+    return true;
+  }
+
+  if (item.Target == nullptr) {
+    return !this->GenerateForExternals;
+  }
+
+  if (item.Target->GetType() == cmStateEnums::UTILITY) {
+    if ((itemName.find("Nightly") == 0) ||
+        (itemName.find("Continuous") == 0) ||
+        (itemName.find("Experimental") == 0)) {
+      return true;
     }
   }
 
-  return cnt;
-}
-
-int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
-{
-  // Ok, now find all the stuff we link to that is not in cmake
-  for (cmLocalGenerator* lg : this->LocalGenerators) {
-    const std::vector<cmGeneratorTarget*>& targets = lg->GetGeneratorTargets();
-    for (cmGeneratorTarget* target : targets) {
-      const std::string& realTargetName = target->GetName();
-      if (this->IgnoreThisTarget(realTargetName)) {
-        // Skip ignored targets
-        continue;
-      }
-      const cmTarget::LinkLibraryVectorType* ll =
-        &(target->Target->GetOriginalLinkLibraries());
-      for (auto const& llit : *ll) {
-        std::string libName = llit.first;
-        if (this->IgnoreThisTarget(libName)) {
-          // Skip ignored targets
-          continue;
-        }
-
-        if (GlobalGenerator->IsAlias(libName)) {
-          const auto tgt = GlobalGenerator->FindTarget(libName);
-          if (tgt) {
-            libName = tgt->GetName();
-          }
-        }
-
-        auto tarIt = this->TargetPtrs.find(libName);
-        if (tarIt == this->TargetPtrs.end()) {
-          std::ostringstream ostr;
-          ostr << this->GraphNodePrefix << cnt++;
-          this->TargetNamesNodes[libName] = ostr.str();
-          this->TargetPtrs[libName] = nullptr;
-          // str << "    \"" << ostr << "\" [ label=\"" << libName
-          // <<  "\" shape=\"ellipse\"];" << std::endl;
-        }
-      }
-    }
+  if (item.Target->IsImported() && !this->GenerateForExternals) {
+    return true;
   }
-  return cnt;
+
+  return !this->TargetTypeEnabled(item.Target->GetType());
 }
 
-bool cmGraphVizWriter::IgnoreThisTarget(const std::string& name)
+bool cmGraphVizWriter::ItemNameFilteredOut(std::string const& itemName)
 {
+  if (itemName == ">") {
+    // FIXME: why do we even receive such a target here?
+    return true;
+  }
+
+  if (cmGlobalGenerator::IsReservedTarget(itemName)) {
+    return true;
+  }
+
   for (cmsys::RegularExpression& regEx : this->TargetsToIgnoreRegex) {
     if (regEx.is_valid()) {
-      if (regEx.find(name)) {
+      if (regEx.find(itemName)) {
         return true;
       }
     }
@@ -579,7 +438,7 @@
   return false;
 }
 
-bool cmGraphVizWriter::GenerateForTargetType(
+bool cmGraphVizWriter::TargetTypeEnabled(
   cmStateEnums::TargetType targetType) const
 {
   switch (targetType) {
@@ -592,9 +451,73 @@
     case cmStateEnums::MODULE_LIBRARY:
       return this->GenerateForModuleLibs;
     case cmStateEnums::INTERFACE_LIBRARY:
-      return this->GenerateForInterface;
+      return this->GenerateForInterfaceLibs;
+    case cmStateEnums::OBJECT_LIBRARY:
+      return this->GenerateForObjectLibs;
+    case cmStateEnums::UNKNOWN_LIBRARY:
+      return this->GenerateForUnknownLibs;
+    case cmStateEnums::UTILITY:
+      return this->GenerateForCustomTargets;
+    case cmStateEnums::GLOBAL_TARGET:
+      // Built-in targets like edit_cache, etc.
+      // We don't need/want those in the dot file.
+      return false;
     default:
       break;
   }
   return false;
 }
+
+std::string cmGraphVizWriter::ItemNameWithAliases(
+  std::string const& itemName) const
+{
+  auto nameWithAliases = itemName;
+
+  for (auto const& lg : this->GlobalGenerator->GetLocalGenerators()) {
+    for (auto const& aliasTargets : lg->GetMakefile()->GetAliasTargets()) {
+      if (aliasTargets.second == itemName) {
+        nameWithAliases += "\\n(" + aliasTargets.first + ")";
+      }
+    }
+  }
+
+  return nameWithAliases;
+}
+
+std::string cmGraphVizWriter::GetEdgeStyle(DependencyType dt)
+{
+  std::string style;
+  switch (dt) {
+    case DependencyType::LinkPrivate:
+      style = "[ style = " + std::string(GRAPHVIZ_EDGE_STYLE_PRIVATE) + " ]";
+      break;
+    case DependencyType::LinkInterface:
+      style = "[ style = " + std::string(GRAPHVIZ_EDGE_STYLE_INTERFACE) + " ]";
+      break;
+    default:
+      break;
+  }
+  return style;
+}
+
+std::string cmGraphVizWriter::EscapeForDotFile(std::string const& str)
+{
+  return cmSystemTools::EscapeChars(str.data(), "\"");
+}
+
+std::string cmGraphVizWriter::PathSafeString(std::string const& str)
+{
+  std::string pathSafeStr;
+
+  // We'll only keep alphanumerical characters, plus the following ones that
+  // are common, and safe on all platforms:
+  auto const extra_chars = std::set<char>{ '.', '-', '_' };
+
+  for (char c : str) {
+    if (std::isalnum(c) || extra_chars.find(c) != extra_chars.cend()) {
+      pathSafeStr += c;
+    }
+  }
+
+  return pathSafeStr;
+}
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
index 9c3051f..578660d 100644
--- a/Source/cmGraphVizWriter.h
+++ b/Source/cmGraphVizWriter.h
@@ -6,87 +6,106 @@
 #include "cmConfigure.h" // IWYU pragma: keep
 
 #include <map>
-#include <set>
+#include <memory>
 #include <string>
 #include <vector>
 
 #include "cmsys/RegularExpression.hxx"
 
+#include "cmGeneratedFileStream.h"
+#include "cmLinkItemGraphVisitor.h"
 #include "cmStateTypes.h"
 
-class cmGeneratedFileStream;
-class cmGeneratorTarget;
-class cmLocalGenerator;
+class cmLinkItem;
 class cmGlobalGenerator;
 
 /** This class implements writing files for graphviz (dot) for graphs
  * representing the dependencies between the targets in the project. */
-class cmGraphVizWriter
+class cmGraphVizWriter : public cmLinkItemGraphVisitor
 {
 public:
-  cmGraphVizWriter(const cmGlobalGenerator* globalGenerator);
+  cmGraphVizWriter(std::string const& fileName,
+                   const cmGlobalGenerator* globalGenerator);
+  ~cmGraphVizWriter() override;
+
+  void VisitGraph(std::string const& name) override;
+
+  void OnItem(cmLinkItem const& item) override;
+
+  void OnDirectLink(cmLinkItem const& depender, cmLinkItem const& dependee,
+                    DependencyType dt) override;
+
+  void OnIndirectLink(cmLinkItem const& depender,
+                      cmLinkItem const& dependee) override;
 
   void ReadSettings(const std::string& settingsFileName,
                     const std::string& fallbackSettingsFileName);
 
-  void WritePerTargetFiles(const std::string& fileName);
-  void WriteTargetDependersFiles(const std::string& fileName);
+  void Write();
 
-  void WriteGlobalFile(const std::string& fileName);
+private:
+  using FileStreamMap =
+    std::map<std::string, std::unique_ptr<cmGeneratedFileStream>>;
 
-protected:
-  void CollectTargetsAndLibs();
+  void VisitLink(cmLinkItem const& depender, cmLinkItem const& dependee,
+                 bool isDirectLink, std::string const& scopeType = "");
 
-  int CollectAllTargets();
+  void WriteHeader(cmGeneratedFileStream& fs, std::string const& name);
 
-  int CollectAllExternalLibs(int cnt);
+  void WriteFooter(cmGeneratedFileStream& fs);
 
-  void WriteHeader(cmGeneratedFileStream& str) const;
+  void WriteLegend(cmGeneratedFileStream& fs);
 
-  void WriteConnections(const std::string& targetName,
-                        std::set<std::string>& insertedNodes,
-                        std::set<std::string>& insertedConnections,
-                        cmGeneratedFileStream& str) const;
+  void WriteNode(cmGeneratedFileStream& fs, cmLinkItem const& item);
 
-  void WriteDependerConnections(const std::string& targetName,
-                                std::set<std::string>& insertedNodes,
-                                std::set<std::string>& insertedConnections,
-                                cmGeneratedFileStream& str) const;
+  void CreateTargetFile(FileStreamMap& fileStreamMap, cmLinkItem const& target,
+                        std::string const& fileNameSuffix = "");
 
-  void WriteNode(const std::string& targetName,
-                 const cmGeneratorTarget* target,
-                 std::set<std::string>& insertedNodes,
-                 cmGeneratedFileStream& str) const;
+  void WriteConnection(cmGeneratedFileStream& fs,
+                       cmLinkItem const& dependerTargetName,
+                       cmLinkItem const& dependeeTargetName,
+                       std::string const& edgeStyle);
 
-  void WriteFooter(cmGeneratedFileStream& str) const;
+  bool ItemExcluded(cmLinkItem const& item);
+  bool ItemNameFilteredOut(std::string const& itemName);
+  bool TargetTypeEnabled(cmStateEnums::TargetType targetType) const;
 
-  bool IgnoreThisTarget(const std::string& name);
+  std::string ItemNameWithAliases(std::string const& itemName) const;
 
-  bool GenerateForTargetType(cmStateEnums::TargetType targetType) const;
+  static std::string GetEdgeStyle(DependencyType dt);
 
-  std::string GraphType;
+  static std::string EscapeForDotFile(std::string const& str);
+
+  static std::string PathSafeString(std::string const& str);
+
+  std::string FileName;
+  cmGeneratedFileStream GlobalFileStream;
+  FileStreamMap PerTargetFileStreams;
+  FileStreamMap TargetDependersFileStreams;
+
   std::string GraphName;
   std::string GraphHeader;
   std::string GraphNodePrefix;
 
   std::vector<cmsys::RegularExpression> TargetsToIgnoreRegex;
 
-  const cmGlobalGenerator* GlobalGenerator;
-  const std::vector<cmLocalGenerator*>& LocalGenerators;
+  cmGlobalGenerator const* GlobalGenerator;
 
-  std::map<std::string, const cmGeneratorTarget*> TargetPtrs;
-  // maps from the actual target names to node names in dot:
-  std::map<std::string, std::string> TargetNamesNodes;
+  int NextNodeId;
+  // maps from the actual item names to node names in dot:
+  std::map<std::string, std::string> NodeNames;
 
   bool GenerateForExecutables;
   bool GenerateForStaticLibs;
   bool GenerateForSharedLibs;
   bool GenerateForModuleLibs;
-  bool GenerateForInterface;
+  bool GenerateForInterfaceLibs;
+  bool GenerateForObjectLibs;
+  bool GenerateForUnknownLibs;
+  bool GenerateForCustomTargets;
   bool GenerateForExternals;
   bool GeneratePerTarget;
   bool GenerateDependers;
-  bool HaveTargetsAndLibs;
 };
 
 #endif
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index d623943..efbcb98 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -7,11 +7,14 @@
 #include "cmGlobalGenerator.h"
 #include "cmInstallFilesGenerator.h"
 #include "cmInstallGenerator.h"
+#include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmRange.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 
+class cmListFileBacktrace;
+
 static std::string FindInstallSource(cmMakefile& makefile, const char* name);
 static void CreateInstallGenerator(cmMakefile& makefile,
                                    std::string const& dest,
@@ -43,9 +46,10 @@
     CreateInstallGenerator(mf, dest, files);
   } else {
     std::vector<std::string> finalArgs(args.begin() + 1, args.end());
-    mf.AddFinalAction([dest, finalArgs](cmMakefile& makefile) {
-      FinalAction(makefile, dest, finalArgs);
-    });
+    mf.AddGeneratorAction(
+      [dest, finalArgs](cmLocalGenerator& lg, const cmListFileBacktrace&) {
+        FinalAction(*lg.GetMakefile(), dest, finalArgs);
+      });
   }
 
   mf.GetGlobalGenerator()->AddInstallComponent(
diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx
index 6bb4409..2088eae 100644
--- a/Source/cmInstallProgramsCommand.cxx
+++ b/Source/cmInstallProgramsCommand.cxx
@@ -7,10 +7,13 @@
 #include "cmGlobalGenerator.h"
 #include "cmInstallFilesGenerator.h"
 #include "cmInstallGenerator.h"
+#include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 
+class cmListFileBacktrace;
+
 static void FinalAction(cmMakefile& makefile, std::string const& dest,
                         std::vector<std::string> const& args);
 static std::string FindInstallSource(cmMakefile& makefile, const char* name);
@@ -33,9 +36,10 @@
 
   std::string const& dest = args[0];
   std::vector<std::string> const finalArgs(args.begin() + 1, args.end());
-  mf.AddFinalAction([dest, finalArgs](cmMakefile& makefile) {
-    FinalAction(makefile, dest, finalArgs);
-  });
+  mf.AddGeneratorAction(
+    [dest, finalArgs](cmLocalGenerator& lg, const cmListFileBacktrace&) {
+      FinalAction(*lg.GetMakefile(), dest, finalArgs);
+    });
   return true;
 }
 
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index aa92fa7..69c9b7e 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -554,7 +554,8 @@
       // components of the install_name field then we need to create a
       // mapping to be applied after installation.
       std::string for_build = tgt->GetInstallNameDirForBuildTree(config);
-      std::string for_install = tgt->GetInstallNameDirForInstallTree();
+      std::string for_install = tgt->GetInstallNameDirForInstallTree(
+        config, "${CMAKE_INSTALL_PREFIX}");
       if (for_build != for_install) {
         // The directory portions differ.  Append the filename to
         // create the mapping.
@@ -577,7 +578,8 @@
   if (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY) {
     std::string for_build =
       this->Target->GetInstallNameDirForBuildTree(config);
-    std::string for_install = this->Target->GetInstallNameDirForInstallTree();
+    std::string for_install = this->Target->GetInstallNameDirForInstallTree(
+      config, "${CMAKE_INSTALL_PREFIX}");
 
     if (this->Target->IsFrameworkOnApple() && for_install.empty()) {
       // Frameworks seem to have an id corresponding to their own full
diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx
new file mode 100644
index 0000000..ab2cf9e
--- /dev/null
+++ b/Source/cmLinkItemGraphVisitor.cxx
@@ -0,0 +1,142 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#include "cmLinkItemGraphVisitor.h"
+
+#include <map>
+#include <utility>
+#include <vector>
+
+#include "cmGeneratorTarget.h"
+#include "cmLinkItem.h"
+#include "cmMakefile.h"
+
+void cmLinkItemGraphVisitor::VisitItem(cmLinkItem const& item)
+{
+  if (this->ItemVisited(item)) {
+    return;
+  }
+
+  this->OnItem(item);
+
+  this->VisitLinks(item, item);
+}
+
+void cmLinkItemGraphVisitor::VisitLinks(cmLinkItem const& item,
+                                        cmLinkItem const& rootItem)
+{
+  if (this->LinkVisited(item, rootItem)) {
+    return;
+  }
+
+  if (item.Target == nullptr) {
+    return;
+  }
+
+  for (auto const& config : item.Target->Makefile->GetGeneratorConfigs()) {
+    this->VisitLinks(item, rootItem, config);
+  }
+}
+
+void cmLinkItemGraphVisitor::VisitLinks(cmLinkItem const& item,
+                                        cmLinkItem const& rootItem,
+                                        std::string const& config)
+{
+  auto const& target = *item.Target;
+
+  DependencyMap dependencies;
+  cmLinkItemGraphVisitor::GetDependencies(target, config, dependencies);
+
+  for (auto const& d : dependencies) {
+    auto const& dependency = d.second;
+    auto const& dependencyType = dependency.first;
+    auto const& dependee = dependency.second;
+    this->VisitItem(dependee);
+
+    if (this->LinkVisited(item, dependee)) {
+      continue;
+    }
+
+    this->OnDirectLink(item, dependee, dependencyType);
+
+    if (rootItem.AsStr() != item.AsStr()) {
+      this->OnIndirectLink(rootItem, dependee);
+    }
+
+    // Visit all the direct and indirect links.
+    this->VisitLinks(dependee, dependee);
+    this->VisitLinks(dependee, item);
+    this->VisitLinks(dependee, rootItem);
+  }
+}
+
+bool cmLinkItemGraphVisitor::ItemVisited(cmLinkItem const& item)
+{
+  auto& collection = this->VisitedItems;
+
+  bool const visited = collection.find(item.AsStr()) != collection.cend();
+
+  if (!visited) {
+    collection.insert(item.AsStr());
+  }
+
+  return visited;
+}
+
+bool cmLinkItemGraphVisitor::LinkVisited(cmLinkItem const& depender,
+                                         cmLinkItem const& dependee)
+{
+  auto const link = std::make_pair<>(depender.AsStr(), dependee.AsStr());
+
+  bool const linkVisited =
+    this->VisitedLinks.find(link) != this->VisitedLinks.cend();
+
+  if (!linkVisited) {
+    this->VisitedLinks.insert(link);
+  }
+
+  return linkVisited;
+}
+
+void cmLinkItemGraphVisitor::GetDependencies(cmGeneratorTarget const& target,
+                                             std::string const& config,
+                                             DependencyMap& dependencies)
+{
+  auto implementationLibraries = target.GetLinkImplementationLibraries(config);
+  if (implementationLibraries != nullptr) {
+    for (auto const& lib : implementationLibraries->Libraries) {
+      auto const& name = lib.AsStr();
+      dependencies[name] = Dependency(DependencyType::LinkPrivate, lib);
+    }
+  }
+
+  auto interfaceLibraries =
+    target.GetLinkInterfaceLibraries(config, &target, true);
+  if (interfaceLibraries != nullptr) {
+    for (auto const& lib : interfaceLibraries->Libraries) {
+      auto const& name = lib.AsStr();
+      if (dependencies.find(name) != dependencies.cend()) {
+        dependencies[name] = Dependency(DependencyType::LinkPublic, lib);
+      } else {
+        dependencies[name] = Dependency(DependencyType::LinkInterface, lib);
+      }
+    }
+  }
+
+  std::vector<cmGeneratorTarget*> objectLibraries;
+  target.GetObjectLibrariesCMP0026(objectLibraries);
+  for (auto const& lib : objectLibraries) {
+    auto const& name = lib->GetName();
+    if (dependencies.find(name) == dependencies.cend()) {
+      auto objectItem = cmLinkItem(lib, lib->GetBacktrace());
+      dependencies[name] = Dependency(DependencyType::Object, objectItem);
+    }
+  }
+
+  auto const& utilityItems = target.GetUtilityItems();
+  for (auto const& item : utilityItems) {
+    auto const& name = item.AsStr();
+    if (dependencies.find(name) == dependencies.cend()) {
+      dependencies[name] = Dependency(DependencyType::Utility, item);
+    }
+  }
+}
diff --git a/Source/cmLinkItemGraphVisitor.h b/Source/cmLinkItemGraphVisitor.h
new file mode 100644
index 0000000..21dc659
--- /dev/null
+++ b/Source/cmLinkItemGraphVisitor.h
@@ -0,0 +1,75 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cmLinkItemGraphVisitor_h
+#define cmLinkItemGraphVisitor_h
+
+#include <map>
+#include <set>
+#include <string>
+#include <utility>
+
+#include "cmLinkItem.h"
+
+class cmGeneratorTarget;
+
+/** \class cmLinkItemGraphVisitor
+ * \brief Visits a graph of linked items.
+ *
+ * Allows to visit items and dependency links (direct and indirect) between
+ * those items.
+ * This abstract class takes care of the graph traversal, making sure that:
+ *   - it terminates even in the presence of cycles;
+ *   - it visits every object once (and only once);
+ *   - it visits the objects in the same order every time.
+ *
+ * Children classes only have to implement OnItem() etc. to handle whatever
+ * logic they care about.
+ */
+class cmLinkItemGraphVisitor
+{
+public:
+  virtual ~cmLinkItemGraphVisitor() = default;
+
+  virtual void VisitGraph(std::string const& name) = 0;
+
+  void VisitItem(cmLinkItem const& item);
+
+protected:
+  enum class DependencyType
+  {
+    LinkInterface,
+    LinkPublic,
+    LinkPrivate,
+    Object,
+    Utility
+  };
+
+  virtual void OnItem(cmLinkItem const& item) = 0;
+
+  virtual void OnDirectLink(cmLinkItem const& depender,
+                            cmLinkItem const& dependee, DependencyType dt) = 0;
+
+  virtual void OnIndirectLink(cmLinkItem const& depender,
+                              cmLinkItem const& dependee) = 0;
+
+private:
+  std::set<std::string> VisitedItems;
+
+  std::set<std::pair<std::string, std::string>> VisitedLinks;
+
+  void VisitLinks(cmLinkItem const& item, cmLinkItem const& rootItem);
+  void VisitLinks(cmLinkItem const& item, cmLinkItem const& rootItem,
+                  std::string const& config);
+
+  using Dependency = std::pair<DependencyType, cmLinkItem>;
+  using DependencyMap = std::map<std::string, Dependency>;
+
+  bool ItemVisited(cmLinkItem const& item);
+  bool LinkVisited(cmLinkItem const& depender, cmLinkItem const& dependee);
+
+  static void GetDependencies(cmGeneratorTarget const& target,
+                              std::string const& config,
+                              DependencyMap& dependencies);
+};
+
+#endif
diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx
index 1184bcb..d49e711 100644
--- a/Source/cmLoadCacheCommand.cxx
+++ b/Source/cmLoadCacheCommand.cxx
@@ -24,12 +24,20 @@
 {
   if (args.empty()) {
     status.SetError("called with wrong number of arguments.");
+    return false;
   }
 
   if (args.size() >= 2 && args[1] == "READ_WITH_PREFIX") {
     return ReadWithPrefix(args, status);
   }
 
+  if (status.GetMakefile().GetCMakeInstance()->GetWorkingMode() ==
+      cmake::SCRIPT_MODE) {
+    status.SetError(
+      "Only load_cache(READ_WITH_PREFIX) may be used in script mode");
+    return false;
+  }
+
   // Cache entries to be excluded from the import list.
   // If this set is empty, all cache entries are brought in
   // and they can not be overridden.
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 23ace64..92258e2 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -14,6 +14,7 @@
 #include "cmCommand.h"
 #include "cmDynamicLoader.h"
 #include "cmExecutionStatus.h"
+#include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmState.h"
 #include "cmStringAlgorithms.h"
@@ -25,6 +26,8 @@
 #  include <malloc.h> /* for malloc/free on QNX */
 #endif
 
+class cmListFileBacktrace;
+
 namespace {
 
 const char* LastName = nullptr;
@@ -158,8 +161,10 @@
   if (result) {
     if (this->Impl->FinalPass) {
       auto impl = this->Impl;
-      this->Makefile->AddFinalAction(
-        [impl](cmMakefile& makefile) { impl->DoFinalPass(&makefile); });
+      this->Makefile->AddGeneratorAction(
+        [impl](cmLocalGenerator& lg, const cmListFileBacktrace&) {
+          impl->DoFinalPass(lg.GetMakefile());
+        });
     }
     return true;
   }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1754421..c58603f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2,6 +2,21 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmLocalGenerator.h"
 
+#include <algorithm>
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <initializer_list>
+#include <iterator>
+#include <sstream>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+#include <cm/memory>
+#include <cm/string_view>
+
 #include "cmsys/RegularExpression.hxx"
 
 #include "cmAlgorithms.h"
@@ -40,20 +55,6 @@
 #  include "cmCryptoHash.h"
 #endif
 
-#include <algorithm>
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <initializer_list>
-#include <iterator>
-#include <sstream>
-#include <unordered_set>
-#include <utility>
-#include <vector>
-
-#include <cm/string_view>
-
 #if defined(__HAIKU__)
 #  include <FindDirectory.h>
 #  include <StorageDefs.h>
@@ -181,11 +182,7 @@
                                        this->LinkerSysroot);
 }
 
-cmLocalGenerator::~cmLocalGenerator()
-{
-  cmDeleteAll(this->GeneratorTargets);
-  cmDeleteAll(this->OwnedImportedGeneratorTargets);
-}
+cmLocalGenerator::~cmLocalGenerator() = default;
 
 void cmLocalGenerator::IssueMessage(MessageType t,
                                     std::string const& text) const
@@ -263,8 +260,8 @@
 void cmLocalGenerator::TraceDependencies()
 {
   // Generate the rule files for each target.
-  const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
-  for (cmGeneratorTarget* target : targets) {
+  const auto& targets = this->GetGeneratorTargets();
+  for (const auto& target : targets) {
     if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
@@ -635,11 +632,14 @@
   }
 }
 
-void cmLocalGenerator::AddGeneratorTarget(cmGeneratorTarget* gt)
+void cmLocalGenerator::AddGeneratorTarget(
+  std::unique_ptr<cmGeneratorTarget> gt)
 {
-  this->GeneratorTargets.push_back(gt);
-  this->GeneratorTargetSearchIndex.emplace(gt->GetName(), gt);
-  this->GlobalGenerator->IndexGeneratorTarget(gt);
+  cmGeneratorTarget* gt_ptr = gt.get();
+
+  this->GeneratorTargets.push_back(std::move(gt));
+  this->GeneratorTargetSearchIndex.emplace(gt_ptr->GetName(), gt_ptr);
+  this->GlobalGenerator->IndexGeneratorTarget(gt_ptr);
 }
 
 void cmLocalGenerator::AddImportedGeneratorTarget(cmGeneratorTarget* gt)
@@ -648,9 +648,10 @@
   this->GlobalGenerator->IndexGeneratorTarget(gt);
 }
 
-void cmLocalGenerator::AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt)
+void cmLocalGenerator::AddOwnedImportedGeneratorTarget(
+  std::unique_ptr<cmGeneratorTarget> gt)
 {
-  this->OwnedImportedGeneratorTargets.push_back(gt);
+  this->OwnedImportedGeneratorTargets.push_back(std::move(gt));
 }
 
 cmGeneratorTarget* cmLocalGenerator::FindLocalNonAliasGeneratorTarget(
@@ -673,8 +674,8 @@
   }
 
   // Add our targets to the manifest for each configuration.
-  const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
-  for (cmGeneratorTarget* target : targets) {
+  const auto& targets = this->GetGeneratorTargets();
+  for (const auto& target : targets) {
     if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
@@ -704,8 +705,8 @@
   }
 
   // Process compile features of all targets.
-  const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
-  for (cmGeneratorTarget* target : targets) {
+  const auto& targets = this->GetGeneratorTargets();
+  for (const auto& target : targets) {
     for (std::string const& c : configNames) {
       if (!target->ComputeCompileFeatures(c)) {
         return false;
@@ -988,6 +989,91 @@
   }
 }
 
+cmTarget* cmLocalGenerator::AddCustomCommandToTarget(
+  const std::string& target, const std::vector<std::string>& byproducts,
+  const std::vector<std::string>& depends,
+  const cmCustomCommandLines& commandLines, cmCustomCommandType type,
+  const char* comment, const char* workingDir, bool escapeOldStyle,
+  bool uses_terminal, const std::string& depfile, const std::string& job_pool,
+  bool command_expand_lists, cmObjectLibraryCommands objLibCommands)
+{
+  cmTarget* t = this->Makefile->GetCustomCommandTarget(
+    target, objLibCommands, this->DirectoryBacktrace);
+  if (!t) {
+    return nullptr;
+  }
+
+  detail::AddCustomCommandToTarget(
+    *this, this->DirectoryBacktrace, cmCommandOrigin::Generator, t, byproducts,
+    depends, commandLines, type, comment, workingDir, escapeOldStyle,
+    uses_terminal, depfile, job_pool, command_expand_lists);
+
+  return t;
+}
+
+cmSourceFile* cmLocalGenerator::AddCustomCommandToOutput(
+  const std::string& output, const std::vector<std::string>& depends,
+  const std::string& main_dependency, const cmCustomCommandLines& commandLines,
+  const char* comment, const char* workingDir, bool replace,
+  bool escapeOldStyle, bool uses_terminal, bool command_expand_lists,
+  const std::string& depfile, const std::string& job_pool)
+{
+  std::vector<std::string> no_byproducts;
+  cmImplicitDependsList no_implicit_depends;
+  return this->AddCustomCommandToOutput(
+    { output }, no_byproducts, depends, main_dependency, no_implicit_depends,
+    commandLines, comment, workingDir, replace, escapeOldStyle, uses_terminal,
+    command_expand_lists, depfile, job_pool);
+}
+
+cmSourceFile* cmLocalGenerator::AddCustomCommandToOutput(
+  const std::vector<std::string>& outputs,
+  const std::vector<std::string>& byproducts,
+  const std::vector<std::string>& depends, const std::string& main_dependency,
+  const cmImplicitDependsList& implicit_depends,
+  const cmCustomCommandLines& commandLines, const char* comment,
+  const char* workingDir, bool replace, bool escapeOldStyle,
+  bool uses_terminal, bool command_expand_lists, const std::string& depfile,
+  const std::string& job_pool)
+{
+  // Make sure there is at least one output.
+  if (outputs.empty()) {
+    cmSystemTools::Error("Attempt to add a custom rule with no output!");
+    return nullptr;
+  }
+
+  return detail::AddCustomCommandToOutput(
+    *this, this->DirectoryBacktrace, cmCommandOrigin::Generator, outputs,
+    byproducts, depends, main_dependency, implicit_depends, commandLines,
+    comment, workingDir, replace, escapeOldStyle, uses_terminal,
+    command_expand_lists, depfile, job_pool);
+}
+
+cmTarget* cmLocalGenerator::AddUtilityCommand(
+  const std::string& utilityName, bool excludeFromAll, const char* workingDir,
+  const std::vector<std::string>& byproducts,
+  const std::vector<std::string>& depends,
+  const cmCustomCommandLines& commandLines, bool escapeOldStyle,
+  const char* comment, bool uses_terminal, bool command_expand_lists,
+  const std::string& job_pool)
+{
+  cmTarget* target =
+    this->Makefile->AddNewUtilityTarget(utilityName, excludeFromAll);
+  target->SetIsGeneratorProvided(true);
+
+  if (commandLines.empty() && depends.empty()) {
+    return target;
+  }
+
+  detail::AddUtilityCommand(
+    *this, this->DirectoryBacktrace, cmCommandOrigin::Generator, target,
+    this->Makefile->GetUtilityOutput(target), workingDir, byproducts, depends,
+    commandLines, escapeOldStyle, comment, uses_terminal, command_expand_lists,
+    job_pool);
+
+  return target;
+}
+
 std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
   cmGeneratorTarget const* target, std::string const& lang,
   std::string const& config, bool stripImplicitDirs,
@@ -2404,13 +2490,9 @@
               file << "endif()\n";
             }
 
-            cmCustomCommandLines commandLines;
-            cmCustomCommandLine currentLine;
-            currentLine.push_back(cmSystemTools::GetCMakeCommand());
-            currentLine.push_back(cmStrCat("-DPDB_PREFIX=", pdb_prefix));
-            currentLine.push_back("-P");
-            currentLine.push_back(copy_script);
-            commandLines.push_back(std::move(currentLine));
+            cmCustomCommandLines commandLines = cmMakeSingleCommandLine(
+              { cmSystemTools::GetCMakeCommand(),
+                cmStrCat("-DPDB_PREFIX=", pdb_prefix), "-P", copy_script });
 
             const std::string no_main_dependency;
             const std::vector<std::string> no_deps;
@@ -2423,16 +2505,14 @@
                                        pchReuseFrom, ".pdb"));
 
             if (this->GetGlobalGenerator()->IsMultiConfig()) {
-              this->Makefile->AddCustomCommandToTarget(
+              this->AddCustomCommandToTarget(
                 target->GetName(), outputs, no_deps, commandLines,
                 cmCustomCommandType::PRE_BUILD, no_message, no_current_dir);
             } else {
               cmImplicitDependsList no_implicit_depends;
-              cmSourceFile* copy_rule =
-                this->Makefile->AddCustomCommandToOutput(
-                  outputs, no_byproducts, no_deps, no_main_dependency,
-                  no_implicit_depends, commandLines, no_message,
-                  no_current_dir);
+              cmSourceFile* copy_rule = this->AddCustomCommandToOutput(
+                outputs, no_byproducts, no_deps, no_main_dependency,
+                no_implicit_depends, commandLines, no_message, no_current_dir);
 
               if (copy_rule) {
                 target->AddSource(copy_rule->ResolveFullPath());
@@ -2515,8 +2595,7 @@
       batchSize = filtered_sources.size();
     }
 
-    for (size_t itemsLeft = filtered_sources.size(), chunk = batchSize,
-                batch = 0;
+    for (size_t itemsLeft = filtered_sources.size(), chunk, batch = 0;
          itemsLeft > 0; itemsLeft -= chunk, ++batch) {
 
       chunk = std::min(itemsLeft, batchSize);
@@ -2900,8 +2979,8 @@
 {
   // Convert the old-style install specification from each target to
   // an install generator and run it.
-  const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
-  for (cmGeneratorTarget* l : tgts) {
+  const auto& tgts = this->GetGeneratorTargets();
+  for (const auto& l : tgts) {
     if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
@@ -3444,3 +3523,245 @@
   cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_BUNDLE_VERSION");
   mf->ConfigureFile(inFile, fname, false, false, false);
 }
+
+namespace {
+void CreateGeneratedSource(cmLocalGenerator& lg, const std::string& output,
+                           cmCommandOrigin origin,
+                           const cmListFileBacktrace& lfbt)
+{
+  if (cmGeneratorExpression::Find(output) == std::string::npos) {
+    // Outputs without generator expressions from the project are already
+    // created and marked as generated.  Do not mark them again, because
+    // other commands might have overwritten the property.
+    if (origin == cmCommandOrigin::Generator) {
+      lg.GetMakefile()->GetOrCreateGeneratedSource(output);
+    }
+  } else {
+    lg.GetCMakeInstance()->IssueMessage(
+      MessageType::FATAL_ERROR,
+      "Generator expressions in custom command outputs are not implemented!",
+      lfbt);
+  }
+}
+
+void CreateGeneratedSources(cmLocalGenerator& lg,
+                            const std::vector<std::string>& outputs,
+                            cmCommandOrigin origin,
+                            const cmListFileBacktrace& lfbt)
+{
+  for (std::string const& o : outputs) {
+    CreateGeneratedSource(lg, o, origin, lfbt);
+  }
+}
+
+cmSourceFile* AddCustomCommand(
+  cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+  const std::vector<std::string>& outputs,
+  const std::vector<std::string>& byproducts,
+  const std::vector<std::string>& depends, const std::string& main_dependency,
+  const cmImplicitDependsList& implicit_depends,
+  const cmCustomCommandLines& commandLines, const char* comment,
+  const char* workingDir, bool replace, bool escapeOldStyle,
+  bool uses_terminal, bool command_expand_lists, const std::string& depfile,
+  const std::string& job_pool)
+{
+  cmMakefile* mf = lg.GetMakefile();
+
+  // Choose a source file on which to store the custom command.
+  cmSourceFile* file = nullptr;
+  if (!commandLines.empty() && !main_dependency.empty()) {
+    // The main dependency was specified.  Use it unless a different
+    // custom command already used it.
+    file = mf->GetSource(main_dependency);
+    if (file && file->GetCustomCommand() && !replace) {
+      // The main dependency already has a custom command.
+      if (commandLines == file->GetCustomCommand()->GetCommandLines()) {
+        // The existing custom command is identical.  Silently ignore
+        // the duplicate.
+        return file;
+      }
+      // The existing custom command is different.  We need to
+      // generate a rule file for this new command.
+      file = nullptr;
+    } else if (!file) {
+      file = mf->CreateSource(main_dependency);
+    }
+  }
+
+  // Generate a rule file if the main dependency is not available.
+  if (!file) {
+    cmGlobalGenerator* gg = lg.GetGlobalGenerator();
+
+    // Construct a rule file associated with the first output produced.
+    std::string outName = gg->GenerateRuleFile(outputs[0]);
+
+    // Check if the rule file already exists.
+    file = mf->GetSource(outName, cmSourceFileLocationKind::Known);
+    if (file && file->GetCustomCommand() && !replace) {
+      // The rule file already exists.
+      if (commandLines != file->GetCustomCommand()->GetCommandLines()) {
+        lg.GetCMakeInstance()->IssueMessage(
+          MessageType::FATAL_ERROR,
+          cmStrCat("Attempt to add a custom rule to output\n  ", outName,
+                   "\nwhich already has a custom rule."),
+          lfbt);
+      }
+      return file;
+    }
+
+    // Create a cmSourceFile for the rule file.
+    if (!file) {
+      file = mf->CreateSource(outName, true, cmSourceFileLocationKind::Known);
+    }
+    file->SetProperty("__CMAKE_RULE", "1");
+  }
+
+  // Attach the custom command to the file.
+  if (file) {
+    // Construct a complete list of dependencies.
+    std::vector<std::string> depends2(depends);
+    if (!main_dependency.empty()) {
+      depends2.push_back(main_dependency);
+    }
+
+    std::unique_ptr<cmCustomCommand> cc = cm::make_unique<cmCustomCommand>(
+      outputs, byproducts, depends2, commandLines, lfbt, comment, workingDir);
+    cc->SetEscapeOldStyle(escapeOldStyle);
+    cc->SetEscapeAllowMakeVars(true);
+    cc->SetImplicitDepends(implicit_depends);
+    cc->SetUsesTerminal(uses_terminal);
+    cc->SetCommandExpandLists(command_expand_lists);
+    cc->SetDepfile(depfile);
+    cc->SetJobPool(job_pool);
+    file->SetCustomCommand(std::move(cc));
+
+    mf->AddSourceOutputs(file, outputs, byproducts);
+  }
+  return file;
+}
+}
+
+namespace detail {
+void AddCustomCommandToTarget(cmLocalGenerator& lg,
+                              const cmListFileBacktrace& lfbt,
+                              cmCommandOrigin origin, cmTarget* target,
+                              const std::vector<std::string>& byproducts,
+                              const std::vector<std::string>& depends,
+                              const cmCustomCommandLines& commandLines,
+                              cmCustomCommandType type, const char* comment,
+                              const char* workingDir, bool escapeOldStyle,
+                              bool uses_terminal, const std::string& depfile,
+                              const std::string& job_pool,
+                              bool command_expand_lists)
+{
+  cmMakefile* mf = lg.GetMakefile();
+
+  // Always create the byproduct sources and mark them generated.
+  CreateGeneratedSources(lg, byproducts, origin, lfbt);
+
+  // Add the command to the appropriate build step for the target.
+  std::vector<std::string> no_output;
+  cmCustomCommand cc(no_output, byproducts, depends, commandLines, lfbt,
+                     comment, workingDir);
+  cc.SetEscapeOldStyle(escapeOldStyle);
+  cc.SetEscapeAllowMakeVars(true);
+  cc.SetUsesTerminal(uses_terminal);
+  cc.SetCommandExpandLists(command_expand_lists);
+  cc.SetDepfile(depfile);
+  cc.SetJobPool(job_pool);
+  switch (type) {
+    case cmCustomCommandType::PRE_BUILD:
+      target->AddPreBuildCommand(std::move(cc));
+      break;
+    case cmCustomCommandType::PRE_LINK:
+      target->AddPreLinkCommand(std::move(cc));
+      break;
+    case cmCustomCommandType::POST_BUILD:
+      target->AddPostBuildCommand(std::move(cc));
+      break;
+  }
+
+  mf->AddTargetByproducts(target, byproducts);
+}
+
+cmSourceFile* AddCustomCommandToOutput(
+  cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+  cmCommandOrigin origin, const std::vector<std::string>& outputs,
+  const std::vector<std::string>& byproducts,
+  const std::vector<std::string>& depends, const std::string& main_dependency,
+  const cmImplicitDependsList& implicit_depends,
+  const cmCustomCommandLines& commandLines, const char* comment,
+  const char* workingDir, bool replace, bool escapeOldStyle,
+  bool uses_terminal, bool command_expand_lists, const std::string& depfile,
+  const std::string& job_pool)
+{
+  // Always create the output sources and mark them generated.
+  CreateGeneratedSources(lg, outputs, origin, lfbt);
+  CreateGeneratedSources(lg, byproducts, origin, lfbt);
+
+  return AddCustomCommand(
+    lg, lfbt, outputs, byproducts, depends, main_dependency, implicit_depends,
+    commandLines, comment, workingDir, replace, escapeOldStyle, uses_terminal,
+    command_expand_lists, depfile, job_pool);
+}
+
+void AppendCustomCommandToOutput(cmLocalGenerator& lg,
+                                 const cmListFileBacktrace& lfbt,
+                                 const std::string& output,
+                                 const std::vector<std::string>& depends,
+                                 const cmImplicitDependsList& implicit_depends,
+                                 const cmCustomCommandLines& commandLines)
+{
+  // Lookup an existing command.
+  if (cmSourceFile* sf = lg.GetMakefile()->GetSourceFileWithOutput(output)) {
+    if (cmCustomCommand* cc = sf->GetCustomCommand()) {
+      cc->AppendCommands(commandLines);
+      cc->AppendDepends(depends);
+      cc->AppendImplicitDepends(implicit_depends);
+      return;
+    }
+  }
+
+  // No existing command found.
+  lg.GetCMakeInstance()->IssueMessage(
+    MessageType::FATAL_ERROR,
+    cmStrCat("Attempt to append to output\n  ", output,
+             "\nwhich is not already a custom command output."),
+    lfbt);
+}
+
+void AddUtilityCommand(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+                       cmCommandOrigin origin, cmTarget* target,
+                       const cmUtilityOutput& force, const char* workingDir,
+                       const std::vector<std::string>& byproducts,
+                       const std::vector<std::string>& depends,
+                       const cmCustomCommandLines& commandLines,
+                       bool escapeOldStyle, const char* comment,
+                       bool uses_terminal, bool command_expand_lists,
+                       const std::string& job_pool)
+{
+  // Always create the byproduct sources and mark them generated.
+  CreateGeneratedSource(lg, force.Name, origin, lfbt);
+  CreateGeneratedSources(lg, byproducts, origin, lfbt);
+
+  // Use an empty comment to avoid generation of default comment.
+  if (!comment) {
+    comment = "";
+  }
+
+  std::string no_main_dependency;
+  cmImplicitDependsList no_implicit_depends;
+  cmSourceFile* rule = AddCustomCommand(
+    lg, lfbt, { force.Name }, byproducts, depends, no_main_dependency,
+    no_implicit_depends, commandLines, comment, workingDir, /*replace=*/false,
+    escapeOldStyle, uses_terminal, command_expand_lists, /*depfile=*/"",
+    job_pool);
+  if (rule) {
+    lg.GetMakefile()->AddTargetByproducts(target, byproducts);
+  }
+
+  if (!force.NameCMP0049.empty()) {
+    target->AddSource(force.NameCMP0049);
+  }
+}
+}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 12359db..8788c2f 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -7,6 +7,7 @@
 
 #include <iosfwd>
 #include <map>
+#include <memory>
 #include <set>
 #include <string>
 #include <unordered_map>
@@ -14,6 +15,7 @@
 
 #include "cm_kwiml.h"
 
+#include "cmCustomCommandTypes.h"
 #include "cmListFileCache.h"
 #include "cmMessageType.h"
 #include "cmOutputConverter.h"
@@ -22,13 +24,16 @@
 
 class cmComputeLinkInformation;
 class cmCustomCommandGenerator;
+class cmCustomCommandLines;
 class cmGeneratorTarget;
 class cmGlobalGenerator;
+class cmImplicitDependsList;
 class cmLinkLineComputer;
 class cmMakefile;
 class cmRulePlaceholderExpander;
 class cmSourceFile;
 class cmState;
+class cmTarget;
 class cmake;
 
 /** \class cmLocalGenerator
@@ -143,14 +148,16 @@
                               bool forResponseFile = false,
                               const std::string& config = "");
 
-  const std::vector<cmGeneratorTarget*>& GetGeneratorTargets() const
+  using GeneratorTargetVector =
+    std::vector<std::unique_ptr<cmGeneratorTarget>>;
+  const GeneratorTargetVector& GetGeneratorTargets() const
   {
     return this->GeneratorTargets;
   }
 
-  void AddGeneratorTarget(cmGeneratorTarget* gt);
+  void AddGeneratorTarget(std::unique_ptr<cmGeneratorTarget> gt);
   void AddImportedGeneratorTarget(cmGeneratorTarget* gt);
-  void AddOwnedImportedGeneratorTarget(cmGeneratorTarget* gt);
+  void AddOwnedImportedGeneratorTarget(std::unique_ptr<cmGeneratorTarget> gt);
 
   cmGeneratorTarget* FindLocalNonAliasGeneratorTarget(
     const std::string& name) const;
@@ -292,6 +299,51 @@
                          cmGeneratorTarget* target, const std::string& lang,
                          const std::string& config);
 
+  /**
+   * Add a custom PRE_BUILD, PRE_LINK, or POST_BUILD command to a target.
+   */
+  cmTarget* AddCustomCommandToTarget(
+    const std::string& target, const std::vector<std::string>& byproducts,
+    const std::vector<std::string>& depends,
+    const cmCustomCommandLines& commandLines, cmCustomCommandType type,
+    const char* comment, const char* workingDir, bool escapeOldStyle = true,
+    bool uses_terminal = false, const std::string& depfile = "",
+    const std::string& job_pool = "", bool command_expand_lists = false,
+    cmObjectLibraryCommands objLibCommands = cmObjectLibraryCommands::Reject);
+
+  /**
+   * Add a custom command to a source file.
+   */
+  cmSourceFile* AddCustomCommandToOutput(
+    const std::string& output, const std::vector<std::string>& depends,
+    const std::string& main_dependency,
+    const cmCustomCommandLines& commandLines, const char* comment,
+    const char* workingDir, bool replace = false, bool escapeOldStyle = true,
+    bool uses_terminal = false, bool command_expand_lists = false,
+    const std::string& depfile = "", const std::string& job_pool = "");
+  cmSourceFile* AddCustomCommandToOutput(
+    const std::vector<std::string>& outputs,
+    const std::vector<std::string>& byproducts,
+    const std::vector<std::string>& depends,
+    const std::string& main_dependency,
+    const cmImplicitDependsList& implicit_depends,
+    const cmCustomCommandLines& commandLines, const char* comment,
+    const char* workingDir, bool replace = false, bool escapeOldStyle = true,
+    bool uses_terminal = false, bool command_expand_lists = false,
+    const std::string& depfile = "", const std::string& job_pool = "");
+
+  /**
+   * Add a utility to the build.  A utility target is a command that is run
+   * every time the target is built.
+   */
+  cmTarget* AddUtilityCommand(
+    const std::string& utilityName, bool excludeFromAll,
+    const char* workingDir, const std::vector<std::string>& byproducts,
+    const std::vector<std::string>& depends,
+    const cmCustomCommandLines& commandLines, bool escapeOldStyle = true,
+    const char* comment = nullptr, bool uses_terminal = false,
+    bool command_expand_lists = false, const std::string& job_pool = "");
+
   std::string GetProjectName() const;
 
   /** Compute the language used to compile the given source file.  */
@@ -461,11 +513,11 @@
   using GeneratorTargetMap =
     std::unordered_map<std::string, cmGeneratorTarget*>;
   GeneratorTargetMap GeneratorTargetSearchIndex;
-  std::vector<cmGeneratorTarget*> GeneratorTargets;
+  GeneratorTargetVector GeneratorTargets;
 
   std::set<cmGeneratorTarget const*> WarnCMP0063;
   GeneratorTargetMap ImportedGeneratorTargets;
-  std::vector<cmGeneratorTarget*> OwnedImportedGeneratorTargets;
+  GeneratorTargetVector OwnedImportedGeneratorTargets;
   std::map<std::string, std::string> AliasTargets;
 
   std::map<std::string, std::string> Compilers;
@@ -494,4 +546,46 @@
                                      std::string::size_type max_total_len);
 #endif
 
+namespace detail {
+void AddCustomCommandToTarget(cmLocalGenerator& lg,
+                              const cmListFileBacktrace& lfbt,
+                              cmCommandOrigin origin, cmTarget* target,
+                              const std::vector<std::string>& byproducts,
+                              const std::vector<std::string>& depends,
+                              const cmCustomCommandLines& commandLines,
+                              cmCustomCommandType type, const char* comment,
+                              const char* workingDir, bool escapeOldStyle,
+                              bool uses_terminal, const std::string& depfile,
+                              const std::string& job_pool,
+                              bool command_expand_lists);
+
+cmSourceFile* AddCustomCommandToOutput(
+  cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+  cmCommandOrigin origin, const std::vector<std::string>& outputs,
+  const std::vector<std::string>& byproducts,
+  const std::vector<std::string>& depends, const std::string& main_dependency,
+  const cmImplicitDependsList& implicit_depends,
+  const cmCustomCommandLines& commandLines, const char* comment,
+  const char* workingDir, bool replace, bool escapeOldStyle,
+  bool uses_terminal, bool command_expand_lists, const std::string& depfile,
+  const std::string& job_pool);
+
+void AppendCustomCommandToOutput(cmLocalGenerator& lg,
+                                 const cmListFileBacktrace& lfbt,
+                                 const std::string& output,
+                                 const std::vector<std::string>& depends,
+                                 const cmImplicitDependsList& implicit_depends,
+                                 const cmCustomCommandLines& commandLines);
+
+void AddUtilityCommand(cmLocalGenerator& lg, const cmListFileBacktrace& lfbt,
+                       cmCommandOrigin origin, cmTarget* target,
+                       const cmUtilityOutput& force, const char* workingDir,
+                       const std::vector<std::string>& byproducts,
+                       const std::vector<std::string>& depends,
+                       const cmCustomCommandLines& commandLines,
+                       bool escapeOldStyle, const char* comment,
+                       bool uses_terminal, bool command_expand_lists,
+                       const std::string& job_pool);
+}
+
 #endif
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index 4b10798..29c169f 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -5,6 +5,7 @@
 #include <algorithm>
 #include <utility>
 
+#include "cmAlgorithms.h"
 #include "cmGeneratorTarget.h"
 #include "cmGhsMultiTargetGenerator.h"
 #include "cmGlobalGenerator.h"
@@ -50,10 +51,11 @@
 
 void cmLocalGhsMultiGenerator::Generate()
 {
-  std::vector<cmGeneratorTarget*> remaining = this->GetGeneratorTargets();
+  std::vector<cmGeneratorTarget*> remaining;
+  cmAppend(remaining, this->GetGeneratorTargets());
   for (auto& t : remaining) {
     if (t) {
-      GenerateTargetsDepthFirst(t, remaining);
+      this->GenerateTargetsDepthFirst(t, remaining);
     }
   }
 }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 134bbe1..ea500ac 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -82,11 +82,11 @@
     }
   }
 
-  for (cmGeneratorTarget* target : this->GetGeneratorTargets()) {
+  for (const auto& target : this->GetGeneratorTargets()) {
     if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
-    auto tg = cmNinjaTargetGenerator::New(target);
+    auto tg = cmNinjaTargetGenerator::New(target.get());
     if (tg) {
       tg->Generate();
     }
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4a70248..7b6d0f3 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -121,12 +121,12 @@
   // Generate the rule files for each target.
   cmGlobalUnixMakefileGenerator3* gg =
     static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
-  for (cmGeneratorTarget* target : this->GetGeneratorTargets()) {
+  for (const auto& target : this->GetGeneratorTargets()) {
     if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
     std::unique_ptr<cmMakefileTargetGenerator> tg(
-      cmMakefileTargetGenerator::New(target));
+      cmMakefileTargetGenerator::New(target.get()));
     if (tg) {
       tg->WriteRuleFiles();
       gg->RecordTargetProgress(tg.get());
@@ -157,7 +157,7 @@
 void cmLocalUnixMakefileGenerator3::GetLocalObjectFiles(
   std::map<std::string, LocalObjectInfo>& localObjectFiles)
 {
-  for (cmGeneratorTarget* gt : this->GetGeneratorTargets()) {
+  for (const auto& gt : this->GetGeneratorTargets()) {
     if (gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
@@ -165,7 +165,7 @@
     gt->GetObjectSources(objectSources, this->ConfigName);
     // Compute full path to object file directory for this target.
     std::string dir = cmStrCat(gt->LocalGenerator->GetCurrentBinaryDirectory(),
-                               '/', this->GetTargetDirectory(gt), '/');
+                               '/', this->GetTargetDirectory(gt.get()), '/');
     // Compute the name of each object file.
     for (cmSourceFile const* sf : objectSources) {
       bool hasSourceExtension = true;
@@ -176,7 +176,7 @@
       }
       LocalObjectInfo& info = localObjectFiles[objectName];
       info.HasSourceExtension = hasSourceExtension;
-      info.emplace_back(gt, sf->GetLanguage());
+      info.emplace_back(gt.get(), sf->GetLanguage());
     }
   }
 }
@@ -352,7 +352,7 @@
   // for each target we just provide a rule to cd up to the top and do a make
   // on the target
   std::string localName;
-  for (cmGeneratorTarget* target : this->GetGeneratorTargets()) {
+  for (const auto& target : this->GetGeneratorTargets()) {
     if ((target->GetType() == cmStateEnums::EXECUTABLE) ||
         (target->GetType() == cmStateEnums::STATIC_LIBRARY) ||
         (target->GetType() == cmStateEnums::SHARED_LIBRARY) ||
@@ -362,7 +362,8 @@
       emitted.insert(target->GetName());
 
       // for subdirs add a rule to build this specific target by name.
-      localName = cmStrCat(this->GetRelativeTargetDirectory(target), "/rule");
+      localName =
+        cmStrCat(this->GetRelativeTargetDirectory(target.get()), "/rule");
       commands.clear();
       depends.clear();
 
@@ -383,11 +384,11 @@
       }
 
       // Add a fast rule to build the target
-      std::string makefileName =
-        cmStrCat(this->GetRelativeTargetDirectory(target), "/build.make");
+      std::string makefileName = cmStrCat(
+        this->GetRelativeTargetDirectory(target.get()), "/build.make");
       // make sure the makefile name is suitable for a makefile
       std::string makeTargetName =
-        cmStrCat(this->GetRelativeTargetDirectory(target), "/build");
+        cmStrCat(this->GetRelativeTargetDirectory(target.get()), "/build");
       localName = cmStrCat(target->GetName(), "/fast");
       depends.clear();
       commands.clear();
@@ -401,8 +402,8 @@
       // Add a local name for the rule to relink the target before
       // installation.
       if (target->NeedRelinkBeforeInstall(this->ConfigName)) {
-        makeTargetName =
-          cmStrCat(this->GetRelativeTargetDirectory(target), "/preinstall");
+        makeTargetName = cmStrCat(
+          this->GetRelativeTargetDirectory(target.get()), "/preinstall");
         localName = cmStrCat(target->GetName(), "/preinstall");
         depends.clear();
         commands.clear();
@@ -628,7 +629,7 @@
     << "# The command to remove a file.\n"
     << "RM = "
     << cmakeShellCommand
-    << " -E remove -f\n"
+    << " -E rm -f\n"
     << "\n";
   makefileStream
     << "# Escaping for special characters.\n"
@@ -1551,8 +1552,8 @@
   this->WriteDivider(ruleFileStream);
   ruleFileStream << "# Targets provided globally by CMake.\n"
                  << "\n";
-  const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
-  for (cmGeneratorTarget* gt : targets) {
+  const auto& targets = this->GetGeneratorTargets();
+  for (const auto& gt : targets) {
     if (gt->GetType() == cmStateEnums::GLOBAL_TARGET) {
       std::string targetString =
         "Special rule for the target " + gt->GetName();
@@ -1573,10 +1574,10 @@
       // Global targets store their rules in pre- and post-build commands.
       this->AppendCustomDepends(depends, gt->GetPreBuildCommands());
       this->AppendCustomDepends(depends, gt->GetPostBuildCommands());
-      this->AppendCustomCommands(commands, gt->GetPreBuildCommands(), gt,
+      this->AppendCustomCommands(commands, gt->GetPreBuildCommands(), gt.get(),
                                  this->GetCurrentBinaryDirectory());
-      this->AppendCustomCommands(commands, gt->GetPostBuildCommands(), gt,
-                                 this->GetCurrentBinaryDirectory());
+      this->AppendCustomCommands(commands, gt->GetPostBuildCommands(),
+                                 gt.get(), this->GetCurrentBinaryDirectory());
       std::string targetName = gt->GetName();
       this->WriteMakeRule(ruleFileStream, targetString.c_str(), targetName,
                           depends, commands, true);
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index f3d828b..d9c4ce0 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -4,6 +4,7 @@
 
 #include "cm_expat.h"
 
+#include "cmAlgorithms.h"
 #include "cmGeneratorTarget.h"
 #include "cmGlobalVisualStudio10Generator.h"
 #include "cmMakefile.h"
@@ -101,10 +102,11 @@
 
 void cmLocalVisualStudio10Generator::Generate()
 {
-  std::vector<cmGeneratorTarget*> remaining = this->GetGeneratorTargets();
+  std::vector<cmGeneratorTarget*> remaining;
+  cmAppend(remaining, this->GetGeneratorTargets());
   for (auto& t : remaining) {
     if (t) {
-      GenerateTargetsDepthFirst(t, remaining);
+      this->GenerateTargetsDepthFirst(t, remaining);
     }
   }
   this->WriteStampFiles();
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ff1eaec..0758fd4 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -64,8 +64,8 @@
 void cmLocalVisualStudio7Generator::AddHelperCommands()
 {
   // Now create GUIDs for targets
-  const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
-  for (cmGeneratorTarget const* l : tgts) {
+  const auto& tgts = this->GetGeneratorTargets();
+  for (const auto& l : tgts) {
     if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
@@ -89,8 +89,8 @@
   // Visual Studio .NET 2003 Service Pack 1 will not run post-build
   // commands for targets in which no sources are built.  Add dummy
   // rules to force these targets to build.
-  const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
-  for (cmGeneratorTarget* l : tgts) {
+  const auto& tgts = this->GetGeneratorTargets();
+  for (auto& l : tgts) {
     if (l->GetType() == cmStateEnums::GLOBAL_TARGET) {
       std::vector<std::string> no_depends;
       cmCustomCommandLines force_commands =
@@ -102,9 +102,9 @@
             this->Makefile->GetOrCreateGeneratedSource(force)) {
         sf->SetProperty("SYMBOLIC", "1");
       }
-      if (cmSourceFile* file = this->Makefile->AddCustomCommandToOutput(
-            force.c_str(), no_depends, no_main_dependency, force_commands, " ",
-            0, true)) {
+      if (cmSourceFile* file = this->AddCustomCommandToOutput(
+            force, no_depends, no_main_dependency, force_commands, " ",
+            nullptr, true)) {
         l->AddSource(file->ResolveFullPath());
       }
     }
@@ -125,17 +125,17 @@
   }
 
   // Get the set of targets in this directory.
-  const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
+  const auto& tgts = this->GetGeneratorTargets();
 
   // Create the project file for each target.
-  for (cmGeneratorTarget* l : tgts) {
+  for (const auto& l : tgts) {
     if (l->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
       continue;
     }
     // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
     // so don't build a projectfile for it
     if (!l->GetProperty("EXTERNAL_MSPROJECT")) {
-      this->CreateSingleVCProj(l->GetName(), l);
+      this->CreateSingleVCProj(l->GetName(), l.get());
     }
   }
 }
@@ -259,9 +259,9 @@
   const char* no_working_directory = nullptr;
   std::string fullpathStampName =
     cmSystemTools::CollapseFullPath(stampName.c_str());
-  this->Makefile->AddCustomCommandToOutput(
-    fullpathStampName, listFiles, makefileIn, commandLines, comment.c_str(),
-    no_working_directory, true, false);
+  this->AddCustomCommandToOutput(fullpathStampName, listFiles, makefileIn,
+                                 commandLines, comment.c_str(),
+                                 no_working_directory, true, false);
   if (cmSourceFile* file = this->Makefile->GetSource(makefileIn.c_str())) {
     // Finalize the source file path now since we're adding this after
     // the generator validated all project-named sources.
@@ -1329,7 +1329,7 @@
   // Add CMakeLists.txt file with rule to re-run CMake for user convenience.
   if (target->GetType() != cmStateEnums::GLOBAL_TARGET &&
       target->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
-    if (cmSourceFile const* sf = this->CreateVCProjBuildRule()) {
+    if (cmSourceFile* sf = this->CreateVCProjBuildRule()) {
       cmGeneratorTarget::AllConfigSource acs;
       acs.Source = sf;
       acs.Kind = cmGeneratorTarget::SourceKindCustomCommand;
@@ -2053,7 +2053,7 @@
 }
 
 void cmVS7GeneratorOptions::OutputFlag(std::ostream& fout, int indent,
-                                       const char* flag,
+                                       const std::string& flag,
                                        const std::string& content)
 {
   fout.fill('\t');
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 671783f..22a5f9a 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -30,7 +30,7 @@
     : cmVisualStudioGeneratorOptions(lg, tool, table, extraTable)
   {
   }
-  void OutputFlag(std::ostream& fout, int indent, const char* tag,
+  void OutputFlag(std::ostream& fout, int indent, const std::string& tag,
                   const std::string& content) override;
 };
 
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 336e3a5..8d50898 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -104,8 +104,8 @@
   std::vector<std::string> no_depends;
   cmCustomCommandLines commands = cmMakeSingleCommandLine(
     { cmSystemTools::GetCMakeCommand(), "-E", "make_directory", impDir });
-  pcc.reset(new cmCustomCommand(0, no_output, no_byproducts, no_depends,
-                                commands, 0, 0));
+  pcc.reset(new cmCustomCommand(no_output, no_byproducts, no_depends, commands,
+                                cmListFileBacktrace(), nullptr, nullptr));
   pcc->SetEscapeOldStyle(false);
   pcc->SetEscapeAllowMakeVars(true);
   return pcc;
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 5a06d4a..ac0d35e 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -40,7 +40,7 @@
 {
   cmLocalGenerator::Generate();
 
-  for (auto target : this->GetGeneratorTargets()) {
+  for (const auto& target : this->GetGeneratorTargets()) {
     target->HasMacOSXRpathInstallNameDir("");
   }
 }
@@ -49,7 +49,7 @@
 {
   cmLocalGenerator::GenerateInstallRules();
 
-  for (auto target : this->GetGeneratorTargets()) {
+  for (const auto& target : this->GetGeneratorTargets()) {
     target->HasMacOSXRpathInstallNameDir("");
   }
 }
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f143ef7..dc0b50f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -14,7 +14,7 @@
 #include <utility>
 
 #include <cm/iterator>
-#include <cm/memory>
+#include <cm/optional>
 
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
@@ -36,6 +36,7 @@
 #include "cmInstallGenerator.h" // IWYU pragma: keep
 #include "cmInstallSubdirectoryGenerator.h"
 #include "cmListFileCache.h"
+#include "cmLocalGenerator.h"
 #include "cmMessageType.h"
 #include "cmRange.h"
 #include "cmSourceFile.h"
@@ -146,7 +147,7 @@
       this->ExecutionStatusStack.back()->SetNestedError();
     }
   }
-  this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
+  this->GetCMakeInstance()->IssueMessage(t, text, this->Backtrace);
 }
 
 bool cmMakefile::CheckCMP0037(std::string const& targetName,
@@ -780,21 +781,25 @@
 };
 }
 
-void cmMakefile::AddFinalAction(FinalAction action)
+void cmMakefile::AddGeneratorAction(GeneratorAction action)
 {
-  this->FinalActions.push_back(std::move(action));
+  assert(!this->GeneratorActionsInvoked);
+  this->GeneratorActions.emplace_back(std::move(action), this->Backtrace);
 }
 
-void cmMakefile::FinalPass()
+void cmMakefile::DoGenerate(cmLocalGenerator& lg)
 {
   // do all the variable expansions here
   this->ExpandVariablesCMP0019();
 
   // give all the commands a chance to do something
   // after the file has been parsed before generation
-  for (FinalAction& action : this->FinalActions) {
-    action(*this);
+  for (const BT<GeneratorAction>& action : this->GeneratorActions) {
+    action.Value(lg, action.Backtrace);
   }
+  this->GeneratorActionsInvoked = true;
+  this->DelayedOutputFiles.clear();
+  this->DelayedOutputFilesHaveGenex = false;
 
   // go through all configured files and see which ones still exist.
   // we don't want cmake to re-run if a configured file is created and deleted
@@ -809,9 +814,9 @@
 }
 
 // Generate the output file
-void cmMakefile::ConfigureFinalPass()
+void cmMakefile::Generate(cmLocalGenerator& lg)
 {
-  this->FinalPass();
+  this->DoGenerate(lg);
   const char* oldValue = this->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
   if (oldValue &&
       cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, oldValue, "2.4")) {
@@ -825,6 +830,39 @@
   }
 }
 
+namespace {
+// There are still too many implicit backtraces through cmMakefile.  As a
+// workaround we reset the backtrace temporarily.
+struct BacktraceGuard
+{
+  BacktraceGuard(cmListFileBacktrace& lfbt, cmListFileBacktrace current)
+    : Backtrace(lfbt)
+    , Previous(lfbt)
+  {
+    this->Backtrace = std::move(current);
+  }
+
+  ~BacktraceGuard() { this->Backtrace = std::move(Previous); }
+
+private:
+  cmListFileBacktrace& Backtrace;
+  cmListFileBacktrace Previous;
+};
+
+cm::optional<std::string> MakeOptionalString(const char* str)
+{
+  if (str) {
+    return str;
+  }
+  return cm::nullopt;
+}
+
+const char* GetCStrOrNull(const cm::optional<std::string>& str)
+{
+  return str ? str->c_str() : nullptr;
+}
+}
+
 bool cmMakefile::ValidateCustomCommand(
   const cmCustomCommandLines& commandLines) const
 {
@@ -842,7 +880,8 @@
 }
 
 cmTarget* cmMakefile::GetCustomCommandTarget(
-  const std::string& target, cmObjectLibraryCommands objLibCommands) const
+  const std::string& target, cmObjectLibraryCommands objLibCommands,
+  const cmListFileBacktrace& lfbt) const
 {
   // Find the target to which to add the custom command.
   auto ti = this->Targets.find(target);
@@ -876,7 +915,7 @@
         e << "No TARGET '" << target
           << "' has been created in this directory.";
       }
-      this->IssueMessage(messageType, e.str());
+      this->GetCMakeInstance()->IssueMessage(messageType, e.str(), lfbt);
     }
 
     return nullptr;
@@ -889,7 +928,8 @@
     e << "Target \"" << target
       << "\" is an OBJECT library "
          "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
-    this->IssueMessage(MessageType::FATAL_ERROR, e.str());
+    this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
+                                           lfbt);
     return nullptr;
   }
   if (t->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
@@ -897,7 +937,8 @@
     e << "Target \"" << target
       << "\" is an INTERFACE library "
          "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
-    this->IssueMessage(MessageType::FATAL_ERROR, e.str());
+    this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
+                                           lfbt);
     return nullptr;
   }
 
@@ -910,9 +951,10 @@
   const cmCustomCommandLines& commandLines, cmCustomCommandType type,
   const char* comment, const char* workingDir, bool escapeOldStyle,
   bool uses_terminal, const std::string& depfile, const std::string& job_pool,
-  bool command_expand_lists, cmObjectLibraryCommands objLibCommands)
+  bool command_expand_lists)
 {
-  cmTarget* t = this->GetCustomCommandTarget(target, objLibCommands);
+  cmTarget* t = this->GetCustomCommandTarget(
+    target, cmObjectLibraryCommands::Reject, this->Backtrace);
 
   // Validate custom commands.
   if (!t || !this->ValidateCustomCommand(commandLines)) {
@@ -920,175 +962,83 @@
   }
 
   // Always create the byproduct sources and mark them generated.
-  this->CreateGeneratedSources(byproducts);
+  this->CreateGeneratedByproducts(byproducts);
 
-  this->CommitCustomCommandToTarget(
-    t, byproducts, depends, commandLines, type, comment, workingDir,
-    escapeOldStyle, uses_terminal, depfile, job_pool, command_expand_lists);
+  // Strings could be moved into the callback function with C++14.
+  cm::optional<std::string> commentStr = MakeOptionalString(comment);
+  cm::optional<std::string> workingStr = MakeOptionalString(workingDir);
+
+  // Dispatch command creation to allow generator expressions in outputs.
+  this->AddGeneratorAction([=](cmLocalGenerator& lg,
+                               const cmListFileBacktrace& lfbt) {
+    BacktraceGuard guard(this->Backtrace, lfbt);
+    detail::AddCustomCommandToTarget(
+      lg, lfbt, cmCommandOrigin::Project, t, byproducts, depends, commandLines,
+      type, GetCStrOrNull(commentStr), GetCStrOrNull(workingStr),
+      escapeOldStyle, uses_terminal, depfile, job_pool, command_expand_lists);
+  });
 
   return t;
 }
 
-void cmMakefile::CommitCustomCommandToTarget(
-  cmTarget* target, const std::vector<std::string>& byproducts,
-  const std::vector<std::string>& depends,
-  const cmCustomCommandLines& commandLines, cmCustomCommandType type,
-  const char* comment, const char* workingDir, bool escapeOldStyle,
-  bool uses_terminal, const std::string& depfile, const std::string& job_pool,
-  bool command_expand_lists)
-{
-  // Add the command to the appropriate build step for the target.
-  std::vector<std::string> no_output;
-  cmCustomCommand cc(this, no_output, byproducts, depends, commandLines,
-                     comment, workingDir);
-  cc.SetEscapeOldStyle(escapeOldStyle);
-  cc.SetEscapeAllowMakeVars(true);
-  cc.SetUsesTerminal(uses_terminal);
-  cc.SetCommandExpandLists(command_expand_lists);
-  cc.SetDepfile(depfile);
-  cc.SetJobPool(job_pool);
-  switch (type) {
-    case cmCustomCommandType::PRE_BUILD:
-      target->AddPreBuildCommand(std::move(cc));
-      break;
-    case cmCustomCommandType::PRE_LINK:
-      target->AddPreLinkCommand(std::move(cc));
-      break;
-    case cmCustomCommandType::POST_BUILD:
-      target->AddPostBuildCommand(std::move(cc));
-      break;
-  }
-
-  this->AddTargetByproducts(target, byproducts);
-}
-
-cmSourceFile* cmMakefile::AddCustomCommandToOutput(
+void cmMakefile::AddCustomCommandToOutput(
   const std::string& output, const std::vector<std::string>& depends,
   const std::string& main_dependency, const cmCustomCommandLines& commandLines,
-  const char* comment, const char* workingDir, bool replace,
-  bool escapeOldStyle, bool uses_terminal, bool command_expand_lists,
-  const std::string& depfile, const std::string& job_pool)
+  const char* comment, const char* workingDir,
+  const CommandSourceCallback& callback, bool replace, bool escapeOldStyle,
+  bool uses_terminal, bool command_expand_lists, const std::string& depfile,
+  const std::string& job_pool)
 {
-  std::vector<std::string> outputs;
-  outputs.push_back(output);
   std::vector<std::string> no_byproducts;
   cmImplicitDependsList no_implicit_depends;
-  return this->AddCustomCommandToOutput(
-    outputs, no_byproducts, depends, main_dependency, no_implicit_depends,
-    commandLines, comment, workingDir, replace, escapeOldStyle, uses_terminal,
-    command_expand_lists, depfile, job_pool);
+  this->AddCustomCommandToOutput(
+    { output }, no_byproducts, depends, main_dependency, no_implicit_depends,
+    commandLines, comment, workingDir, callback, replace, escapeOldStyle,
+    uses_terminal, command_expand_lists, depfile, job_pool);
 }
 
-cmSourceFile* cmMakefile::AddCustomCommandToOutput(
+void cmMakefile::AddCustomCommandToOutput(
   const std::vector<std::string>& outputs,
   const std::vector<std::string>& byproducts,
   const std::vector<std::string>& depends, const std::string& main_dependency,
   const cmImplicitDependsList& implicit_depends,
   const cmCustomCommandLines& commandLines, const char* comment,
-  const char* workingDir, bool replace, bool escapeOldStyle,
-  bool uses_terminal, bool command_expand_lists, const std::string& depfile,
-  const std::string& job_pool)
+  const char* workingDir, const CommandSourceCallback& callback, bool replace,
+  bool escapeOldStyle, bool uses_terminal, bool command_expand_lists,
+  const std::string& depfile, const std::string& job_pool)
 {
   // Make sure there is at least one output.
   if (outputs.empty()) {
     cmSystemTools::Error("Attempt to add a custom rule with no output!");
-    return nullptr;
+    return;
   }
 
   // Validate custom commands.
   if (!this->ValidateCustomCommand(commandLines)) {
-    return nullptr;
+    return;
   }
 
   // Always create the output sources and mark them generated.
-  this->CreateGeneratedSources(outputs);
-  this->CreateGeneratedSources(byproducts);
+  this->CreateGeneratedOutputs(outputs);
+  this->CreateGeneratedByproducts(byproducts);
 
-  return this->CommitCustomCommandToOutput(
-    outputs, byproducts, depends, main_dependency, implicit_depends,
-    commandLines, comment, workingDir, replace, escapeOldStyle, uses_terminal,
-    command_expand_lists, depfile, job_pool);
-}
+  // Strings could be moved into the callback function with C++14.
+  cm::optional<std::string> commentStr = MakeOptionalString(comment);
+  cm::optional<std::string> workingStr = MakeOptionalString(workingDir);
 
-cmSourceFile* cmMakefile::CommitCustomCommandToOutput(
-  const std::vector<std::string>& outputs,
-  const std::vector<std::string>& byproducts,
-  const std::vector<std::string>& depends, const std::string& main_dependency,
-  const cmImplicitDependsList& implicit_depends,
-  const cmCustomCommandLines& commandLines, const char* comment,
-  const char* workingDir, bool replace, bool escapeOldStyle,
-  bool uses_terminal, bool command_expand_lists, const std::string& depfile,
-  const std::string& job_pool)
-{
-  // Choose a source file on which to store the custom command.
-  cmSourceFile* file = nullptr;
-  if (!commandLines.empty() && !main_dependency.empty()) {
-    // The main dependency was specified.  Use it unless a different
-    // custom command already used it.
-    file = this->GetSource(main_dependency);
-    if (file && file->GetCustomCommand() && !replace) {
-      // The main dependency already has a custom command.
-      if (commandLines == file->GetCustomCommand()->GetCommandLines()) {
-        // The existing custom command is identical.  Silently ignore
-        // the duplicate.
-        return file;
-      }
-      // The existing custom command is different.  We need to
-      // generate a rule file for this new command.
-      file = nullptr;
-    } else if (!file) {
-      file = this->CreateSource(main_dependency);
+  // Dispatch command creation to allow generator expressions in outputs.
+  this->AddGeneratorAction([=](cmLocalGenerator& lg,
+                               const cmListFileBacktrace& lfbt) {
+    BacktraceGuard guard(this->Backtrace, lfbt);
+    cmSourceFile* sf = detail::AddCustomCommandToOutput(
+      lg, lfbt, cmCommandOrigin::Project, outputs, byproducts, depends,
+      main_dependency, implicit_depends, commandLines,
+      GetCStrOrNull(commentStr), GetCStrOrNull(workingStr), replace,
+      escapeOldStyle, uses_terminal, command_expand_lists, depfile, job_pool);
+    if (callback && sf) {
+      callback(sf);
     }
-  }
-
-  // Generate a rule file if the main dependency is not available.
-  if (!file) {
-    cmGlobalGenerator* gg = this->GetGlobalGenerator();
-
-    // Construct a rule file associated with the first output produced.
-    std::string outName = gg->GenerateRuleFile(outputs[0]);
-
-    // Check if the rule file already exists.
-    file = this->GetSource(outName, cmSourceFileLocationKind::Known);
-    if (file && file->GetCustomCommand() && !replace) {
-      // The rule file already exists.
-      if (commandLines != file->GetCustomCommand()->GetCommandLines()) {
-        cmSystemTools::Error("Attempt to add a custom rule to output \"" +
-                             outName + "\" which already has a custom rule.");
-      }
-      return file;
-    }
-
-    // Create a cmSourceFile for the rule file.
-    if (!file) {
-      file =
-        this->CreateSource(outName, true, cmSourceFileLocationKind::Known);
-    }
-    file->SetProperty("__CMAKE_RULE", "1");
-  }
-
-  // Attach the custom command to the file.
-  if (file) {
-    // Construct a complete list of dependencies.
-    std::vector<std::string> depends2(depends);
-    if (!main_dependency.empty()) {
-      depends2.push_back(main_dependency);
-    }
-
-    std::unique_ptr<cmCustomCommand> cc = cm::make_unique<cmCustomCommand>(
-      this, outputs, byproducts, depends2, commandLines, comment, workingDir);
-    cc->SetEscapeOldStyle(escapeOldStyle);
-    cc->SetEscapeAllowMakeVars(true);
-    cc->SetImplicitDepends(implicit_depends);
-    cc->SetUsesTerminal(uses_terminal);
-    cc->SetCommandExpandLists(command_expand_lists);
-    cc->SetDepfile(depfile);
-    cc->SetJobPool(job_pool);
-    file->SetCustomCommand(std::move(cc));
-
-    this->AddSourceOutputs(file, outputs, byproducts);
-  }
-  return file;
+  });
 }
 
 void cmMakefile::AddCustomCommandOldStyle(
@@ -1136,11 +1086,8 @@
   if (sourceFiles.find(source)) {
     // The source looks like a real file.  Use it as the main dependency.
     for (std::string const& output : outputs) {
-      cmSourceFile* sf = this->AddCustomCommandToOutput(
-        output, depends, source, commandLines, comment, nullptr);
-      if (sf) {
-        addRuleFileToTarget(sf);
-      }
+      this->AddCustomCommandToOutput(output, depends, source, commandLines,
+                                     comment, nullptr, addRuleFileToTarget);
     }
   } else {
     std::string no_main_dependency;
@@ -1149,11 +1096,9 @@
 
     // The source may not be a real file.  Do not use a main dependency.
     for (std::string const& output : outputs) {
-      cmSourceFile* sf = this->AddCustomCommandToOutput(
-        output, depends2, no_main_dependency, commandLines, comment, nullptr);
-      if (sf) {
-        addRuleFileToTarget(sf);
-      }
+      this->AddCustomCommandToOutput(output, depends2, no_main_dependency,
+                                     commandLines, comment, nullptr,
+                                     addRuleFileToTarget);
     }
   }
 }
@@ -1170,29 +1115,18 @@
 
   // Validate custom commands.
   if (this->ValidateCustomCommand(commandLines)) {
-    // Add command factory to allow generator expressions in output.
-    this->CommitAppendCustomCommandToOutput(output, depends, implicit_depends,
-                                            commandLines);
+    // Dispatch command creation to allow generator expressions in outputs.
+    this->AddGeneratorAction(
+      [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
+        BacktraceGuard guard(this->Backtrace, lfbt);
+        detail::AppendCustomCommandToOutput(lg, lfbt, output, depends,
+                                            implicit_depends, commandLines);
+      });
   }
 
   return true;
 }
 
-void cmMakefile::CommitAppendCustomCommandToOutput(
-  const std::string& output, const std::vector<std::string>& depends,
-  const cmImplicitDependsList& implicit_depends,
-  const cmCustomCommandLines& commandLines)
-{
-  // Lookup an existing command.
-  if (cmSourceFile* sf = this->GetSourceFileWithOutput(output)) {
-    if (cmCustomCommand* cc = sf->GetCustomCommand()) {
-      cc->AppendCommands(commandLines);
-      cc->AppendDepends(depends);
-      cc->AppendImplicitDepends(implicit_depends);
-    }
-  }
-}
-
 cmUtilityOutput cmMakefile::GetUtilityOutput(cmTarget* target)
 {
   std::string force = cmStrCat(this->GetCurrentBinaryDirectory(),
@@ -1215,15 +1149,14 @@
 }
 
 cmTarget* cmMakefile::AddUtilityCommand(
-  const std::string& utilityName, cmCommandOrigin origin, bool excludeFromAll,
-  const char* workingDirectory, const std::vector<std::string>& byproducts,
+  const std::string& utilityName, bool excludeFromAll, const char* workingDir,
+  const std::vector<std::string>& byproducts,
   const std::vector<std::string>& depends,
   const cmCustomCommandLines& commandLines, bool escapeOldStyle,
   const char* comment, bool uses_terminal, bool command_expand_lists,
   const std::string& job_pool)
 {
-  cmTarget* target =
-    this->AddNewUtilityTarget(utilityName, origin, excludeFromAll);
+  cmTarget* target = this->AddNewUtilityTarget(utilityName, excludeFromAll);
 
   // Validate custom commands.
   if ((commandLines.empty() && depends.empty()) ||
@@ -1236,45 +1169,26 @@
   this->GetOrCreateGeneratedSource(force.Name);
 
   // Always create the byproduct sources and mark them generated.
-  this->CreateGeneratedSources(byproducts);
+  this->CreateGeneratedByproducts(byproducts);
 
-  if (!comment) {
-    // Use an empty comment to avoid generation of default comment.
-    comment = "";
-  }
+  // Strings could be moved into the callback function with C++14.
+  cm::optional<std::string> commentStr = MakeOptionalString(comment);
+  cm::optional<std::string> workingStr = MakeOptionalString(workingDir);
 
-  this->CommitUtilityCommand(target, force, workingDirectory, byproducts,
-                             depends, commandLines, escapeOldStyle, comment,
-                             uses_terminal, command_expand_lists, job_pool);
+  // Dispatch command creation to allow generator expressions in outputs.
+  this->AddGeneratorAction(
+    [=](cmLocalGenerator& lg, const cmListFileBacktrace& lfbt) {
+      BacktraceGuard guard(this->Backtrace, lfbt);
+      detail::AddUtilityCommand(lg, lfbt, cmCommandOrigin::Project, target,
+                                force, GetCStrOrNull(workingStr), byproducts,
+                                depends, commandLines, escapeOldStyle,
+                                GetCStrOrNull(commentStr), uses_terminal,
+                                command_expand_lists, job_pool);
+    });
 
   return target;
 }
 
-void cmMakefile::CommitUtilityCommand(
-  cmTarget* target, const cmUtilityOutput& force, const char* workingDirectory,
-  const std::vector<std::string>& byproducts,
-  const std::vector<std::string>& depends,
-  const cmCustomCommandLines& commandLines, bool escapeOldStyle,
-  const char* comment, bool uses_terminal, bool command_expand_lists,
-  const std::string& job_pool)
-{
-  std::vector<std::string> forced;
-  forced.push_back(force.Name);
-  std::string no_main_dependency;
-  cmImplicitDependsList no_implicit_depends;
-  bool no_replace = false;
-  cmSourceFile* sf = this->AddCustomCommandToOutput(
-    forced, byproducts, depends, no_main_dependency, no_implicit_depends,
-    commandLines, comment, workingDirectory, no_replace, escapeOldStyle,
-    uses_terminal, command_expand_lists, /*depfile=*/"", job_pool);
-  if (!force.NameCMP0049.empty()) {
-    target->AddSource(force.NameCMP0049);
-  }
-  if (sf) {
-    this->AddTargetByproducts(target, byproducts);
-  }
-}
-
 static void s_AddDefineFlag(std::string const& flag, std::string& dflags)
 {
   // remove any \n\r
@@ -1357,13 +1271,12 @@
 
 void cmMakefile::AddLinkDirectory(std::string const& directory, bool before)
 {
-  cmListFileBacktrace lfbt = this->GetBacktrace();
   if (before) {
-    this->StateSnapshot.GetDirectory().PrependLinkDirectoriesEntry(directory,
-                                                                   lfbt);
+    this->StateSnapshot.GetDirectory().PrependLinkDirectoriesEntry(
+      directory, this->Backtrace);
   } else {
-    this->StateSnapshot.GetDirectory().AppendLinkDirectoriesEntry(directory,
-                                                                  lfbt);
+    this->StateSnapshot.GetDirectory().AppendLinkDirectoriesEntry(
+      directory, this->Backtrace);
   }
 }
 
@@ -1820,20 +1733,19 @@
     return;
   }
 
-  cmListFileBacktrace lfbt = this->GetBacktrace();
   std::string entryString = cmJoin(incs, ";");
   if (before) {
     this->StateSnapshot.GetDirectory().PrependIncludeDirectoriesEntry(
-      entryString, lfbt);
+      entryString, this->Backtrace);
   } else {
     this->StateSnapshot.GetDirectory().AppendIncludeDirectoriesEntry(
-      entryString, lfbt);
+      entryString, this->Backtrace);
   }
 
   // Property on each target:
   for (auto& target : this->Targets) {
     cmTarget& t = target.second;
-    t.InsertInclude(entryString, lfbt, before);
+    t.InsertInclude(entryString, this->Backtrace, before);
   }
 }
 
@@ -2089,11 +2001,9 @@
 }
 
 cmTarget* cmMakefile::AddNewUtilityTarget(const std::string& utilityName,
-                                          cmCommandOrigin origin,
                                           bool excludeFromAll)
 {
   cmTarget* target = this->AddNewTarget(cmStateEnums::UTILITY, utilityName);
-  target->SetIsGeneratorProvided(origin == cmCommandOrigin::Generator);
   if (excludeFromAll) {
     target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
   }
@@ -2211,8 +2121,8 @@
       (!o->second.Sources.SourceIsByproduct ||
        kind == cmSourceOutputKind::OutputOrByproduct)) {
     // Source file could also be null pointer for example if we found the
-    // byproduct of a utility target or a PRE_BUILD, PRE_LINK, or POST_BUILD
-    // command of a target.
+    // byproduct of a utility target, a PRE_BUILD, PRE_LINK, or POST_BUILD
+    // command of a target, or a not yet created custom command.
     return o->second.Sources.Source;
   }
   return nullptr;
@@ -2220,12 +2130,20 @@
 
 bool cmMakefile::MightHaveCustomCommand(const std::string& name) const
 {
-  // This will have to be changed for delaying custom command creation, because
-  // GetSourceFileWithOutput requires the command to be already created.
-  if (cmSourceFile* sf = this->GetSourceFileWithOutput(name)) {
-    if (sf->GetCustomCommand()) {
-      return true;
-    }
+  if (this->DelayedOutputFilesHaveGenex ||
+      cmGeneratorExpression::Find(name) != std::string::npos) {
+    // Could be more restrictive, but for now we assume that there could always
+    // be a match when generator expressions are involved.
+    return true;
+  }
+  // Also see LinearGetSourceFileWithOutput.
+  if (!cmSystemTools::FileIsFullPath(name)) {
+    return AnyOutputMatches(name, this->DelayedOutputFiles);
+  }
+  // Otherwise we use an efficient lookup map.
+  auto o = this->OutputToSource.find(name);
+  if (o != this->OutputToSource.end()) {
+    return o->second.SourceMightBeOutput;
   }
   return false;
 }
@@ -2278,6 +2196,7 @@
   SourceEntry entry;
   entry.Sources.Source = source;
   entry.Sources.SourceIsByproduct = byproduct;
+  entry.SourceMightBeOutput = !byproduct;
 
   auto pr = this->OutputToSource.emplace(output, entry);
   if (!pr.second) {
@@ -2287,6 +2206,7 @@
         (current.Sources.SourceIsByproduct && !byproduct)) {
       current.Sources.Source = source;
       current.Sources.SourceIsByproduct = false;
+      current.SourceMightBeOutput = true;
     } else {
       // Multiple custom commands produce the same output but may
       // be attached to a different source file (MAIN_DEPENDENCY).
@@ -3553,11 +3473,41 @@
   return sf;
 }
 
-void cmMakefile::CreateGeneratedSources(
+void cmMakefile::CreateGeneratedOutputs(
   const std::vector<std::string>& outputs)
 {
-  for (std::string const& output : outputs) {
-    this->GetOrCreateGeneratedSource(output);
+  for (std::string const& o : outputs) {
+    if (cmGeneratorExpression::Find(o) == std::string::npos) {
+      this->GetOrCreateGeneratedSource(o);
+      this->AddDelayedOutput(o);
+    } else {
+      this->DelayedOutputFilesHaveGenex = true;
+    }
+  }
+}
+
+void cmMakefile::CreateGeneratedByproducts(
+  const std::vector<std::string>& byproducts)
+{
+  for (std::string const& o : byproducts) {
+    if (cmGeneratorExpression::Find(o) == std::string::npos) {
+      this->GetOrCreateGeneratedSource(o);
+    }
+  }
+}
+
+void cmMakefile::AddDelayedOutput(std::string const& output)
+{
+  // Note that this vector might contain the output names in a different order
+  // than in source file iteration order.
+  this->DelayedOutputFiles.push_back(output);
+
+  SourceEntry entry;
+  entry.SourceMightBeOutput = true;
+
+  auto pr = this->OutputToSource.emplace(output, entry);
+  if (!pr.second) {
+    pr.first->second.SourceMightBeOutput = true;
   }
 }
 
@@ -4029,16 +3979,14 @@
 
 void cmMakefile::SetProperty(const std::string& prop, const char* value)
 {
-  cmListFileBacktrace lfbt = this->GetBacktrace();
-  this->StateSnapshot.GetDirectory().SetProperty(prop, value, lfbt);
+  this->StateSnapshot.GetDirectory().SetProperty(prop, value, this->Backtrace);
 }
 
 void cmMakefile::AppendProperty(const std::string& prop, const char* value,
                                 bool asString)
 {
-  cmListFileBacktrace lfbt = this->GetBacktrace();
   this->StateSnapshot.GetDirectory().AppendProperty(prop, value, asString,
-                                                    lfbt);
+                                                    this->Backtrace);
 }
 
 const char* cmMakefile::GetProperty(const std::string& prop) const
@@ -4487,7 +4435,7 @@
 
   // Deprecate old policies, especially those that require a lot
   // of code to maintain the old behavior.
-  if (status == cmPolicies::OLD && id <= cmPolicies::CMP0067 &&
+  if (status == cmPolicies::OLD && id <= cmPolicies::CMP0069 &&
       !(this->GetCMakeInstance()->GetIsInTryCompile() &&
         (
           // Policies set by cmCoreTryCompile::TryCompileCode.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 6e59494..d0dceb9 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -49,6 +49,7 @@
 class cmGlobalGenerator;
 class cmImplicitDependsList;
 class cmInstallGenerator;
+class cmLocalGenerator;
 class cmMessenger;
 class cmSourceFile;
 class cmState;
@@ -151,54 +152,64 @@
   bool EnforceUniqueName(std::string const& name, std::string& msg,
                          bool isCustom = false) const;
 
-  using FinalAction = std::function<void(cmMakefile&)>;
+  using GeneratorAction =
+    std::function<void(cmLocalGenerator&, const cmListFileBacktrace&)>;
 
   /**
-   * Register an action that is executed during FinalPass
+   * Register an action that is executed during Generate
    */
-  void AddFinalAction(FinalAction action);
+  void AddGeneratorAction(GeneratorAction action);
 
   /**
-   * Perform FinalPass, Library dependency analysis etc before output of the
-   * makefile.
+   * Perform generate actions, Library dependency analysis etc before output of
+   * the makefile.
    */
-  void ConfigureFinalPass();
-
-  /**
-   * run all FinalActions.
-   */
-  void FinalPass();
+  void Generate(cmLocalGenerator& lg);
 
   /**
    * Get the target for PRE_BUILD, PRE_LINK, or POST_BUILD commands.
    */
-  cmTarget* GetCustomCommandTarget(
-    const std::string& target, cmObjectLibraryCommands objLibCommands) const;
+  cmTarget* GetCustomCommandTarget(const std::string& target,
+                                   cmObjectLibraryCommands objLibCommands,
+                                   const cmListFileBacktrace& lfbt) const;
 
-  /** Add a custom command to the build.  */
+  /**
+   * Dispatch adding a custom PRE_BUILD, PRE_LINK, or POST_BUILD command to a
+   * target.
+   */
   cmTarget* AddCustomCommandToTarget(
     const std::string& target, const std::vector<std::string>& byproducts,
     const std::vector<std::string>& depends,
     const cmCustomCommandLines& commandLines, cmCustomCommandType type,
     const char* comment, const char* workingDir, bool escapeOldStyle = true,
     bool uses_terminal = false, const std::string& depfile = "",
-    const std::string& job_pool = "", bool command_expand_lists = false,
-    cmObjectLibraryCommands objLibCommands = cmObjectLibraryCommands::Reject);
-  cmSourceFile* AddCustomCommandToOutput(
+    const std::string& job_pool = "", bool command_expand_lists = false);
+
+  /**
+   * Called for each file with custom command.
+   */
+  using CommandSourceCallback = std::function<void(cmSourceFile*)>;
+
+  /**
+   * Dispatch adding a custom command to a source file.
+   */
+  void AddCustomCommandToOutput(
     const std::string& output, const std::vector<std::string>& depends,
     const std::string& main_dependency,
     const cmCustomCommandLines& commandLines, const char* comment,
-    const char* workingDir, bool replace = false, bool escapeOldStyle = true,
+    const char* workingDir, const CommandSourceCallback& callback = nullptr,
+    bool replace = false, bool escapeOldStyle = true,
     bool uses_terminal = false, bool command_expand_lists = false,
     const std::string& depfile = "", const std::string& job_pool = "");
-  cmSourceFile* AddCustomCommandToOutput(
+  void AddCustomCommandToOutput(
     const std::vector<std::string>& outputs,
     const std::vector<std::string>& byproducts,
     const std::vector<std::string>& depends,
     const std::string& main_dependency,
     const cmImplicitDependsList& implicit_depends,
     const cmCustomCommandLines& commandLines, const char* comment,
-    const char* workingDir, bool replace = false, bool escapeOldStyle = true,
+    const char* workingDir, const CommandSourceCallback& callback = nullptr,
+    bool replace = false, bool escapeOldStyle = true,
     bool uses_terminal = false, bool command_expand_lists = false,
     const std::string& depfile = "", const std::string& job_pool = "");
   void AddCustomCommandOldStyle(const std::string& target,
@@ -244,7 +255,7 @@
 
   /** Create a target instance for the utility.  */
   cmTarget* AddNewUtilityTarget(const std::string& utilityName,
-                                cmCommandOrigin origin, bool excludeFromAll);
+                                bool excludeFromAll);
 
   /**
    * Add an executable to the build.
@@ -259,13 +270,12 @@
   cmUtilityOutput GetUtilityOutput(cmTarget* target);
 
   /**
-   * Add a utility to the build.  A utility target is a command that
-   * is run every time the target is built.
+   * Dispatch adding a utility to the build.  A utility target is a command
+   * that is run every time the target is built.
    */
   cmTarget* AddUtilityCommand(
-    const std::string& utilityName, cmCommandOrigin origin,
-    bool excludeFromAll, const char* workingDirectory,
-    const std::vector<std::string>& byproducts,
+    const std::string& utilityName, bool excludeFromAll,
+    const char* workingDir, const std::vector<std::string>& byproducts,
     const std::vector<std::string>& depends,
     const cmCustomCommandLines& commandLines, bool escapeOldStyle = true,
     const char* comment = nullptr, bool uses_terminal = false,
@@ -1001,7 +1011,6 @@
   size_t ObjectLibrariesSourceGroupIndex;
 #endif
 
-  std::vector<FinalAction> FinalActions;
   cmGlobalGenerator* GlobalGenerator;
   bool IsFunctionBlocked(const cmListFileFunction& lff,
                          cmExecutionStatus& status);
@@ -1011,6 +1020,8 @@
   cmListFileBacktrace Backtrace;
   int RecursionDepth;
 
+  void DoGenerate(cmLocalGenerator& lg);
+
   void ReadListFile(cmListFile const& listFile,
                     const std::string& filenametoread);
 
@@ -1080,38 +1091,15 @@
 
   bool ValidateCustomCommand(const cmCustomCommandLines& commandLines) const;
 
-  void CreateGeneratedSources(const std::vector<std::string>& outputs);
+  void CreateGeneratedOutputs(const std::vector<std::string>& outputs);
+  void CreateGeneratedByproducts(const std::vector<std::string>& byproducts);
 
-  void CommitCustomCommandToTarget(
-    cmTarget* target, const std::vector<std::string>& byproducts,
-    const std::vector<std::string>& depends,
-    const cmCustomCommandLines& commandLines, cmCustomCommandType type,
-    const char* comment, const char* workingDir, bool escapeOldStyle,
-    bool uses_terminal, const std::string& depfile,
-    const std::string& job_pool, bool command_expand_lists);
-  cmSourceFile* CommitCustomCommandToOutput(
-    const std::vector<std::string>& outputs,
-    const std::vector<std::string>& byproducts,
-    const std::vector<std::string>& depends,
-    const std::string& main_dependency,
-    const cmImplicitDependsList& implicit_depends,
-    const cmCustomCommandLines& commandLines, const char* comment,
-    const char* workingDir, bool replace, bool escapeOldStyle,
-    bool uses_terminal, bool command_expand_lists, const std::string& depfile,
-    const std::string& job_pool);
-  void CommitAppendCustomCommandToOutput(
-    const std::string& output, const std::vector<std::string>& depends,
-    const cmImplicitDependsList& implicit_depends,
-    const cmCustomCommandLines& commandLines);
+  std::vector<BT<GeneratorAction>> GeneratorActions;
+  bool GeneratorActionsInvoked = false;
+  bool DelayedOutputFilesHaveGenex = false;
+  std::vector<std::string> DelayedOutputFiles;
 
-  void CommitUtilityCommand(cmTarget* target, const cmUtilityOutput& force,
-                            const char* workingDirectory,
-                            const std::vector<std::string>& byproducts,
-                            const std::vector<std::string>& depends,
-                            const cmCustomCommandLines& commandLines,
-                            bool escapeOldStyle, const char* comment,
-                            bool uses_terminal, bool command_expand_lists,
-                            const std::string& job_pool);
+  void AddDelayedOutput(std::string const& output);
 
   /**
    * See LinearGetSourceFileWithOutput for background information
@@ -1131,6 +1119,7 @@
   struct SourceEntry
   {
     cmSourcesWithOutput Sources;
+    bool SourceMightBeOutput = false;
   };
 
   // A map for fast output to input look up.
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx
index 96a6386..bf8183b 100644
--- a/Source/cmMessageCommand.cxx
+++ b/Source/cmMessageCommand.cxx
@@ -3,6 +3,11 @@
 #include "cmMessageCommand.h"
 
 #include <cassert>
+#include <utility>
+
+#include <cm/string_view>
+
+#include "cm_static_string_view.hxx"
 
 #include "cmExecutionStatus.h"
 #include "cmMakefile.h"
@@ -13,6 +18,55 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
+namespace {
+
+enum class CheckingType
+{
+  UNDEFINED,
+  CHECK_START,
+  CHECK_PASS,
+  CHECK_FAIL
+};
+
+std::string IndentText(std::string text, cmMakefile& mf)
+{
+  auto indent =
+    cmJoin(cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_INDENT")), "");
+
+  const auto showContext = mf.GetCMakeInstance()->GetShowLogContext() ||
+    mf.IsOn("CMAKE_MESSAGE_CONTEXT_SHOW");
+  if (showContext) {
+    auto context = cmJoin(
+      cmExpandedList(mf.GetSafeDefinition("CMAKE_MESSAGE_CONTEXT")), ".");
+    if (!context.empty()) {
+      indent.insert(0u, cmStrCat("["_s, context, "] "_s));
+    }
+  }
+
+  if (!indent.empty()) {
+    cmSystemTools::ReplaceString(text, "\n", "\n" + indent);
+    text.insert(0u, indent);
+  }
+  return text;
+}
+
+void ReportCheckResult(cm::string_view what, std::string result,
+                       cmMakefile& mf)
+{
+  if (mf.GetCMakeInstance()->HasCheckInProgress()) {
+    auto text = mf.GetCMakeInstance()->GetTopCheckInProgressMessage() + " - " +
+      std::move(result);
+    mf.DisplayStatus(IndentText(std::move(text), mf), -1);
+  } else {
+    mf.GetMessenger()->DisplayMessage(
+      MessageType::AUTHOR_WARNING,
+      cmStrCat("Ignored "_s, what, " without CHECK_START"_s),
+      mf.GetBacktrace());
+  }
+}
+
+} // anonymous namespace
+
 // cmLibraryCommand
 bool cmMessageCommand(std::vector<std::string> const& args,
                       cmExecutionStatus& status)
@@ -21,11 +75,15 @@
     status.SetError("called with incorrect number of arguments");
     return false;
   }
+
+  auto& mf = status.GetMakefile();
+
   auto i = args.cbegin();
 
   auto type = MessageType::MESSAGE;
   auto fatal = false;
   auto level = cmake::LogLevel::LOG_UNDEFINED;
+  auto checkingType = CheckingType::UNDEFINED;
   if (*i == "SEND_ERROR") {
     type = MessageType::FATAL_ERROR;
     level = cmake::LogLevel::LOG_ERROR;
@@ -40,19 +98,30 @@
     level = cmake::LogLevel::LOG_WARNING;
     ++i;
   } else if (*i == "AUTHOR_WARNING") {
-    if (status.GetMakefile().IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") &&
-        !status.GetMakefile().IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS")) {
+    if (mf.IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") &&
+        !mf.IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS")) {
       fatal = true;
       type = MessageType::AUTHOR_ERROR;
       level = cmake::LogLevel::LOG_ERROR;
-    } else if (!status.GetMakefile().IsOn(
-                 "CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) {
+    } else if (!mf.IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) {
       type = MessageType::AUTHOR_WARNING;
       level = cmake::LogLevel::LOG_WARNING;
     } else {
       return true;
     }
     ++i;
+  } else if (*i == "CHECK_START") {
+    level = cmake::LogLevel::LOG_STATUS;
+    checkingType = CheckingType::CHECK_START;
+    ++i;
+  } else if (*i == "CHECK_PASS") {
+    level = cmake::LogLevel::LOG_STATUS;
+    checkingType = CheckingType::CHECK_PASS;
+    ++i;
+  } else if (*i == "CHECK_FAIL") {
+    level = cmake::LogLevel::LOG_STATUS;
+    checkingType = CheckingType::CHECK_FAIL;
+    ++i;
   } else if (*i == "STATUS") {
     level = cmake::LogLevel::LOG_STATUS;
     ++i;
@@ -66,12 +135,12 @@
     level = cmake::LogLevel::LOG_TRACE;
     ++i;
   } else if (*i == "DEPRECATION") {
-    if (status.GetMakefile().IsOn("CMAKE_ERROR_DEPRECATED")) {
+    if (mf.IsOn("CMAKE_ERROR_DEPRECATED")) {
       fatal = true;
       type = MessageType::DEPRECATION_ERROR;
       level = cmake::LogLevel::LOG_ERROR;
-    } else if (!status.GetMakefile().IsSet("CMAKE_WARN_DEPRECATED") ||
-               status.GetMakefile().IsOn("CMAKE_WARN_DEPRECATED")) {
+    } else if (!mf.IsSet("CMAKE_WARN_DEPRECATED") ||
+               mf.IsOn("CMAKE_WARN_DEPRECATED")) {
       type = MessageType::DEPRECATION_WARNING;
       level = cmake::LogLevel::LOG_WARNING;
     } else {
@@ -89,10 +158,19 @@
   assert("Message log level expected to be set" &&
          level != cmake::LogLevel::LOG_UNDEFINED);
 
-  auto desiredLevel = status.GetMakefile().GetCMakeInstance()->GetLogLevel();
+  auto desiredLevel = mf.GetCMakeInstance()->GetLogLevel();
   assert("Expected a valid log level here" &&
          desiredLevel != cmake::LogLevel::LOG_UNDEFINED);
 
+  // Command line option takes precedence over the cache variable
+  if (!mf.GetCMakeInstance()->WasLogLevelSetViaCLI()) {
+    const auto desiredLevelFromCache =
+      cmake::StringToLogLevel(mf.GetSafeDefinition("CMAKE_MESSAGE_LOG_LEVEL"));
+    if (desiredLevelFromCache != cmake::LogLevel::LOG_UNDEFINED) {
+      desiredLevel = desiredLevelFromCache;
+    }
+  }
+
   if (desiredLevel < level) {
     // Suppress the message
     return true;
@@ -100,37 +178,42 @@
 
   auto message = cmJoin(cmMakeRange(i, args.cend()), "");
 
-  if (cmake::LogLevel::LOG_NOTICE <= level) {
-    // Check if any indentation has requested:
-    // `CMAKE_MESSAGE_INDENT` is a list of "padding" pieces
-    // to be joined and prepended to the message lines.
-    auto indent = cmJoin(cmExpandedList(status.GetMakefile().GetSafeDefinition(
-                           "CMAKE_MESSAGE_INDENT")),
-                         "");
-    // Make every line of the `message` indented
-    // NOTE Can't reuse `cmDocumentationFormatter::PrintPreformatted`
-    // here cuz it appends `\n` to the EOM ;-(
-    cmSystemTools::ReplaceString(message, "\n", "\n" + indent);
-    message = indent + message;
-  }
-
   switch (level) {
     case cmake::LogLevel::LOG_ERROR:
     case cmake::LogLevel::LOG_WARNING:
       // we've overridden the message type, above, so display it directly
-      status.GetMakefile().GetMessenger()->DisplayMessage(
-        type, message, status.GetMakefile().GetBacktrace());
+      mf.GetMessenger()->DisplayMessage(type, message, mf.GetBacktrace());
       break;
 
     case cmake::LogLevel::LOG_NOTICE:
-      cmSystemTools::Message(message);
+      cmSystemTools::Message(IndentText(message, mf));
       break;
 
     case cmake::LogLevel::LOG_STATUS:
+      switch (checkingType) {
+        case CheckingType::CHECK_START:
+          mf.DisplayStatus(IndentText(message, mf), -1);
+          mf.GetCMakeInstance()->PushCheckInProgressMessage(message);
+          break;
+
+        case CheckingType::CHECK_PASS:
+          ReportCheckResult("CHECK_PASS"_s, message, mf);
+          break;
+
+        case CheckingType::CHECK_FAIL:
+          ReportCheckResult("CHECK_FAIL"_s, message, mf);
+          break;
+
+        default:
+          mf.DisplayStatus(IndentText(message, mf), -1);
+          break;
+      }
+      break;
+
     case cmake::LogLevel::LOG_VERBOSE:
     case cmake::LogLevel::LOG_DEBUG:
     case cmake::LogLevel::LOG_TRACE:
-      status.GetMakefile().DisplayStatus(message, -1);
+      mf.DisplayStatus(IndentText(message, mf), -1);
       break;
 
     default:
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index beedef4..72bef21 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -486,7 +486,7 @@
         std::string cmakeCommand =
           this->GetLocalGenerator()->ConvertToOutputFormat(
             cmSystemTools::GetCMakeCommand(), cmOutputConverter::SHELL);
-        linkCmds.push_back(cmakeCommand + " -E remove $TARGET_FILE");
+        linkCmds.push_back(cmakeCommand + " -E rm -f $TARGET_FILE");
       }
       // TODO: Use ARCHIVE_APPEND for archives over a certain size.
       {
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index e093be0..147f97f 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -7,10 +7,11 @@
 #include <set>
 #include <utility>
 
+#include <cm/memory>
+
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 
-#include "cmAlgorithms.h"
 #include "cmExecutionStatus.h"
 #include "cmGeneratorExpression.h"
 #include "cmMakefile.h"
@@ -94,7 +95,7 @@
   /**
    * Destructor.
    */
-  ~cmLBDepend() { cmDeleteAll(this->DependInformationMap); }
+  ~cmLBDepend() = default;
 
   cmLBDepend(const cmLBDepend&) = delete;
   cmLBDepend& operator=(const cmLBDepend&) = delete;
@@ -152,9 +153,9 @@
    * Generate dependencies for the file given.  Returns a pointer to
    * the cmDependInformation object for the file.
    */
-  const cmDependInformation* FindDependencies(const char* file)
+  const cmDependInformation* FindDependencies(const std::string& file)
   {
-    cmDependInformation* info = this->GetDependInformation(file, nullptr);
+    cmDependInformation* info = this->GetDependInformation(file, "");
     this->GenerateDependInformation(info);
     return info;
   }
@@ -203,7 +204,7 @@
         }
 
         // Add this file and all its dependencies.
-        this->AddDependency(info, includeFile.c_str());
+        this->AddDependency(info, includeFile);
         /// add the cxx file if it exists
         std::string cxxFile = includeFile;
         std::string::size_type pos = cxxFile.rfind('.');
@@ -254,7 +255,7 @@
             }
           }
           if (found) {
-            this->AddDependency(info, cxxFile.c_str());
+            this->AddDependency(info, cxxFile);
           }
         }
       }
@@ -264,10 +265,10 @@
   /**
    * Add a dependency.  Possibly walk it for more dependencies.
    */
-  void AddDependency(cmDependInformation* info, const char* file)
+  void AddDependency(cmDependInformation* info, const std::string& file)
   {
     cmDependInformation* dependInfo =
-      this->GetDependInformation(file, info->PathOnly.c_str());
+      this->GetDependInformation(file, info->PathOnly);
     this->GenerateDependInformation(dependInfo);
     info->AddDependencies(dependInfo);
   }
@@ -313,7 +314,7 @@
         // Dependency hints have been given.  Use them to begin the
         // recursion.
         for (std::string const& file : cFile.GetDepends()) {
-          this->AddDependency(info, file.c_str());
+          this->AddDependency(info, file);
         }
 
         // Found dependency information.  We are done.
@@ -361,8 +362,8 @@
    * Get an instance of cmDependInformation corresponding to the given file
    * name.
    */
-  cmDependInformation* GetDependInformation(const char* file,
-                                            const char* extraPath)
+  cmDependInformation* GetDependInformation(const std::string& file,
+                                            const std::string& extraPath)
   {
     // Get the full path for the file so that lookup is unambiguous.
     std::string fullPath = this->FullPath(file, extraPath);
@@ -371,15 +372,16 @@
     auto result = this->DependInformationMap.find(fullPath);
     if (result != this->DependInformationMap.end()) {
       // Found an instance, return it.
-      return result->second;
+      return result->second.get();
     }
     // Didn't find an instance.  Create a new one and save it.
-    cmDependInformation* info = new cmDependInformation;
+    auto info = cm::make_unique<cmDependInformation>();
+    auto ptr = info.get();
     info->FullPath = fullPath;
     info->PathOnly = cmSystemTools::GetFilenamePath(fullPath);
     info->IncludeName = file;
-    this->DependInformationMap[fullPath] = info;
-    return info;
+    this->DependInformationMap[fullPath] = std::move(info);
+    return ptr;
   }
 
   /**
@@ -387,14 +389,9 @@
    * This uses the include directories.
    * TODO: Cache path conversions to reduce FileExists calls.
    */
-  std::string FullPath(const char* fname, const char* extraPath)
+  std::string FullPath(const std::string& fname, const std::string& extraPath)
   {
-    DirectoryToFileToPathMapType::iterator m;
-    if (extraPath) {
-      m = this->DirectoryToFileToPathMap.find(extraPath);
-    } else {
-      m = this->DirectoryToFileToPathMap.find("");
-    }
+    auto m = this->DirectoryToFileToPathMap.find(extraPath);
 
     if (m != this->DirectoryToFileToPathMap.end()) {
       FileToPathMapType& map = m->second;
@@ -406,7 +403,7 @@
 
     if (cmSystemTools::FileExists(fname, true)) {
       std::string fp = cmSystemTools::CollapseFullPath(fname);
-      this->DirectoryToFileToPathMap[extraPath ? extraPath : ""][fname] = fp;
+      this->DirectoryToFileToPathMap[extraPath][fname] = fp;
       return fp;
     }
 
@@ -418,12 +415,12 @@
       if (cmSystemTools::FileExists(path, true) &&
           !cmSystemTools::FileIsDirectory(path)) {
         std::string fp = cmSystemTools::CollapseFullPath(path);
-        this->DirectoryToFileToPathMap[extraPath ? extraPath : ""][fname] = fp;
+        this->DirectoryToFileToPathMap[extraPath][fname] = fp;
         return fp;
       }
     }
 
-    if (extraPath) {
+    if (!extraPath.empty()) {
       std::string path = extraPath;
       if (!path.empty() && path.back() != '/') {
         path = path + "/";
@@ -438,7 +435,7 @@
     }
 
     // Couldn't find the file.
-    return std::string(fname);
+    return fname;
   }
 
   cmMakefile* Makefile;
@@ -449,7 +446,8 @@
   using FileToPathMapType = std::map<std::string, std::string>;
   using DirectoryToFileToPathMapType =
     std::map<std::string, FileToPathMapType>;
-  using DependInformationMapType = std::map<std::string, cmDependInformation*>;
+  using DependInformationMapType =
+    std::map<std::string, std::unique_ptr<cmDependInformation>>;
   DependInformationMapType DependInformationMap;
   DirectoryToFileToPathMapType DirectoryToFileToPathMap;
 };
@@ -476,7 +474,7 @@
   md.SetMakefile(&status.GetMakefile());
   md.AddSearchPath(status.GetMakefile().GetCurrentSourceDirectory());
   // find the depends for a file
-  const cmDependInformation* info = md.FindDependencies(file.c_str());
+  const cmDependInformation* info = md.FindDependencies(file);
   if (info) {
     // write them out
     FILE* fout = cmsys::SystemTools::Fopen(outputFile, "w");
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 92c80bb..ecf892b 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -290,7 +290,14 @@
   SELECT(POLICY, CMP0097,                                                     \
          "ExternalProject_Add with GIT_SUBMODULES \"\" initializes no "       \
          "submodules.",                                                       \
-         3, 16, 0, cmPolicies::WARN)
+         3, 16, 0, cmPolicies::WARN)                                          \
+  SELECT(POLICY, CMP0098,                                                     \
+         "FindFLEX runs flex in CMAKE_CURRENT_BINARY_DIR when executing.", 3, \
+         17, 0, cmPolicies::WARN)                                             \
+  SELECT(POLICY, CMP0099,                                                     \
+         "Link properties are transitive over private dependency on static "  \
+         "libraries.",                                                        \
+         3, 17, 0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY)                                         \
@@ -319,7 +326,8 @@
   F(CMP0076)                                                                  \
   F(CMP0081)                                                                  \
   F(CMP0083)                                                                  \
-  F(CMP0095)
+  F(CMP0095)                                                                  \
+  F(CMP0099)
 
 /** \class cmPolicies
  * \brief Handles changes in CMake behavior and policies
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 7bb5209..a25fd42 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -39,6 +39,11 @@
 
   std::string const& projectName = args[0];
 
+  if (!IncludeByVariable(status,
+                         "CMAKE_PROJECT_" + projectName + "_INCLUDE_BEFORE")) {
+    return false;
+  }
+
   mf.SetProjectName(projectName);
 
   mf.AddCacheDefinition(projectName + "_BINARY_DIR",
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index ef6b886..ef70fce 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -7,7 +7,6 @@
 #include <cm/memory>
 
 #include "cmCustomCommandLines.h"
-#include "cmCustomCommandTypes.h"
 #include "cmDuration.h"
 #include "cmGeneratorTarget.h"
 #include "cmLocalGenerator.h"
@@ -73,7 +72,7 @@
     }
 
     // Find targets that require AUTOMOC/UIC/RCC processing
-    for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) {
+    for (const auto& target : localGen->GetGeneratorTargets()) {
       // Process only certain target types
       switch (target->GetType()) {
         case cmStateEnums::EXECUTABLE:
@@ -104,7 +103,7 @@
           target->GetSafeProperty(kw().AUTORCC_EXECUTABLE);
 
         // We support Qt4, Qt5 and Qt6
-        auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
+        auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target.get());
         bool const validQt = (qtVersion.first.Major == 4) ||
           (qtVersion.first.Major == 5) || (qtVersion.first.Major == 6);
 
@@ -135,8 +134,8 @@
         if (mocIsValid || uicIsValid || rccIsValid) {
           // Create autogen target initializer
           Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
-            this, target, qtVersion.first, mocIsValid, uicIsValid, rccIsValid,
-            globalAutoGenTarget, globalAutoRccTarget));
+            this, target.get(), qtVersion.first, mocIsValid, uicIsValid,
+            rccIsValid, globalAutoGenTarget, globalAutoRccTarget));
         }
       }
     }
@@ -154,13 +153,14 @@
     cmMakefile* makefile = localGen->GetMakefile();
 
     // Create utility target
-    cmTarget* target = makefile->AddUtilityCommand(
-      name, cmCommandOrigin::Generator, true,
-      makefile->GetHomeOutputDirectory().c_str() /*work dir*/,
-      std::vector<std::string>() /*output*/,
-      std::vector<std::string>() /*depends*/, cmCustomCommandLines(), false,
-      comment.c_str());
-    localGen->AddGeneratorTarget(new cmGeneratorTarget(target, localGen));
+    std::vector<std::string> no_byproducts;
+    std::vector<std::string> no_depends;
+    cmCustomCommandLines no_commands;
+    cmTarget* target = localGen->AddUtilityCommand(
+      name, true, makefile->GetHomeOutputDirectory().c_str(), no_byproducts,
+      no_depends, no_commands, false, comment.c_str());
+    localGen->AddGeneratorTarget(
+      cm::make_unique<cmGeneratorTarget>(target, localGen));
 
     // Set FOLDER property in the target
     {
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index a20f106..42979af 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -25,7 +25,6 @@
 #include "cmAlgorithms.h"
 #include "cmCustomCommand.h"
 #include "cmCustomCommandLines.h"
-#include "cmCustomCommandTypes.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorTarget.h"
@@ -1082,8 +1081,8 @@
     // PRE_BUILD does not support file dependencies!
     const std::vector<std::string> no_output;
     const std::vector<std::string> no_deps;
-    cmCustomCommand cc(this->Makefile, no_output, autogenProvides, no_deps,
-                       commandLines, autogenComment.c_str(),
+    cmCustomCommand cc(no_output, autogenProvides, no_deps, commandLines,
+                       this->Makefile->GetBacktrace(), autogenComment.c_str(),
                        this->Dir.Work.c_str());
     cc.SetEscapeOldStyle(false);
     cc.SetEscapeAllowMakeVars(true);
@@ -1118,15 +1117,15 @@
     }
 
     // Create autogen target
-    cmTarget* autogenTarget = this->Makefile->AddUtilityCommand(
-      this->AutogenTarget.Name, cmCommandOrigin::Generator, true,
-      this->Dir.Work.c_str(), /*byproducts=*/autogenProvides,
+    cmTarget* autogenTarget = this->LocalGen->AddUtilityCommand(
+      this->AutogenTarget.Name, true, this->Dir.Work.c_str(),
+      /*byproducts=*/autogenProvides,
       std::vector<std::string>(this->AutogenTarget.DependFiles.begin(),
                                this->AutogenTarget.DependFiles.end()),
       commandLines, false, autogenComment.c_str());
     // Create autogen generator target
     this->LocalGen->AddGeneratorTarget(
-      new cmGeneratorTarget(autogenTarget, this->LocalGen));
+      cm::make_unique<cmGeneratorTarget>(autogenTarget, this->LocalGen));
 
     // Forward origin utilities to autogen target
     if (this->AutogenTarget.DependOrigin) {
@@ -1200,13 +1199,13 @@
           ccName += cmStrCat('_', qrc.QrcPathChecksum);
         }
 
-        cmTarget* autoRccTarget = this->Makefile->AddUtilityCommand(
-          ccName, cmCommandOrigin::Generator, true, this->Dir.Work.c_str(),
-          ccOutput, ccDepends, commandLines, false, ccComment.c_str());
+        cmTarget* autoRccTarget = this->LocalGen->AddUtilityCommand(
+          ccName, true, this->Dir.Work.c_str(), ccOutput, ccDepends,
+          commandLines, false, ccComment.c_str());
 
         // Create autogen generator target
         this->LocalGen->AddGeneratorTarget(
-          new cmGeneratorTarget(autoRccTarget, this->LocalGen));
+          cm::make_unique<cmGeneratorTarget>(autoRccTarget, this->LocalGen));
 
         // Set FOLDER property in autogen target
         if (!this->TargetsFolder.empty()) {
@@ -1239,7 +1238,7 @@
         }
         std::string no_main_dependency;
         cmImplicitDependsList no_implicit_depends;
-        this->Makefile->AddCustomCommandToOutput(
+        this->LocalGen->AddCustomCommandToOutput(
           ccOutput, ccByproducts, ccDepends, no_main_dependency,
           no_implicit_depends, commandLines, ccComment.c_str(),
           this->Dir.Work.c_str());
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 82a3625..19a0d29 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -154,9 +154,8 @@
 #define CM_HEADER_REGEX "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"
 
 #define CM_SOURCE_REGEX                                                       \
-  "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|cu|f|f90|for|fpp|ftn|m|mm|rc|def|r|odl|idl|"  \
-  "hpj"                                                                       \
-  "|bat)$"
+  "\\.(C|F|M|c|c\\+\\+|cc|cpp|cxx|cu|f|f90|for|fpp|ftn|m|mm|"                 \
+  "rc|def|r|odl|idl|hpj|bat)$"
 
 #define CM_PCH_REGEX "cmake_pch\\.(h|hxx)$"
 
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 645907c..832e74e 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -315,10 +315,14 @@
   this->SetDefinition("UNIX", "1");
   this->SetDefinition("CMAKE_HOST_UNIX", "1");
 
+#  if defined(__ANDROID__)
+  this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", "Android");
+#  else
   struct utsname uts_name;
   if (uname(&uts_name) >= 0) {
     this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", uts_name.sysname);
   }
+#  endif
 #endif
 #if defined(__CYGWIN__)
   std::string legacy;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c4a4220..17d32c6 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -814,6 +814,8 @@
 #  else
   _fmode = _O_TEXT;
 #  endif
+  // Replace libuv's report handler with our own to suppress popups.
+  cmSystemTools::EnableMSVCDebugHook();
 #endif
 }
 
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2db89de..b9bf7a5 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -371,6 +371,7 @@
       initProp("XCODE_SCHEME_THREAD_SANITIZER_STOP");
       initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER");
       initProp("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP");
+      initProp("XCODE_SCHEME_WORKING_DIRECTORY");
       initProp("XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER");
       initProp("XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP");
       initProp("XCODE_SCHEME_MALLOC_SCRIBBLE");
@@ -380,6 +381,7 @@
       initProp("XCODE_SCHEME_MALLOC_STACK");
       initProp("XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE");
       initProp("XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS");
+      initProp("XCODE_SCHEME_ENVIRONMENT");
     }
 #endif
   }
@@ -511,8 +513,7 @@
     initProp("DOTNET_TARGET_FRAMEWORK_VERSION");
   }
 
-  if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
-      this->GetType() != cmStateEnums::UTILITY) {
+  if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
 
     // check for "CMAKE_VS_GLOBALS" variable and set up target properties
     // if any
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index 4995da9..35e1c8c 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -2,19 +2,19 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmVariableWatch.h"
 
+#include <array>
 #include <memory>
 #include <utility>
 #include <vector>
 
-static const char* const cmVariableWatchAccessStrings[] = {
-  "READ_ACCESS",     "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS",
-  "MODIFIED_ACCESS", "REMOVED_ACCESS",      "NO_ACCESS"
-};
-
-const char* cmVariableWatch::GetAccessAsString(int access_type)
+const std::string& cmVariableWatch::GetAccessAsString(int access_type)
 {
+  static const std::array<std::string, 6> cmVariableWatchAccessStrings = {
+    { "READ_ACCESS", "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS",
+      "MODIFIED_ACCESS", "REMOVED_ACCESS", "NO_ACCESS" }
+  };
   if (access_type < 0 || access_type >= cmVariableWatch::NO_ACCESS) {
-    return "NO_ACCESS";
+    access_type = cmVariableWatch::NO_ACCESS;
   }
   return cmVariableWatchAccessStrings[access_type];
 }
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index e4b3b7c..6c418ed 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -46,7 +46,7 @@
    */
   enum
   {
-    VARIABLE_READ_ACCESS = 0,
+    VARIABLE_READ_ACCESS,
     UNKNOWN_VARIABLE_READ_ACCESS,
     UNKNOWN_VARIABLE_DEFINED_ACCESS,
     VARIABLE_MODIFIED_ACCESS,
@@ -57,7 +57,7 @@
   /**
    * Return the access as string
    */
-  static const char* GetAccessAsString(int access_type);
+  static const std::string& GetAccessAsString(int access_type);
 
 protected:
   struct Pair
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index f2c8f3c..35b9a1d 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -2,6 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmVariableWatchCommand.h"
 
+#include <limits>
 #include <memory>
 #include <utility>
 
@@ -14,17 +15,19 @@
 #include "cmVariableWatch.h"
 #include "cmake.h"
 
+class cmLocalGenerator;
+
+namespace {
 struct cmVariableWatchCallbackData
 {
   bool InCallback;
   std::string Command;
 };
 
-static void cmVariableWatchCommandVariableAccessed(const std::string& variable,
-                                                   int access_type,
-                                                   void* client_data,
-                                                   const char* newValue,
-                                                   const cmMakefile* mf)
+void cmVariableWatchCommandVariableAccessed(const std::string& variable,
+                                            int access_type, void* client_data,
+                                            const char* newValue,
+                                            const cmMakefile* mf)
 {
   cmVariableWatchCallbackData* data =
     static_cast<cmVariableWatchCallbackData*>(client_data);
@@ -34,40 +37,35 @@
   }
   data->InCallback = true;
 
-  cmListFileFunction newLFF;
-  cmListFileArgument arg;
-  bool processed = false;
-  const char* accessString = cmVariableWatch::GetAccessAsString(access_type);
-  const char* currentListFile = mf->GetDefinition("CMAKE_CURRENT_LIST_FILE");
+  auto accessString = cmVariableWatch::GetAccessAsString(access_type);
 
   /// Ultra bad!!
   cmMakefile* makefile = const_cast<cmMakefile*>(mf);
 
   std::string stack = makefile->GetProperty("LISTFILE_STACK");
   if (!data->Command.empty()) {
-    newLFF.Arguments.clear();
-    newLFF.Arguments.emplace_back(variable, cmListFileArgument::Quoted, 9999);
-    newLFF.Arguments.emplace_back(accessString, cmListFileArgument::Quoted,
-                                  9999);
-    newLFF.Arguments.emplace_back(newValue ? newValue : "",
-                                  cmListFileArgument::Quoted, 9999);
-    newLFF.Arguments.emplace_back(currentListFile, cmListFileArgument::Quoted,
-                                  9999);
-    newLFF.Arguments.emplace_back(stack, cmListFileArgument::Quoted, 9999);
+    cmListFileFunction newLFF;
+    const char* const currentListFile =
+      mf->GetDefinition("CMAKE_CURRENT_LIST_FILE");
+    const auto fakeLineNo =
+      std::numeric_limits<decltype(cmListFileArgument::Line)>::max();
+    newLFF.Arguments = {
+      { variable, cmListFileArgument::Quoted, fakeLineNo },
+      { accessString, cmListFileArgument::Quoted, fakeLineNo },
+      { newValue ? newValue : "", cmListFileArgument::Quoted, fakeLineNo },
+      { currentListFile, cmListFileArgument::Quoted, fakeLineNo },
+      { stack, cmListFileArgument::Quoted, fakeLineNo }
+    };
     newLFF.Name = data->Command;
-    newLFF.Line = 9999;
+    newLFF.Line = fakeLineNo;
     cmExecutionStatus status(*makefile);
     if (!makefile->ExecuteCommand(newLFF, status)) {
       cmSystemTools::Error(
         cmStrCat("Error in cmake code at\nUnknown:0:\nA command failed "
                  "during the invocation of callback \"",
                  data->Command, "\"."));
-      data->InCallback = false;
-      return;
     }
-    processed = true;
-  }
-  if (!processed) {
+  } else {
     makefile->IssueMessage(
       MessageType::LOG,
       cmStrCat("Variable \"", variable, "\" was accessed using ", accessString,
@@ -77,7 +75,7 @@
   data->InCallback = false;
 }
 
-static void deleteVariableWatchCallbackData(void* client_data)
+void deleteVariableWatchCallbackData(void* client_data)
 {
   cmVariableWatchCallbackData* data =
     static_cast<cmVariableWatchCallbackData*>(client_data);
@@ -91,18 +89,18 @@
 public:
   /* NOLINTNEXTLINE(performance-unnecessary-value-param) */
   FinalAction(cmMakefile* makefile, std::string variable)
-    : Action(std::make_shared<Impl>(makefile, std::move(variable)))
+    : Action{ std::make_shared<Impl>(makefile, std::move(variable)) }
   {
   }
 
-  void operator()(cmMakefile&) const {}
+  void operator()(cmLocalGenerator&, const cmListFileBacktrace&) const {}
 
 private:
   struct Impl
   {
     Impl(cmMakefile* makefile, std::string variable)
-      : Makefile(makefile)
-      , Variable(std::move(variable))
+      : Makefile{ makefile }
+      , Variable{ std::move(variable) }
     {
     }
 
@@ -112,12 +110,13 @@
         this->Variable, cmVariableWatchCommandVariableAccessed);
     }
 
-    cmMakefile* Makefile;
-    std::string Variable;
+    cmMakefile* const Makefile;
+    std::string const Variable;
   };
 
   std::shared_ptr<Impl const> Action;
 };
+} // anonymous namespace
 
 bool cmVariableWatchCommand(std::vector<std::string> const& args,
                             cmExecutionStatus& status)
@@ -136,10 +135,10 @@
     return false;
   }
 
-  cmVariableWatchCallbackData* data = new cmVariableWatchCallbackData;
+  auto* const data = new cmVariableWatchCallbackData;
 
   data->InCallback = false;
-  data->Command = command;
+  data->Command = std::move(command);
 
   if (!status.GetMakefile().GetCMakeInstance()->GetVariableWatch()->AddWatch(
         variable, cmVariableWatchCommandVariableAccessed, data,
@@ -148,7 +147,7 @@
     return false;
   }
 
-  status.GetMakefile().AddFinalAction(
-    FinalAction(&status.GetMakefile(), variable));
+  status.GetMakefile().AddGeneratorAction(
+    FinalAction{ &status.GetMakefile(), variable });
   return true;
 }
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 5c0b881..8fc40a79 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -52,7 +52,7 @@
   bool HasContent = false;
   std::string Tag;
 
-  Elem(std::ostream& s, const char* tag)
+  Elem(std::ostream& s, const std::string& tag)
     : S(s)
     , Indent(0)
     , Tag(tag)
@@ -60,7 +60,7 @@
     this->StartElement();
   }
   Elem(const Elem&) = delete;
-  Elem(Elem& par, const char* tag)
+  Elem(Elem& par, const std::string& tag)
     : S(par.S)
     , Indent(par.Indent + 1)
     , Tag(tag)
@@ -77,7 +77,7 @@
   }
   std::ostream& WriteString(const char* line);
   void StartElement() { this->WriteString("<") << this->Tag; }
-  void Element(const char* tag, const std::string& val)
+  void Element(const std::string& tag, const std::string& val)
   {
     Elem(*this, tag).Content(val);
   }
@@ -115,7 +115,7 @@
     }
   }
 
-  void WritePlatformConfigTag(const char* tag, const std::string& cond,
+  void WritePlatformConfigTag(const std::string& tag, const std::string& cond,
                               const std::string& content);
 };
 
@@ -131,8 +131,8 @@
   {
   }
 
-  void OutputFlag(std::ostream& /*fout*/, int /*indent*/, const char* tag,
-                  const std::string& content) override
+  void OutputFlag(std::ostream& /*fout*/, int /*indent*/,
+                  const std::string& tag, const std::string& content) override
   {
     if (!this->GetConfiguration().empty()) {
       // if there are configuration specific flags, then
@@ -274,7 +274,7 @@
 }
 
 void cmVisualStudio10TargetGenerator::Elem::WritePlatformConfigTag(
-  const char* tag, const std::string& cond, const std::string& content)
+  const std::string& tag, const std::string& cond, const std::string& content)
 {
   Elem(*this, tag).Attribute("Condition", cond).Content(content);
 }
@@ -543,6 +543,11 @@
         e1.Element("VCProjectUpgraderObjectName", "NoUpgrade");
       }
 
+      if (const char* vcTargetsPath =
+            this->GlobalGenerator->GetCustomVCTargetsPath()) {
+        e1.Element("VCTargetsPath", vcTargetsPath);
+      }
+
       std::vector<std::string> keys = this->GeneratorTarget->GetPropertyKeys();
       for (std::string const& keyIt : keys) {
         static const char* prefix = "VS_GLOBAL_";
@@ -557,7 +562,7 @@
         const char* value = this->GeneratorTarget->GetProperty(keyIt);
         if (!value)
           continue;
-        e1.Element(globalKey.c_str(), value);
+        e1.Element(globalKey, value);
       }
 
       if (this->Managed) {
@@ -676,6 +681,8 @@
 
       this->WritePlatformExtensions(e1);
     }
+
+    this->WriteDotNetDocumentationFile(e0);
     Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
     this->WriteWinRTPackageCertificateKeyFile(e0);
     this->WritePathAndIncrementalLinkOptions(e0);
@@ -906,7 +913,19 @@
     }
   }
   for (auto const& tag : tags) {
-    e2.Element(tag.first.c_str(), tag.second);
+    e2.Element(tag.first, tag.second);
+  }
+}
+
+void cmVisualStudio10TargetGenerator::WriteDotNetDocumentationFile(Elem& e0)
+{
+  std::string const documentationFile =
+    this->GeneratorTarget->GetSafeProperty("VS_DOTNET_DOCUMENTATION_FILE");
+
+  if (this->ProjectType == csproj && !documentationFile.empty()) {
+    Elem e1(e0, "PropertyGroup");
+    Elem e2(e1, "DocumentationFile");
+    e2.Content(documentationFile);
   }
 }
 
@@ -1000,7 +1019,7 @@
             if (!tagName.empty()) {
               std::string value = props.GetPropertyValue(p);
               if (!value.empty()) {
-                e2.Element(tagName.c_str(), value);
+                e2.Element(tagName, value);
               }
             }
           }
@@ -1732,7 +1751,7 @@
     std::string const& filter = sourceGroup->GetFullName();
     std::string path = this->ConvertPath(source, s.RelativePath);
     ConvertToWindowsSlash(path);
-    Elem e2(e1, name.c_str());
+    Elem e2(e1, name);
     e2.Attribute("Include", path);
     if (!filter.empty()) {
       e2.Element("Filter", filter);
@@ -2619,9 +2638,9 @@
 
   // Some link options belong here.  Use them now and remove them so that
   // WriteLinkOptions does not use them.
-  const char* flags[] = { "LinkDelaySign", "LinkKeyFile", 0 };
-  for (const char** f = flags; *f; ++f) {
-    const char* flag = *f;
+  static const std::vector<std::string> flags{ "LinkDelaySign",
+                                               "LinkKeyFile" };
+  for (const std::string& flag : flags) {
     if (const char* value = linkOptions.GetFlag(flag)) {
       e1.WritePlatformConfigTag(flag, cond, value);
       linkOptions.RemoveFlag(flag);
@@ -4022,8 +4041,8 @@
 }
 
 void cmVisualStudio10TargetGenerator::WriteEvent(
-  Elem& e1, const char* name, std::vector<cmCustomCommand> const& commands,
-  std::string const& configName)
+  Elem& e1, const std::string& name,
+  std::vector<cmCustomCommand> const& commands, std::string const& configName)
 {
   if (commands.empty()) {
     return;
@@ -4842,7 +4861,7 @@
   Elem& e2, const std::map<std::string, std::string>& tags)
 {
   for (const auto& i : tags) {
-    e2.Element(i.first.c_str(), i.second);
+    e2.Element(i.first, i.second);
   }
 }
 
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index a18a33d..30027c9 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -79,6 +79,7 @@
   void WriteDotNetReference(Elem& e1, std::string const& ref,
                             std::string const& hint,
                             std::string const& config);
+  void WriteDotNetDocumentationFile(Elem& e0);
   void WriteImports(Elem& e0);
   void WriteDotNetReferenceCustomTags(Elem& e2, std::string const& ref);
   void WriteEmbeddedResourceGroup(Elem& e0);
@@ -164,7 +165,7 @@
   void WriteLibOptions(Elem& e1, std::string const& config);
   void WriteManifestOptions(Elem& e1, std::string const& config);
   void WriteEvents(Elem& e1, std::string const& configName);
-  void WriteEvent(Elem& e1, const char* name,
+  void WriteEvent(Elem& e1, std::string const& name,
                   std::vector<cmCustomCommand> const& commands,
                   std::string const& configName);
   void WriteGroupSources(Elem& e0, std::string const& name,
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 1139aa9..18c19b7 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -431,7 +431,7 @@
   if (this->Defines.empty()) {
     return;
   }
-  const char* tag = "PreprocessorDefinitions";
+  std::string tag = "PreprocessorDefinitions";
   if (lang == "CUDA") {
     tag = "Defines";
   }
@@ -473,7 +473,7 @@
     return;
   }
 
-  const char* tag = "AdditionalIncludeDirectories";
+  std::string tag = "AdditionalIncludeDirectories";
   if (lang == "CUDA") {
     tag = "Include";
   } else if (lang == "ASM_MASM" || lang == "ASM_NASM") {
@@ -528,6 +528,6 @@
       sep = ";";
     }
 
-    this->OutputFlag(fout, indent, m.first.c_str(), oss.str());
+    this->OutputFlag(fout, indent, m.first, oss.str());
   }
 }
diff --git a/Source/cmVisualStudioGeneratorOptions.h b/Source/cmVisualStudioGeneratorOptions.h
index 560593e..d8dcfe2 100644
--- a/Source/cmVisualStudioGeneratorOptions.h
+++ b/Source/cmVisualStudioGeneratorOptions.h
@@ -86,7 +86,8 @@
   const std::string& GetConfiguration() const;
 
 protected:
-  virtual void OutputFlag(std::ostream& fout, int indent, const char* tag,
+  virtual void OutputFlag(std::ostream& fout, int indent,
+                          const std::string& tag,
                           const std::string& content) = 0;
 
 private:
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index afc95f5..b34c2f6 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -8,13 +8,16 @@
 #include <utility>
 
 #include "cmGeneratedFileStream.h"
+#include "cmGeneratorExpression.h"
 #include "cmGeneratorTarget.h"
 #include "cmXMLSafe.h"
 
-cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests,
+cmXCodeScheme::cmXCodeScheme(cmLocalGenerator* lg, cmXCodeObject* xcObj,
+                             TestObjects tests,
                              const std::vector<std::string>& configList,
                              unsigned int xcVersion)
-  : Target(xcObj)
+  : LocalGenerator(lg)
+  , Target(xcObj)
   , Tests(std::move(tests))
   , TargetName(xcObj->GetTarget()->GetName())
   , ConfigList(configList)
@@ -135,7 +138,8 @@
   xout.Attribute("selectedLauncherIdentifier",
                  "Xcode.DebuggerFoundation.Launcher.LLDB");
   xout.Attribute("launchStyle", "0");
-  xout.Attribute("useCustomWorkingDirectory", "NO");
+  WriteCustomWorkingDirectory(xout, configuration);
+
   xout.Attribute("ignoresPersistentStateOnLaunch", "NO");
   WriteLaunchActionBooleanAttribute(xout, "debugDocumentVersioning",
                                     "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING",
@@ -355,7 +359,7 @@
   xout.Attribute("buildConfiguration", configuration);
   xout.Attribute("shouldUseLaunchSchemeArgsEnv", "YES");
   xout.Attribute("savedToolIdentifier", "");
-  xout.Attribute("useCustomWorkingDirectory", "NO");
+  WriteCustomWorkingDirectory(xout, configuration);
   WriteLaunchActionBooleanAttribute(xout, "debugDocumentVersioning",
                                     "XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING",
                                     true);
@@ -395,6 +399,22 @@
   xout.EndElement();
 }
 
+void cmXCodeScheme::WriteCustomWorkingDirectory(
+  cmXMLWriter& xout, const std::string& configuration)
+{
+  std::string propertyValue = this->Target->GetTarget()->GetSafeProperty(
+    "XCODE_SCHEME_WORKING_DIRECTORY");
+  if (propertyValue.empty()) {
+    xout.Attribute("useCustomWorkingDirectory", "NO");
+  } else {
+    xout.Attribute("useCustomWorkingDirectory", "YES");
+
+    auto customWorkingDirectory = cmGeneratorExpression::Evaluate(
+      propertyValue, this->LocalGenerator, configuration);
+    xout.Attribute("customWorkingDirectory", customWorkingDirectory);
+  }
+}
+
 std::string cmXCodeScheme::WriteVersionString()
 {
   std::ostringstream v;
diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h
index dff5e35..da40856 100644
--- a/Source/cmXCodeScheme.h
+++ b/Source/cmXCodeScheme.h
@@ -20,7 +20,7 @@
 public:
   using TestObjects = std::vector<const cmXCodeObject*>;
 
-  cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests,
+  cmXCodeScheme(cmLocalGenerator* lg, cmXCodeObject* xcObj, TestObjects tests,
                 const std::vector<std::string>& configList,
                 unsigned int xcVersion);
 
@@ -28,6 +28,7 @@
                               const std::string& container);
 
 private:
+  cmLocalGenerator* const LocalGenerator;
   const cmXCodeObject* const Target;
   const TestObjects Tests;
   const std::string& TargetName;
@@ -63,6 +64,9 @@
   void WriteBuildableReference(cmXMLWriter& xout, const cmXCodeObject* xcObj,
                                const std::string& container);
 
+  void WriteCustomWorkingDirectory(cmXMLWriter& xout,
+                                   const std::string& configuration);
+
   std::string WriteVersionString();
   std::string FindConfiguration(const std::string& name);
 
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index f63a264..b1c6e8f 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -330,9 +330,8 @@
           }
         }
       } else {
-        std::cerr << "Parse error in command line argument: " << arg << "\n"
-                  << "Should be: VAR:type=value\n";
-        cmSystemTools::Error("No cmake script provided.");
+        cmSystemTools::Error("Parse error in command line argument: " + arg +
+                             "\n" + "Should be: VAR:type=value\n");
         return false;
       }
     } else if (cmHasLiteralPrefix(arg, "-W")) {
@@ -422,7 +421,7 @@
           return false;
         }
       }
-      std::cout << "loading initial cache file " << path << "\n";
+      cmSystemTools::Stdout("loading initial cache file " + path + "\n");
       // Resolve script path specified on command line relative to $PWD.
       path = cmSystemTools::CollapseFullPath(path);
       this->ReadListFile(args, path);
@@ -735,6 +734,7 @@
         return;
       }
       this->SetLogLevel(logLevel);
+      this->LogLevelWasSetViaCLI = true;
     } else if (arg.find("--loglevel=", 0) == 0) {
       // This is supported for backward compatibility. This option only
       // appeared in the 3.15.x release series and was renamed to
@@ -746,6 +746,9 @@
         return;
       }
       this->SetLogLevel(logLevel);
+      this->LogLevelWasSetViaCLI = true;
+    } else if (arg == "--log-context") {
+      this->SetShowLogContext(true);
     } else if (arg.find("--trace-expand", 0) == 0) {
       std::cout << "Running with expanded trace output on.\n";
       this->SetTrace(true);
@@ -2287,7 +2290,7 @@
 void cmake::GenerateGraphViz(const std::string& fileName) const
 {
 #ifndef CMAKE_BOOTSTRAP
-  cmGraphVizWriter gvWriter(this->GetGlobalGenerator());
+  cmGraphVizWriter gvWriter(fileName, this->GetGlobalGenerator());
 
   std::string settingsFile =
     cmStrCat(this->GetHomeOutputDirectory(), "/CMakeGraphVizOptions.cmake");
@@ -2295,9 +2298,8 @@
     cmStrCat(this->GetHomeDirectory(), "/CMakeGraphVizOptions.cmake");
 
   gvWriter.ReadSettings(settingsFile, fallbackSettingsFile);
-  gvWriter.WritePerTargetFiles(fileName);
-  gvWriter.WriteTargetDependersFiles(fileName);
-  gvWriter.WriteGlobalFile(fileName);
+
+  gvWriter.Write();
 
 #endif
 }
@@ -2616,6 +2618,14 @@
       return 1;
     }
   }
+  const char* cachedGeneratorToolset =
+    this->State->GetCacheEntryValue("CMAKE_GENERATOR_TOOLSET");
+  if (cachedGeneratorToolset) {
+    cmMakefile mf(gen, this->GetCurrentSnapshot());
+    if (!gen->SetGeneratorToolset(cachedGeneratorToolset, true, &mf)) {
+      return 1;
+    }
+  }
   std::string output;
   std::string projName;
   const char* cachedProjectName =
diff --git a/Source/cmake.h b/Source/cmake.h
index 687c105..9e78436 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -5,12 +5,15 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
+#include <cstddef>
 #include <functional>
 #include <map>
 #include <memory>
 #include <set>
+#include <stack>
 #include <string>
 #include <unordered_set>
+#include <utility>
 #include <vector>
 
 #include "cmGeneratedFileStream.h"
@@ -380,15 +383,40 @@
    */
   cmFileTimeCache* GetFileTimeCache() { return this->FileTimeCache.get(); }
 
+  bool WasLogLevelSetViaCLI() const { return this->LogLevelWasSetViaCLI; }
+
   //! Get the selected log level for `message()` commands during the cmake run.
   LogLevel GetLogLevel() const { return this->MessageLogLevel; }
   void SetLogLevel(LogLevel level) { this->MessageLogLevel = level; }
   static LogLevel StringToLogLevel(const std::string& levelStr);
 
+  bool HasCheckInProgress() const
+  {
+    return !this->CheckInProgressMessages.empty();
+  }
+  std::size_t GetCheckInProgressSize() const
+  {
+    return this->CheckInProgressMessages.size();
+  }
+  std::string GetTopCheckInProgressMessage()
+  {
+    auto message = this->CheckInProgressMessages.top();
+    this->CheckInProgressMessages.pop();
+    return message;
+  }
+  void PushCheckInProgressMessage(std::string message)
+  {
+    this->CheckInProgressMessages.emplace(std::move(message));
+  }
+
   //! Do we want debug output during the cmake run.
   bool GetDebugOutput() { return this->DebugOutput; }
   void SetDebugOutputOn(bool b) { this->DebugOutput = b; }
 
+  //! Should `message` command display context.
+  bool GetShowLogContext() const { return this->LogContext; }
+  void SetShowLogContext(bool b) { this->LogContext = b; }
+
   //! Do we want trace output during the cmake run.
   bool GetTrace() { return this->Trace; }
   void SetTrace(bool b) { this->Trace = b; }
@@ -587,6 +615,10 @@
   std::vector<std::string> TraceOnlyThisSources;
 
   LogLevel MessageLogLevel = LogLevel::LOG_STATUS;
+  bool LogLevelWasSetViaCLI = false;
+  bool LogContext = false;
+
+  std::stack<std::string> CheckInProgressMessages;
 
   void UpdateConversionPathTable();
 
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 6d3e6ee..d817971 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -73,6 +73,7 @@
   { "--log-level=<ERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE>",
     "Set the verbosity of messages from CMake files. "
     "--loglevel is also accepted for backward compatibility reasons." },
+  { "--log-context", "Prepend log messages with context, if given" },
   { "--debug-trycompile",
     "Do not delete the try_compile build tree. Only "
     "useful on one try_compile at a time." },
@@ -682,7 +683,6 @@
   ac = args.argc();
   av = args.argv();
 
-  cmSystemTools::EnableMSVCDebugHook();
   cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(av[0]);
   if (ac > 1) {
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index d05e3c8..d6df49c 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -21,16 +21,15 @@
 
 #if !defined(CMAKE_BOOTSTRAP)
 #  include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback.
+#  include "cmFileTime.h"
 #  include "cmServer.h"
 #  include "cmServerConnection.h"
+
+#  include "bindexplib.h"
 #endif
 
 #if !defined(CMAKE_BOOTSTRAP) && defined(_WIN32)
 #  include "cmsys/ConsoleBuf.hxx"
-
-#  include "cmFileTime.h"
-
-#  include "bindexplib.h"
 #endif
 
 #if !defined(CMAKE_BOOTSTRAP) && defined(_WIN32) && !defined(__CYGWIN__)
@@ -107,10 +106,12 @@
     << "  sha384sum <file>...       - create SHA384 checksum of files\n"
     << "  sha512sum <file>...       - create SHA512 checksum of files\n"
     << "  remove [-f] <file>...     - remove the file(s), use -f to force "
-       "it\n"
-    << "  remove_directory <dir>... - remove directories and their contents\n"
+       "it (deprecated: use rm instead)\n"
+    << "  remove_directory <dir>... - remove directories and their contents (deprecated: use rm instead)\n"
     << "  rename oldname newname    - rename a file or directory "
        "(on one volume)\n"
+    << "  rm [-rRf] <file/dir>...    - remove files or directories, use -f to "
+       "force it, r or R to remove directories and their contents recursively\n"
     << "  server                    - start cmake in server mode\n"
     << "  sleep <number>...         - sleep for given number of seconds\n"
     << "  tar [cxt][vf][zjJ] file.tar [file/dir1 file/dir2 ...]\n"
@@ -172,6 +173,24 @@
   return true;
 }
 
+static bool cmRemoveDirectory(const std::string& dir, bool recursive = true)
+{
+  if (cmSystemTools::FileIsSymlink(dir)) {
+    if (!cmSystemTools::RemoveFile(dir)) {
+      std::cerr << "Error removing directory symlink \"" << dir << "\".\n";
+      return false;
+    }
+  } else if (!recursive) {
+    std::cerr << "Error removing directory \"" << dir
+              << "\" without recursive option.\n";
+    return false;
+  } else if (!cmSystemTools::RemoveADirectory(dir)) {
+    std::cerr << "Error removing directory \"" << dir << "\".\n";
+    return false;
+  }
+  return true;
+}
+
 static int HandleIWYU(const std::string& runCmd,
                       const std::string& /* sourceFile */,
                       const std::vector<std::string>& orig_cmd)
@@ -561,11 +580,11 @@
       return 0;
     }
 
-#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
-    else if (args[1] == "__create_def") {
+#if !defined(CMAKE_BOOTSTRAP)
+    if (args[1] == "__create_def") {
       if (args.size() < 4) {
         std::cerr << "__create_def Usage: -E __create_def outfile.def "
-                     "objlistfile [-nm=nm-path]\n";
+                     "objlistfile [--nm=nm-path]\n";
         return 1;
       }
       cmsys::ifstream fin(args[3].c_str(), std::ios::in | std::ios::binary);
@@ -592,7 +611,7 @@
           return 0;
         }
       }
-      FILE* fout = cmsys::SystemTools::Fopen(args[2].c_str(), "w+");
+      FILE* fout = cmsys::SystemTools::Fopen(args[2], "w+");
       if (!fout) {
         std::cerr << "could not open output .def file: " << args[2].c_str()
                   << "\n";
@@ -706,14 +725,7 @@
       bool return_value = false;
       for (auto const& arg : cmMakeRange(args).advance(2)) {
         if (cmSystemTools::FileIsDirectory(arg)) {
-          if (cmSystemTools::FileIsSymlink(arg)) {
-            if (!cmSystemTools::RemoveFile(arg)) {
-              std::cerr << "Error removing directory symlink \"" << arg
-                        << "\".\n";
-              return_value = true;
-            }
-          } else if (!cmSystemTools::RemoveADirectory(arg)) {
-            std::cerr << "Error removing directory \"" << arg << "\".\n";
+          if (!cmRemoveDirectory(arg)) {
             return_value = true;
           }
         }
@@ -739,6 +751,65 @@
       return 0;
     }
 
+    // Remove directories or files with rm
+    if (args[1] == "rm" && args.size() > 2) {
+      // If an error occurs, we want to continue removing the remaining
+      // files/directories.
+      int return_value = 0;
+      bool force = false;
+      bool recursive = false;
+      bool doing_options = true;
+      bool at_least_one_file = false;
+      for (auto const& arg : cmMakeRange(args).advance(2)) {
+        if (doing_options && cmHasLiteralPrefix(arg, "-")) {
+          if (arg == "--") {
+            doing_options = false;
+          }
+          if (arg.find('f') != std::string::npos) {
+            force = true;
+          }
+          if (arg.find_first_of("rR") != std::string::npos) {
+            recursive = true;
+          }
+          if (arg.find_first_not_of("-frR") != std::string::npos) {
+            cmSystemTools::Error("Unknown -E rm argument: " + arg);
+            return 1;
+          }
+        } else {
+          if (arg.empty()) {
+            continue;
+          }
+          at_least_one_file = true;
+          // Complain if the -f option was not given and
+          // either file does not exist or
+          // file could not be removed and still exists
+          bool file_exists_or_forced_remove = cmSystemTools::FileExists(arg) ||
+            cmSystemTools::FileIsSymlink(arg) || force;
+          if (cmSystemTools::FileIsDirectory(arg)) {
+            if (!cmRemoveDirectory(arg, recursive)) {
+              return_value = 1;
+            }
+          } else if ((!file_exists_or_forced_remove) ||
+                     (!cmSystemTools::RemoveFile(arg) &&
+                      cmSystemTools::FileExists(arg))) {
+            if (!file_exists_or_forced_remove) {
+              cmSystemTools::Error(
+                "File to remove does not exist and force is not set: " + arg);
+            } else {
+              cmSystemTools::Error("File can't be removed and still exist: " +
+                                   arg);
+            }
+            return_value = 1;
+          }
+        }
+      }
+      if (!at_least_one_file) {
+        cmSystemTools::Error("Missing file/directory to remove");
+        return 1;
+      }
+      return return_value;
+    }
+
     // Touch file
     if (args[1] == "touch" && args.size() > 2) {
       for (auto const& arg : cmMakeRange(args).advance(2)) {
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 0d65902..9b45bb0 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -98,9 +98,12 @@
     "Run a specific number of tests by number." },
   { "-U, --union", "Take the Union of -I and -R" },
   { "--rerun-failed", "Run only the tests that failed previously" },
-  { "--repeat-until-fail <n>",
-    "Require each test to run <n> "
-    "times without failing in order to pass" },
+  { "--repeat until-fail:<n>, --repeat-until-fail <n>",
+    "Require each test to run <n> times without failing in order to pass" },
+  { "--repeat until-pass:<n>",
+    "Allow each test to run up to <n> times in order to pass" },
+  { "--repeat after-timeout:<n>",
+    "Allow each test to run up to <n> times if it times out" },
   { "--max-width <width>", "Set the max width for a test name to output" },
   { "--interactive-debug-mode [0|1]", "Set the interactive mode to 0 or 1." },
   { "--resource-spec-file <file>", "Set the resource spec file to use." },
@@ -161,7 +164,6 @@
   argv = encoding_args.argv();
 
   cmSystemTools::DoNotInheritStdPipes();
-  cmSystemTools::EnableMSVCDebugHook();
   cmSystemTools::InitializeLibUV();
   cmSystemTools::FindCMakeResources(argv[0]);
 
diff --git a/Source/kwsys/CTestCustom.cmake.in b/Source/kwsys/CTestCustom.cmake.in
index 760221b..c07f0f3 100644
--- a/Source/kwsys/CTestCustom.cmake.in
+++ b/Source/kwsys/CTestCustom.cmake.in
@@ -12,3 +12,7 @@
 list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
   kwsys.testProcess-10
   )
+
+list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
+  "LICENSE WARNING"
+  )
diff --git a/Source/kwsys/Encoding.hxx.in b/Source/kwsys/Encoding.hxx.in
index b067521..75a2d4d 100644
--- a/Source/kwsys/Encoding.hxx.in
+++ b/Source/kwsys/Encoding.hxx.in
@@ -68,6 +68,8 @@
    * absolute paths with Windows-style backslashes.
    **/
   static std::wstring ToWindowsExtendedPath(std::string const&);
+  static std::wstring ToWindowsExtendedPath(const char* source);
+  static std::wstring ToWindowsExtendedPath(std::wstring const& wsource);
 #  endif
 
 #endif // @KWSYS_NAMESPACE@_STL_HAS_WSTRING
diff --git a/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx
index 4593c92..5cad934 100644
--- a/Source/kwsys/EncodingCXX.cxx
+++ b/Source/kwsys/EncodingCXX.cxx
@@ -221,8 +221,18 @@
 // Convert local paths to UNC style paths
 std::wstring Encoding::ToWindowsExtendedPath(std::string const& source)
 {
-  std::wstring wsource = Encoding::ToWide(source);
+  return ToWindowsExtendedPath(ToWide(source));
+}
 
+// Convert local paths to UNC style paths
+std::wstring Encoding::ToWindowsExtendedPath(const char* source)
+{
+  return ToWindowsExtendedPath(ToWide(source));
+}
+
+// Convert local paths to UNC style paths
+std::wstring Encoding::ToWindowsExtendedPath(std::wstring const& wsource)
+{
   // Resolve any relative paths
   DWORD wfull_len;
 
@@ -269,7 +279,7 @@
 
   // If this case has been reached, then the path is invalid.  Leave it
   // unchanged
-  return Encoding::ToWide(source);
+  return wsource;
 }
 #  endif
 
diff --git a/Source/kwsys/FStream.hxx.in b/Source/kwsys/FStream.hxx.in
index d79bbdf..b424488 100644
--- a/Source/kwsys/FStream.hxx.in
+++ b/Source/kwsys/FStream.hxx.in
@@ -87,7 +87,7 @@
 
   bool _open(char const* file_name, std::ios_base::openmode mode)
   {
-    if (is_open() || file_) {
+    if (_is_open() || file_) {
       return false;
     }
 #  if defined(_MSC_VER)
@@ -108,7 +108,7 @@
     return success;
   }
 
-  bool is_open()
+  bool _is_open()
   {
     if (!buf_) {
       return false;
@@ -116,7 +116,7 @@
     return buf_->is_open();
   }
 
-  bool is_open() const
+  bool _is_open() const
   {
     if (!buf_) {
       return false;
@@ -198,9 +198,11 @@
     this->_set_state(this->_open(file_name, mode), this, this);
   }
 
+  bool is_open() { return this->_is_open(); }
+
   void close() { this->_set_state(this->_close(), this, this); }
 
-  using basic_efilebuf<CharType, Traits>::is_open;
+  using basic_efilebuf<CharType, Traits>::_is_open;
 
   internal_buffer_type* rdbuf() const { return this->buf_; }
 
@@ -212,7 +214,7 @@
   : public std::basic_ostream<CharType, Traits>
   , public basic_efilebuf<CharType, Traits>
 {
-  using basic_efilebuf<CharType, Traits>::is_open;
+  using basic_efilebuf<CharType, Traits>::_is_open;
 
 public:
   typedef typename basic_efilebuf<CharType, Traits>::internal_buffer_type
@@ -242,6 +244,8 @@
 
   void close() { this->_set_state(this->_close(), this, this); }
 
+  bool is_open() { return this->_is_open(); }
+
   internal_buffer_type* rdbuf() const { return this->buf_; }
 
   ~basic_ofstream() @KWSYS_NAMESPACE@_FStream_NOEXCEPT { close(); }
diff --git a/Source/kwsys/RegularExpression.hxx.in b/Source/kwsys/RegularExpression.hxx.in
index df7eb45..d11db88 100644
--- a/Source/kwsys/RegularExpression.hxx.in
+++ b/Source/kwsys/RegularExpression.hxx.in
@@ -66,16 +66,27 @@
   const char* searchstring;
 };
 
+#ifdef _MSC_VER
+#  pragma warning(push)
+#  if _MSC_VER < 1900
+#    pragma warning(disable : 4351) /* new behavior */
+#  endif
+#endif
+
 /**
  * \brief Creates an invalid match object
  */
 inline RegularExpressionMatch::RegularExpressionMatch()
+  : startp{}
+  , endp{}
+  , searchstring{}
 {
-  startp[0] = nullptr;
-  endp[0] = nullptr;
-  searchstring = nullptr;
 }
 
+#ifdef _MSC_VER
+#  pragma warning(pop)
+#endif
+
 /**
  * \brief Returns true if the match pointers are valid
  */
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index ce4d6ef..39873e6 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2326,14 +2326,8 @@
 static bool CopyFileContentBlockwise(const std::string& source,
                                      const std::string& destination)
 {
-// Open files
-#if defined(_WIN32)
-  kwsys::ifstream fin(
-    Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(),
-    std::ios::in | std::ios::binary);
-#else
+  // Open files
   kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary);
-#endif
   if (!fin) {
     return false;
   }
@@ -2344,14 +2338,8 @@
   // that do not allow file removal can be modified.
   SystemTools::RemoveFile(destination);
 
-#if defined(_WIN32)
-  kwsys::ofstream fout(
-    Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(destination)).c_str(),
-    std::ios::out | std::ios::trunc | std::ios::binary);
-#else
   kwsys::ofstream fout(destination.c_str(),
                        std::ios::out | std::ios::trunc | std::ios::binary);
-#endif
   if (!fout) {
     return false;
   }
@@ -4678,8 +4666,12 @@
 #  include <stdlib.h>
 namespace KWSYS_NAMESPACE {
 
-static int SystemToolsDebugReport(int, char* message, int*)
+static int SystemToolsDebugReport(int, char* message, int* ret)
 {
+  if (ret) {
+    // Pretend user clicked on Retry button in popup.
+    *ret = 1;
+  }
   fprintf(stderr, "%s", message);
   fflush(stderr);
   return 1; // no further reporting required
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c
index 4dd2461..c9515ee 100644
--- a/Source/kwsys/Terminal.c
+++ b/Source/kwsys/Terminal.c
@@ -172,6 +172,14 @@
     }
   }
 
+  /* GNU make 4.1+ may tell us that its output is destined for a TTY. */
+  {
+    const char* termout = getenv("MAKE_TERMOUT");
+    if (termout && *termout != '\0') {
+      return 1;
+    }
+  }
+
   /* If running inside emacs the terminal is not VT100.  Some emacs
      seem to claim the TERM is xterm even though they do not support
      VT100 escapes.  */
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index 840afc1..976c924 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -25,6 +25,7 @@
   testUVProcessChain.cxx
   testUVRAII.cxx
   testUVStreambuf.cxx
+  testCMExtMemory.cxx
   )
 
 add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx)
diff --git a/Tests/CMakeLib/testCMExtMemory.cxx b/Tests/CMakeLib/testCMExtMemory.cxx
new file mode 100644
index 0000000..6663c17
--- /dev/null
+++ b/Tests/CMakeLib/testCMExtMemory.cxx
@@ -0,0 +1,65 @@
+#include <iostream>
+#include <memory>
+
+#include <cmext/memory>
+
+namespace {
+class Base
+{
+public:
+  virtual ~Base() = default;
+};
+
+class Derived : public Base
+{
+public:
+  ~Derived() = default;
+
+  void method() {}
+};
+
+template <typename T>
+class Wrapper
+{
+public:
+  Wrapper(T* v)
+    : value(v)
+  {
+  }
+  ~Wrapper() { delete value; }
+
+  T* get() const { return value; }
+
+private:
+  T* value;
+};
+
+bool testReferenceCast()
+{
+  std::cout << "testReferenceCast()" << std::endl;
+
+  std::unique_ptr<Base> u(new Derived);
+  cm::static_reference_cast<Derived>(u).method();
+  cm::dynamic_reference_cast<Derived>(u).method();
+
+  std::shared_ptr<Base> s(new Derived);
+  cm::static_reference_cast<Derived>(s).method();
+  cm::dynamic_reference_cast<Derived>(s).method();
+
+  // can also be used with custom wrappers
+  Wrapper<Base> w(new Derived);
+  cm::static_reference_cast<Derived>(w).method();
+  cm::dynamic_reference_cast<Derived>(w).method();
+
+  return true;
+}
+}
+
+int testCMExtMemory(int /*unused*/, char* /*unused*/ [])
+{
+  if (!testReferenceCast()) {
+    return 1;
+  }
+
+  return 0;
+}
diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx
index 986f595..1bf88cf 100644
--- a/Tests/CMakeLib/testUTF8.cxx
+++ b/Tests/CMakeLib/testUTF8.cxx
@@ -9,9 +9,11 @@
 static void test_utf8_char_print(test_utf8_char const c)
 {
   unsigned char const* d = reinterpret_cast<unsigned char const*>(c);
+#ifndef __clang_analyzer__ // somehow thinks arguments are not initialized
   printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast<int>(d[0]),
          static_cast<int>(d[1]), static_cast<int>(d[2]),
          static_cast<int>(d[3]));
+#endif
 }
 
 static void byte_array_print(char const* s)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 57fa7fc..0d9e43f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -451,8 +451,12 @@
   ADD_TEST_MACRO(StagingPrefix StagingPrefix)
   ADD_TEST_MACRO(ImportedSameName ImportedSameName)
   ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
-  if(NOT _isMultiConfig)
-    set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+  if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+    if(_isMultiConfig)
+      set(ConfigSources_CTEST_OPTIONS --build-config $<CONFIGURATION>)
+    else()
+      set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+    endif()
     ADD_TEST_MACRO(ConfigSources ConfigSources)
   endif()
   ADD_TEST_MACRO(SourcesProperty SourcesProperty)
@@ -1401,6 +1405,7 @@
             ICU
             JPEG
             JsonCpp
+            LibArchive
             LibLZMA
             LibRHash
             Libinput
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 03babd2..85b9694 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -75,6 +75,12 @@
 
 add_test(CMakeOnly.ProjectIncludeBefore ${CMAKE_CMAKE_COMMAND}
   -DTEST=ProjectIncludeBefore
+  -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake
+  -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
+  )
+
+add_test(CMakeOnly.ProjectIncludeBeforeAny ${CMAKE_CMAKE_COMMAND}
+  -DTEST=ProjectIncludeBeforeAny
   -DCMAKE_ARGS=-DCMAKE_PROJECT_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake
   -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
   )
diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt
new file mode 100644
index 0000000..5cd9cba
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(FOO TRUE)
+project(ProjectInclude LANGUAGES NONE)
+if(NOT AUTO_INCLUDE)
+  message(FATAL_ERROR "include file not found")
+endif()
diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake
new file mode 100644
index 0000000..0a4799d
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake
@@ -0,0 +1,9 @@
+if(NOT FOO)
+  message(FATAL_ERROR "FOO is not set")
+endif()
+
+if(NOT "${PROJECT_NAME}" STREQUAL "")
+  message(FATAL_ERROR "PROJECT_NAME should be empty")
+endif()
+
+set(AUTO_INCLUDE TRUE)
diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
index 9632664..a79bfcb 100644
--- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
+++ b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
@@ -21,11 +21,11 @@
 
 # First setup source and binary trees:
 #
-execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
+execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
   ${dir}/Source
 )
 
-execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
+execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
   ${dir}/Build
 )
 
@@ -69,7 +69,7 @@
 
   # Save this iteration of the Build directory:
   #
-  execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
+  execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
     ${dir}/b${i}
     )
   execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index bc5b6a9..4363f1b 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -104,7 +104,7 @@
         COMPONENT applications)
 
 if(EXISTS "./dirtest")
-  execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ./dirtest)
+  execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ./dirtest)
 endif()
 # NOTE: directory left empty on purpose
 execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ./dirtest)
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 2e41754..9fd85be 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -324,7 +324,7 @@
       ${file}
       "[${hkey}]" DOC "Registry_Test_Path")
     exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
-    exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
+    exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"")
   endif ()
 endif ()
 
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 64f6dc8..df874ef 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -131,7 +131,7 @@
 
     # Custom target to try preprocessing invocation.
     add_custom_target(test_preprocess ${MAYBE_ALL}
-      COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
+      COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/create_file.dir/create_file.i
       COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 628cd4e..28b73af 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -281,7 +281,7 @@
       ${file}
       "[${hkey}]" DOC "Registry_Test_Path")
     exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
-    exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
+    exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"")
   endif ()
 endif ()
 
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index 64f6dc8..df874ef 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -131,7 +131,7 @@
 
     # Custom target to try preprocessing invocation.
     add_custom_target(test_preprocess ${MAYBE_ALL}
-      COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
+      COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/create_file.dir/create_file.i
       COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index e9a9f52..e4b50d0 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -70,7 +70,7 @@
   COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1temp.h
                                    ${PROJECT_BINARY_DIR}/doc1.h
   COMMAND ${CMAKE_COMMAND} -E echo " Removing doc1temp.h."
-  COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_BINARY_DIR}/doc1temp.h
+  COMMAND ${CMAKE_COMMAND} -E rm -f ${PROJECT_BINARY_DIR}/doc1temp.h
   )
 
 # Add custom command to generate foo.h.
@@ -412,7 +412,7 @@
 add_dependencies(do_check_command_line check_command_line)
 
 add_custom_target(pre_check_command_line
-  COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
+  COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
   )
 add_dependencies(do_check_command_line pre_check_command_line)
 
diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in
index b7587aa..7781ded 100644
--- a/Tests/EnforceConfig.cmake.in
+++ b/Tests/EnforceConfig.cmake.in
@@ -33,5 +33,6 @@
 unset(ENV{CMAKE_GENERATOR_INSTANCE})
 unset(ENV{CMAKE_GENERATOR_PLATFORM})
 unset(ENV{CMAKE_GENERATOR_TOOLSET})
+unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
 
 @TEST_HOME_ENV_CODE@
diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt
index dc621eb..d88eb11 100644
--- a/Tests/ExportImport/CMakeLists.txt
+++ b/Tests/ExportImport/CMakeLists.txt
@@ -7,7 +7,7 @@
 # Wipe out the install tree to make sure the exporter works.
 add_custom_command(
   OUTPUT ${ExportImport_BINARY_DIR}/CleanupProject
-  COMMAND ${CMAKE_COMMAND} -E remove_directory ${ExportImport_BINARY_DIR}/Root
+  COMMAND ${CMAKE_COMMAND} -E rm -rf ${ExportImport_BINARY_DIR}/Root
   )
 add_custom_target(CleanupTarget ALL DEPENDS ${ExportImport_BINARY_DIR}/CleanupProject)
 set_property(
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 093391e..ef81169 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -482,6 +482,66 @@
   )
   set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
 
+  # Unzip/untar the git repository in our source folder so that other
+  # projects below may use it to test git args of ExternalProject_Add
+  #
+  set(proj SetupLocalGITRepositoryWithRecursiveSubmodules)
+  ExternalProject_Add(${proj}
+          SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT-with-recursive-submodules
+          URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo-sub-rec.tgz
+          BUILD_COMMAND ""
+          CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
+          INSTALL_COMMAND ""
+          )
+  set_property(TARGET ${proj}
+          PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
+
+  set(local_git_repo "../../LocalRepositories/GIT-with-recursive-submodules")
+
+  set(proj TS1-GIT-RECURSIVE_SUBMODULES-default)
+  ExternalProject_Add(${proj}
+          GIT_REPOSITORY "${local_git_repo}"
+          CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+          CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+                     -DWITH_RECURSIVE:BOOL=ON
+          BUILD_COMMAND  ""
+          INSTALL_COMMAND ""
+          DEPENDS "SetupLocalGITRepository"
+                  "SetupLocalGITRepositoryWithSubmodules"
+                  "SetupLocalGITRepositoryWithRecursiveSubmodules"
+          )
+  set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
+  set(proj TS1-GIT-RECURSIVE_SUBMODULES-exclusive)
+  ExternalProject_Add(${proj}
+          GIT_REPOSITORY "${local_git_repo}"
+          GIT_SUBMODULES_RECURSE TRUE
+          CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+          CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+                     -DWITH_RECURSIVE:BOOL=ON
+          BUILD_COMMAND  ""
+          INSTALL_COMMAND ""
+          DEPENDS "SetupLocalGITRepository"
+                  "SetupLocalGITRepositoryWithSubmodules"
+                  "SetupLocalGITRepositoryWithRecursiveSubmodules"
+          )
+  set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
+  set(proj TS1-GIT-RECURSIVE_SUBMODULES-off)
+  ExternalProject_Add(${proj}
+          GIT_REPOSITORY "${local_git_repo}"
+          GIT_SUBMODULES_RECURSE FALSE
+          CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+          CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+                     -DWITH_RECURSIVE:BOOL=OFF
+          BUILD_COMMAND  ""
+          INSTALL_COMMAND ""
+          DEPENDS "SetupLocalGITRepository"
+                  "SetupLocalGITRepositoryWithSubmodules"
+                  "SetupLocalGITRepositoryWithRecursiveSubmodules"
+          )
+  set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
 endif()
 
 set(do_hg_tests 0)
diff --git a/Tests/ExternalProject/gitrepo-sub-rec.tgz b/Tests/ExternalProject/gitrepo-sub-rec.tgz
new file mode 100644
index 0000000..b0f3f18
--- /dev/null
+++ b/Tests/ExternalProject/gitrepo-sub-rec.tgz
Binary files differ
diff --git a/Tests/FindLibArchive/CMakeLists.txt b/Tests/FindLibArchive/CMakeLists.txt
new file mode 100644
index 0000000..f532ef2
--- /dev/null
+++ b/Tests/FindLibArchive/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLibArchive.Test COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindLibArchive/Test"
+  "${CMake_BINARY_DIR}/Tests/FindLibArchive/Test"
+  ${build_generator_args}
+  --build-project TestFindLibArchive
+  --build-options ${build_options}
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+  )
diff --git a/Tests/FindLibArchive/Test/CMakeLists.txt b/Tests/FindLibArchive/Test/CMakeLists.txt
new file mode 100644
index 0000000..35843bb
--- /dev/null
+++ b/Tests/FindLibArchive/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.12)
+project(TestFindLibArchive C)
+include(CTest)
+
+find_package(LibArchive REQUIRED)
+
+add_executable(test_libarchive_tgt main.c)
+target_link_libraries(test_libarchive_tgt LibArchive::LibArchive)
+add_test(NAME test_libarchive_tgt COMMAND test_libarchive_tgt)
+
+add_executable(test_libarchive_var main.c)
+target_include_directories(test_libarchive_var PRIVATE ${LibArchive_INCLUDE_DIRS})
+target_link_libraries(test_libarchive_var PRIVATE ${LibArchive_LIBRARIES})
+add_test(NAME test_libarchive_var COMMAND test_libarchive_var)
diff --git a/Tests/FindLibArchive/Test/main.c b/Tests/FindLibArchive/Test/main.c
new file mode 100644
index 0000000..03e7ece
--- /dev/null
+++ b/Tests/FindLibArchive/Test/main.c
@@ -0,0 +1,7 @@
+#include <archive.h>
+
+int main(void)
+{
+  archive_read_free(archive_read_new());
+  return 0;
+}
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index 23832da..8a87a8c 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -19,6 +19,14 @@
     # configure a FindFoo.cmake so it knows where the library can be found
     configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY)
 
+    # Need the -isysroot flag on recentish macOS after command line tools
+    # no longer provide headers in /usr/include
+    if(APPLE AND CMAKE_OSX_SYSROOT)
+      set(__EXTRA_OSX_SYSROOT_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
+    else()
+      set(__EXTRA_OSX_SYSROOT_FLAGS "")
+    endif()
+
     # now set up the test:
     file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
       CONTENT "CMAKE = \"$<TARGET_FILE:cmake>\"\n"
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index 8e7ff72..5ef67d0 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -5,6 +5,7 @@
 CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@"
 CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@"
 CMAKE_CXX_FLAGS = @CMAKE_CXX_FLAGS@
+__EXTRA_OSX_SYSROOT_FLAGS = @__EXTRA_OSX_SYSROOT_FLAGS@
 
 CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
 
@@ -15,7 +16,7 @@
 main.o: clean main.cpp
 	@$(CMAKE_FOO) -DMODE=COMPILE >$(tmp)
 	@foo="`cat $(tmp)`"; \
-	 printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$$foo" >$(tmp)
+	 printf '"%s" %s %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(__EXTRA_OSX_SYSROOT_FLAGS)" "$$foo" >$(tmp)
 	@cat $(tmp)
 	@sh $(tmp)
 	@rm -f $(tmp)
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 868cfe0..10c98c5 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -134,6 +134,20 @@
     --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
     )
 
+  add_test(NAME FindPython.CustomFailureMessage COMMAND
+    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+    --build-and-test
+    "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
+    "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
+    ${build_generator_args}
+    --build-project TestCustomFailureMessage
+    --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+    "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+    "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+    "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
+    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+    )
+
 endif()
 
 if(CMake_TEST_FindPython_NumPy)
diff --git a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
new file mode 100644
index 0000000..a0d8eb2
--- /dev/null
+++ b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
@@ -0,0 +1,79 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestCustomFailureMessage LANGUAGES NONE)
+
+include(CTest)
+
+add_test(NAME FindPython.CustomFailureMessage.Interpreter COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Interpreter"
+  ${build_generator_args}
+  --build-project TestCustomFailureMessage.Check
+  --build-options "-DCHECK_COMPONENTS=Interpreter"
+                  "-DPython3_EXECUTABLE=/not/found/interpreter"
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+  )
+set_tests_properties(FindPython.CustomFailureMessage.Interpreter PROPERTIES
+  PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter")
+
+add_test(NAME FindPython.CustomFailureMessage.Library COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Library"
+  ${build_generator_args}
+  --build-project TestCustomFailureMessage.Check
+  --build-options "-DCHECK_COMPONENTS=Development"
+                  "-DPython3_LIBRARY=/not/found/library"
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+  )
+set_tests_properties(FindPython.CustomFailureMessage.Library PROPERTIES
+  PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the library")
+
+add_test(NAME FindPython.CustomFailureMessage.Include COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Include"
+  ${build_generator_args}
+  --build-project TestCustomFailureMessage.Check
+  --build-options "-DCHECK_COMPONENTS=Development"
+                  "-DPython3_INCLUDE_DIR=/not/found/include"
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+  )
+set_tests_properties(FindPython.CustomFailureMessage.Include PROPERTIES
+  PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the directory")
+
+add_test(NAME FindPython.CustomFailureMessage.Multiple COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Multiple"
+  ${build_generator_args}
+  --build-project TestCustomFailureMessage.Check
+  --build-options "-DCHECK_COMPONENTS=Interpreter;Development"
+                  "-DPython3_EXECUTABLE=/not/found/interpreter"
+                  "-DPython3_LIBRARY=/not/found/library"
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+  )
+set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES
+  PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library")
+
+
+if (CMake_TEST_FindPython_NumPy)
+  add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND
+    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+    --build-and-test
+    "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+    "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/NumPy"
+    ${build_generator_args}
+    --build-project TestCustomFailureMessage.Check
+    --build-options "-DCHECK_COMPONENTS=Interpreter;Development;NumPy"
+                    "-DPython3_NumPy_INCLUDE_DIR=/not/found/numpy/include"
+    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+    )
+  set_tests_properties(FindPython.CustomFailureMessage.NumPy PROPERTIES
+    PASS_REGULAR_EXPRESSION "Reason given by package:.+NumPy: Cannot find the directory")
+endif()
diff --git a/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
new file mode 100644
index 0000000..fed963e
--- /dev/null
+++ b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestCustomFailureMessage.Check LANGUAGES C)
+
+find_package (Python3 REQUIRED COMPONENTS ${CHECK_COMPONENTS})
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index de887fa..d945375 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -103,11 +103,11 @@
 
     # Custom target to try preprocessing invocation.
     add_custom_target(test_preprocess ${MAYBE_ALL}
-      COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/preprocess.dir/preprocess.F.i
+      COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/preprocess.dir/preprocess.F.i
       COMMAND ${CMAKE_MAKE_PROGRAM} preprocess.i
       COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
       # Remove bogus file some compilers leave behind.
-      COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/preprocess.s
+      COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_SOURCE_DIR}/preprocess.s
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       )
   endif()
diff --git a/Tests/JavaExportImport/CMakeLists.txt b/Tests/JavaExportImport/CMakeLists.txt
index c70704a..7a2d020 100644
--- a/Tests/JavaExportImport/CMakeLists.txt
+++ b/Tests/JavaExportImport/CMakeLists.txt
@@ -9,7 +9,7 @@
 # Wipe out the install tree to make sure the exporter works.
 add_custom_command(
   OUTPUT ${JavaExportImport_BINARY_DIR}/CleanupProject
-  COMMAND ${CMAKE_COMMAND} -E remove_directory ${JavaExportImport_BINARY_DIR}/Root
+  COMMAND ${CMAKE_COMMAND} -E rm -rf ${JavaExportImport_BINARY_DIR}/Root
   )
 add_custom_target(CleanupTarget ALL DEPENDS ${JavaExportImport_BINARY_DIR}/CleanupProject)
 set_property(
diff --git a/Tests/LinkDirectory/CMakeLists.txt b/Tests/LinkDirectory/CMakeLists.txt
index c60de84..c7a2700 100644
--- a/Tests/LinkDirectory/CMakeLists.txt
+++ b/Tests/LinkDirectory/CMakeLists.txt
@@ -33,7 +33,7 @@
 # directly because it does not know the full paths to the libraries.
 # (The purpose of this test is to check that link_directories works.)
 ExternalProject_Add_Step(ExternalTarget cleanup
-  COMMAND ${CMAKE_COMMAND} -E remove_directory ${LinkDirectory_BINARY_DIR}/bin
+  COMMAND ${CMAKE_COMMAND} -E rm -rf ${LinkDirectory_BINARY_DIR}/bin
   DEPENDEES download
   DEPENDERS configure
   DEPENDS mylibA mylibB
diff --git a/Tests/MacRuntimePath/CMakeLists.txt b/Tests/MacRuntimePath/CMakeLists.txt
index a3c6fd9..9f1bf1a 100644
--- a/Tests/MacRuntimePath/CMakeLists.txt
+++ b/Tests/MacRuntimePath/CMakeLists.txt
@@ -7,7 +7,7 @@
 # Wipe out the install tree to make sure the exporter works.
 add_custom_command(
   OUTPUT ${MacRuntimePath_BINARY_DIR}/CleanupProject
-  COMMAND ${CMAKE_COMMAND} -E remove_directory ${MacRuntimePath_BINARY_DIR}/Root
+  COMMAND ${CMAKE_COMMAND} -E rm -rf ${MacRuntimePath_BINARY_DIR}/Root
   )
 add_custom_target(CleanupTarget ALL DEPENDS ${MacRuntimePath_BINARY_DIR}/CleanupProject)
 set_property(
diff --git a/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt
new file mode 100644
index 0000000..a736129
--- /dev/null
+++ b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0068-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0068 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt
new file mode 100644
index 0000000..f51a6f4
--- /dev/null
+++ b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0069-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0069 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 6b2f117..1b3577f 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -189,6 +189,7 @@
 add_RunCMake_test(GetPrerequisites)
 add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME})
 add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test
+add_RunCMake_test(Graphviz)
 add_RunCMake_test(TargetPropertyGeneratorExpressions)
 add_RunCMake_test(Languages)
 add_RunCMake_test(LinkStatic)
@@ -278,6 +279,7 @@
 add_RunCMake_test(include_directories)
 add_RunCMake_test(include_guard)
 add_RunCMake_test(list)
+add_RunCMake_test(load_cache)
 add_RunCMake_test(math)
 add_RunCMake_test(message)
 add_RunCMake_test(option)
@@ -289,6 +291,9 @@
 add_RunCMake_test(string)
 add_RunCMake_test(test_include_dirs)
 add_RunCMake_test(BundleUtilities)
+if(APPLE)
+  add_RunCMake_test(INSTALL_NAME_DIR)
+endif()
 
 function(add_RunCMake_test_try_compile)
   if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
@@ -441,7 +446,7 @@
 add_RunCMake_test(target_sources)
 add_RunCMake_test(CheckModules)
 add_RunCMake_test(CheckIPOSupported)
-add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
+add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN})
 add_RunCMake_test(CommandLineTar)
 
 if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG))
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 6b23162..0953504 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -4,6 +4,28 @@
 unset(ENV{CTEST_PARALLEL_LEVEL})
 unset(ENV{CTEST_OUTPUT_ON_FAILURE})
 
+run_cmake_command(repeat-opt-bad1
+  ${CMAKE_CTEST_COMMAND} --repeat until-pass
+  )
+run_cmake_command(repeat-opt-bad2
+  ${CMAKE_CTEST_COMMAND} --repeat until-pass:foo
+  )
+run_cmake_command(repeat-opt-bad3
+  ${CMAKE_CTEST_COMMAND} --repeat until-fail:2 --repeat-until-fail 2
+  )
+run_cmake_command(repeat-opt-bad4
+  ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat until-fail:2
+  )
+run_cmake_command(repeat-opt-until-pass
+  ${CMAKE_CTEST_COMMAND} --repeat until-pass:2
+  )
+run_cmake_command(repeat-opt-until-fail
+  ${CMAKE_CTEST_COMMAND} --repeat until-fail:2
+  )
+run_cmake_command(repeat-opt-after-timeout
+  ${CMAKE_CTEST_COMMAND} --repeat after-timeout:2
+  )
+
 run_cmake_command(repeat-until-fail-bad1
   ${CMAKE_CTEST_COMMAND} --repeat-until-fail
   )
@@ -14,19 +36,39 @@
   ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2
   )
 
+function(run_repeat_until_pass_tests)
+  # Use a single build tree for a few tests without cleaning.
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-pass-build)
+  run_cmake(repeat-until-pass-cmake)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  run_cmake_command(repeat-until-pass-ctest
+    ${CMAKE_CTEST_COMMAND} -C Debug --repeat until-pass:3
+    )
+endfunction()
+run_repeat_until_pass_tests()
+
+function(run_repeat_after_timeout_tests)
+  # Use a single build tree for a few tests without cleaning.
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-after-timeout-build)
+  run_cmake(repeat-after-timeout-cmake)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  run_cmake_command(repeat-after-timeout-ctest
+    ${CMAKE_CTEST_COMMAND} -C Debug --repeat after-timeout:3
+    )
+endfunction()
+run_repeat_after_timeout_tests()
+
 function(run_repeat_until_fail_tests)
   # Use a single build tree for a few tests without cleaning.
   set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build)
-  set(RunCMake_TEST_NO_CLEAN 1)
-  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
-  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
-
   run_cmake(repeat-until-fail-cmake)
+  set(RunCMake_TEST_NO_CLEAN 1)
   run_cmake_command(repeat-until-fail-ctest
-    ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-fail 3
+    ${CMAKE_CTEST_COMMAND} -C Debug ${ARGN}
     )
 endfunction()
-run_repeat_until_fail_tests()
+run_repeat_until_fail_tests(--repeat-until-fail 3)
+run_repeat_until_fail_tests(--repeat until-fail:3)
 
 function(run_BadCTestTestfile)
   set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BadCTestTestfile)
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
new file mode 100644
index 0000000..873c0bd
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
@@ -0,0 +1,15 @@
+enable_testing()
+
+set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
+add_test(NAME initialization
+  COMMAND ${CMAKE_COMMAND}
+  "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+  -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake")
+add_test(NAME test1
+  COMMAND ${CMAKE_COMMAND}
+  "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+  -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-timeout.cmake")
+set_tests_properties(test1 PROPERTIES DEPENDS "initialization" TIMEOUT 5)
+
+add_test(hello ${CMAKE_COMMAND} -E echo hello)
+add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt
new file mode 100644
index 0000000..d0a5487
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt
@@ -0,0 +1,15 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-build
+    Start 1: initialization
+1/4 Test #1: initialization ...................   Passed +[0-9.]+ sec
+    Start 2: test1
+2/4 Test #2: test1 ............................\*\*\*Timeout +[0-9.]+ sec
+    Start 2: test1
+    Test #2: test1 ............................   Passed +[0-9.]+ sec
+    Start 3: hello
+3/4 Test #3: hello ............................   Passed +[0-9.]+ sec
+    Start 4: goodbye
+4/4 Test #4: goodbye ..........................   Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 4
+
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt
new file mode 100644
index 0000000..f6f3241
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat' given invalid value 'until-pass'$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt
new file mode 100644
index 0000000..2f9f32a
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat' given invalid value 'until-pass:foo'$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt
new file mode 100644
index 0000000..de4e11b
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: At most one '--repeat' option may be used\.$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt
new file mode 100644
index 0000000..de4e11b
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: At most one '--repeat' option may be used\.$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake
new file mode 100644
index 0000000..d109551
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake
@@ -0,0 +1,15 @@
+enable_testing()
+
+set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
+add_test(NAME initialization
+  COMMAND ${CMAKE_COMMAND}
+  "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+  -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake")
+add_test(NAME test1
+  COMMAND ${CMAKE_COMMAND}
+  "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+  -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-pass.cmake")
+set_tests_properties(test1 PROPERTIES DEPENDS "initialization")
+
+add_test(hello ${CMAKE_COMMAND} -E echo hello)
+add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt
new file mode 100644
index 0000000..3745dc2
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt
@@ -0,0 +1,15 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-until-pass-build
+    Start 1: initialization
+1/4 Test #1: initialization ...................   Passed +[0-9.]+ sec
+    Start 2: test1
+2/4 Test #2: test1 ............................\*\*\*Failed +[0-9.]+ sec
+    Start 2: test1
+    Test #2: test1 ............................   Passed +[0-9.]+ sec
+    Start 3: hello
+3/4 Test #3: hello ............................   Passed +[0-9.]+ sec
+    Start 4: goodbye
+4/4 Test #4: goodbye ..........................   Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 4
+
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/CTestCommandLine/test1-pass.cmake b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake
new file mode 100644
index 0000000..dda8dea
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake
@@ -0,0 +1,13 @@
+# This is run by test test1 in repeat-until-pass-cmake.cmake with cmake -P.
+# It reads the file TEST_OUTPUT_FILE and increments the number
+# found in the file by 1.  Unless the number is 2, then the
+# code sends out a cmake error causing the test to pass only on
+# the second time it is run.
+message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}")
+file(READ "${TEST_OUTPUT_FILE}" COUNT)
+message("COUNT= ${COUNT}")
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}")
+if(NOT COUNT EQUAL 2)
+  message(FATAL_ERROR "this test passes only on the 2nd run")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake
new file mode 100644
index 0000000..fbf2ccc
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake
@@ -0,0 +1,14 @@
+# This is run by test test1 in repeat-after-timeout-cmake.cmake with cmake -P.
+# It reads the file TEST_OUTPUT_FILE and increments the number
+# found in the file by 1.  Unless the number is 2, then the
+# code sends out a cmake error causing the test to not timeout only on
+# the second time it is run.
+message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}")
+file(READ "${TEST_OUTPUT_FILE}" COUNT)
+message("COUNT= ${COUNT}")
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}")
+if(NOT COUNT EQUAL 2)
+  message("this test times out except on the 2nd run")
+  execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
index 7d63299..ef79dce 100644
--- a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
@@ -1,6 +1,6 @@
 function(setup_resource_tests)
   if(CTEST_RESOURCE_ALLOC_ENABLED)
-    add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E remove -f "${CMAKE_BINARY_DIR}/ctresalloc.log")
+    add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E rm -f "${CMAKE_BINARY_DIR}/ctresalloc.log")
   endif()
 endfunction()
 
diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
index f183594..1baa63a 100644
--- a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
+++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
@@ -1,4 +1,15 @@
-^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
+^CMake Deprecation Warning at cmp0069-is-old.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0069 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
   Policy CMP0069 set to OLD
 Call Stack \(most recent call first\):
   cmp0069-is-old\.cmake:[0-9]+ \(check_ipo_supported\)
diff --git a/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt b/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt
new file mode 100644
index 0000000..62b963a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Unknown -E rm argument: -rd$
diff --git a/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake
new file mode 100644
index 0000000..b1a29a2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/dir/existing.txt)
+  set(RunCMake_TEST_FAILED "${out}/dir/existing.txt should exist (we only removed the link to dir folder)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt
new file mode 100644
index 0000000..1ac7dba
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Missing file/directory to remove$
diff --git a/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake
new file mode 100644
index 0000000..6cd4edd
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake
@@ -0,0 +1,8 @@
+execute_process(
+  COMMAND ${CMAKE_COMMAND} -E rm ""
+  RESULT_VARIABLE actual_result
+  )
+
+if(NOT "${actual_result}" EQUAL "1")
+  message(SEND_ERROR "cmake -E rm \"\" should have returned 1, got ${actual_result}")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake
new file mode 100644
index 0000000..e28b160
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/existing.txt)
+  set(RunCMake_TEST_FAILED "${out}/existing.txt not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake
new file mode 100644
index 0000000..a0a9b20
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/existing.txt)
+  set(RunCMake_TEST_FAILED "${out}/existing.txt should exist (we only removed the link)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake
new file mode 100644
index 0000000..e28b160
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/existing.txt)
+  set(RunCMake_TEST_FAILED "${out}/existing.txt not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt
new file mode 100644
index 0000000..05df88a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: File to remove does not exist and force is not set: .*/rm_tests/not_existing.txt
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake
new file mode 100644
index 0000000..e28b160
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/existing.txt)
+  set(RunCMake_TEST_FAILED "${out}/existing.txt not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt
new file mode 100644
index 0000000..05df88a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: File to remove does not exist and force is not set: .*/rm_tests/not_existing.txt
diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake
new file mode 100644
index 0000000..1a976cb
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out})
+  set(RunCMake_TEST_FAILED "${out} not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt b/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt
new file mode 100644
index 0000000..1ac7dba
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Missing file/directory to remove$
diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake
new file mode 100644
index 0000000..609271e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/d1 OR NOT EXISTS ${out}/d2)
+  set(RunCMake_TEST_FAILED "${out}/d1 or ${out}/d2 is removed but should not")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt
new file mode 100644
index 0000000..33ea2e3
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt
@@ -0,0 +1,2 @@
+^Error removing directory ".*/rm_tests/d1" without recursive option\.
+Error removing directory ".*/rm_tests/d2" without recursive option\.$
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake
new file mode 100644
index 0000000..5282da7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/d1 OR EXISTS ${out}/d2)
+  set(RunCMake_TEST_FAILED "${out}/d1 or ${out}/d2 should be removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake
new file mode 100644
index 0000000..b1a29a2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/dir/existing.txt)
+  set(RunCMake_TEST_FAILED "${out}/dir/existing.txt should exist (we only removed the link to dir folder)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake
new file mode 100644
index 0000000..a0a9b20
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/existing.txt)
+  set(RunCMake_TEST_FAILED "${out}/existing.txt should exist (we only removed the link)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index b608d33..bd368cb 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -254,6 +254,24 @@
 endfunction()
 run_EnvironmentGenerator()
 
+function(run_EnvironmentExportCompileCommands)
+  set(RunCMake_TEST_SOURCE_DIR ${RunCMake_SOURCE_DIR}/env-export-compile-commands)
+
+  run_cmake(env-export-compile-commands-unset)
+
+  set(ENV{CMAKE_EXPORT_COMPILE_COMMANDS} ON)
+  run_cmake(env-export-compile-commands-set)
+
+  set(RunCMake_TEST_OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF)
+  run_cmake(env-export-compile-commands-override)
+
+  unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
+endfunction(run_EnvironmentExportCompileCommands)
+
+if(RunCMake_GENERATOR MATCHES "Unix Makefiles" OR RunCMake_GENERATOR MATCHES "Ninja")
+  run_EnvironmentExportCompileCommands()
+endif()
+
 if(RunCMake_GENERATOR STREQUAL "Ninja")
   # Use a single build tree for a few tests without cleaning.
   set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Build-build)
@@ -370,6 +388,76 @@
 unset(out)
 unset(outfile)
 
+set(out ${RunCMake_BINARY_DIR}/rm_tests)
+file(REMOVE_RECURSE "${out}")
+file(MAKE_DIRECTORY ${out})
+file(TOUCH ${out}/existing.txt)
+run_cmake_command(E_rm_file_force_existing
+  ${CMAKE_COMMAND} -E rm -f ${out}/existing.txt)
+file(TOUCH ${out}/existing.txt)
+run_cmake_command(E_rm_file_non_force_existing
+  ${CMAKE_COMMAND} -E rm ${out}/existing.txt)
+run_cmake_command(E_rm_file_force_non_existing
+  ${CMAKE_COMMAND} -E rm -f ${out}/not_existing.txt)
+run_cmake_command(E_rm_file_non_force_non_existing
+  ${CMAKE_COMMAND} -E rm ${out}/not_existing.txt)
+
+file(TOUCH ${out}/existing.txt)
+run_cmake_command(E_rm_file_recursive_existing
+  ${CMAKE_COMMAND} -E rm -r ${out}/existing.txt)
+run_cmake_command(E_rm_file_recursive_non_existing
+  ${CMAKE_COMMAND} -E rm -r ${out}/not_existing.txt)
+
+file(MAKE_DIRECTORY ${out}/d1 ${out}/d2)
+run_cmake_command(E_rm_non_recursive_directory-two-directories
+  ${CMAKE_COMMAND} -E rm ${out}/d1 ${out}/d2)
+
+run_cmake_command(E_rm_recursive_directory-two-directories
+  ${CMAKE_COMMAND} -E rm -R ${out}/d1 ${out}/d2)
+
+run_cmake_command(E_rm_no_file_specified
+  ${CMAKE_COMMAND} -E rm -rf)
+
+run_cmake_command(E_rm_empty_file_specified
+  ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_rm_empty_file_specified.cmake)
+
+run_cmake_command(E_rm_bad_argument
+  ${CMAKE_COMMAND} -E rm -rd ${out}/d1 ${out}/d2)
+
+file(MAKE_DIRECTORY ${out}/d1 ${out}/d2)
+file(WRITE ${out}/test.txt "")
+run_cmake_command(E_rm_force_recursive_directory_with_files
+  ${CMAKE_COMMAND} -E rm -rf ${out}/)
+
+run_cmake_command(E_rm_force_recursive_non_existing_file
+  ${CMAKE_COMMAND} -E rm -Rf ${out}/test.txt)
+
+if(NOT WIN32 AND NOT CYGWIN)
+  file(MAKE_DIRECTORY ${out})
+  file(TOUCH ${out}/existing.txt)
+  file(MAKE_DIRECTORY ${out}/dir)
+  file(TOUCH ${out}/dir/existing.txt) # add a file in the folder
+  file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC)
+  file(CREATE_LINK ${out}/existing.txt ${out}/existing_file_link.txt SYMBOLIC)
+  file(CREATE_LINK ${out}/non_existing.txt ${out}/non_existing_file_link.txt SYMBOLIC)
+  run_cmake_command(E_rm_file_link_existing
+    ${CMAKE_COMMAND} -E rm ${out}/existing_file_link.txt)
+  run_cmake_command(E_rm_directory_link_existing
+    ${CMAKE_COMMAND} -E rm ${out}/link_dir)
+  run_cmake_command(E_rm_file_link_non_existing
+    ${CMAKE_COMMAND} -E rm ${out}/non_existing_file_link.txt)
+
+  file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC)
+  file(CREATE_LINK ${out}/existing.txt ${out}/existing_file_link.txt SYMBOLIC)
+  file(CREATE_LINK ${out}/non_existing.txt ${out}/non_existing_file_link.txt SYMBOLIC)
+  run_cmake_command(E_rm_recursive_file_link_existing
+    ${CMAKE_COMMAND} -E rm -R ${out}/existing_file_link.txt)
+  run_cmake_command(E_rm_recursive_directory_link_existing
+    ${CMAKE_COMMAND} -E rm -r ${out}/link_dir)
+  run_cmake_command(E_rm_recursive_file_link_non_existing
+    ${CMAKE_COMMAND} -E rm -r ${out}/non_existing_file_link.txt)
+endif()
+unset(out)
 
 run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env)
 run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1)
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake
new file mode 100644
index 0000000..032a1ae
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+  set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS overridden")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake
new file mode 100644
index 0000000..a749a55
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+  set(RunCMake_TEST_FAILED "compile_commands.json not generated with CMAKE_EXPORT_COMPILE_COMMANDS set")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake
new file mode 100644
index 0000000..c5878f0
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+  set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS unset")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt
new file mode 100644
index 0000000..aa6fbfd
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.14)
+project(env-export-compile-commands C)
+
+# Add target with a source file to make sure compile_commands.json gets
+# generated.
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/main.c)
+add_executable(env-export-compile-commands ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/CompilerLauncher/C-common.cmake b/Tests/RunCMake/CompilerLauncher/C-common.cmake
new file mode 100644
index 0000000..96b004b
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-common.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/C-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/C-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/C-env.cmake b/Tests/RunCMake/CompilerLauncher/C-env.cmake
new file mode 100644
index 0000000..09b5167
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-env.cmake
@@ -0,0 +1 @@
+include(C-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/C-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/C-launch-env.cmake
new file mode 100644
index 0000000..68abcb5
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(C-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/C.cmake b/Tests/RunCMake/CompilerLauncher/C.cmake
index 67bf7c4..481e74d 100644
--- a/Tests/RunCMake/CompilerLauncher/C.cmake
+++ b/Tests/RunCMake/CompilerLauncher/C.cmake
@@ -1,4 +1,2 @@
-enable_language(C)
 set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.c)
+include(C-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake
new file mode 100644
index 0000000..6f7fc86
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake
@@ -0,0 +1,3 @@
+enable_language(CUDA)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.cu)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-env.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-env.cmake
new file mode 100644
index 0000000..cefbe9e
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-env.cmake
@@ -0,0 +1 @@
+include(CUDA-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-launch-env.cmake
new file mode 100644
index 0000000..d0d777a
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(CUDA-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA.cmake b/Tests/RunCMake/CompilerLauncher/CUDA.cmake
index fe5560b..7f1652b 100644
--- a/Tests/RunCMake/CompilerLauncher/CUDA.cmake
+++ b/Tests/RunCMake/CompilerLauncher/CUDA.cmake
@@ -1,4 +1,2 @@
-enable_language(CUDA)
 set(CMAKE_CUDA_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.cu)
+include(CUDA-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-common.cmake b/Tests/RunCMake/CompilerLauncher/CXX-common.cmake
new file mode 100644
index 0000000..3d2ee00
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-common.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.cxx)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CXX-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-env.cmake b/Tests/RunCMake/CompilerLauncher/CXX-env.cmake
new file mode 100644
index 0000000..db36956
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-env.cmake
@@ -0,0 +1 @@
+include(CXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/CXX-launch-env.cmake
new file mode 100644
index 0000000..a65cc89
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(CXX-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX.cmake b/Tests/RunCMake/CompilerLauncher/CXX.cmake
index cdd3478..1f9a12b 100644
--- a/Tests/RunCMake/CompilerLauncher/CXX.cmake
+++ b/Tests/RunCMake/CompilerLauncher/CXX.cmake
@@ -1,4 +1,2 @@
-enable_language(CXX)
 set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.cxx)
+include(CXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-common.cmake b/Tests/RunCMake/CompilerLauncher/Fortran-common.cmake
new file mode 100644
index 0000000..e33c2ca
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-common.cmake
@@ -0,0 +1,3 @@
+enable_language(Fortran)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.F)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/Fortran-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-env.cmake b/Tests/RunCMake/CompilerLauncher/Fortran-env.cmake
new file mode 100644
index 0000000..3dc27c3
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-env.cmake
@@ -0,0 +1 @@
+include(Fortran-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/Fortran-launch-env.cmake
new file mode 100644
index 0000000..30a196c
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(Fortran-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran.cmake b/Tests/RunCMake/CompilerLauncher/Fortran.cmake
index 72cc03e..dc46173 100644
--- a/Tests/RunCMake/CompilerLauncher/Fortran.cmake
+++ b/Tests/RunCMake/CompilerLauncher/Fortran.cmake
@@ -1,4 +1,2 @@
-enable_language(Fortran)
 set(CMAKE_Fortran_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.F)
+include(Fortran-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
index bb8da03..f86e8ea 100644
--- a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
@@ -15,6 +15,13 @@
   run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args})
 endfunction()
 
+function(run_compiler_launcher_env lang)
+  string(REGEX REPLACE "-.*" "" core_lang "${lang}")
+  set(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER} "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+  run_compiler_launcher(${lang})
+  unset(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER})
+endfunction()
+
 set(langs C CXX)
 if(CMake_TEST_CUDA)
   list(APPEND langs CUDA)
@@ -25,7 +32,9 @@
 
 foreach(lang ${langs})
   run_compiler_launcher(${lang})
+  run_compiler_launcher_env(${lang}-env)
   if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
     run_compiler_launcher(${lang}-launch)
+    run_compiler_launcher_env(${lang}-launch-env)
   endif()
 endforeach()
diff --git a/Tests/RunCMake/FileAPI/check_index.py b/Tests/RunCMake/FileAPI/check_index.py
index cda7234..23b02e9 100644
--- a/Tests/RunCMake/FileAPI/check_index.py
+++ b/Tests/RunCMake/FileAPI/check_index.py
@@ -109,10 +109,11 @@
     name = g.get("name", None)
     assert is_string(name)
     if name.startswith("Visual Studio"):
-        assert sorted(g.keys()) == ["name", "platform"]
+        assert sorted(g.keys()) == ["multiConfig", "name", "platform"]
         assert is_string(g["platform"])
     else:
-        assert sorted(g.keys()) == ["name"]
+        assert sorted(g.keys()) == ["multiConfig", "name"]
+    assert is_bool(g["multiConfig"], matches(name, "^(Visual Studio |Xcode$)"))
 
 def check_index_object(indexEntry, kind, major, minor, check):
     assert is_dict(indexEntry)
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index ae75561..bb22841 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -30,6 +30,8 @@
     set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86")
     run_cmake(BadToolsetHostArchTwice)
     if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]")
+      set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=Test Path")
+      run_cmake(TestToolsetVCTargetsPathOnly)
       set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version")
       run_cmake(TestToolsetVersionBoth)
       set(RunCMake_GENERATOR_TOOLSET ",version=Test Toolset Version")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt
new file mode 100644
index 0000000..c46373f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+'
+-- CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='Test Path'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake
new file mode 100644
index 0000000..c20a303
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake
@@ -0,0 +1,2 @@
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='${CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR}'")
diff --git a/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in
new file mode 100644
index 0000000..8a1c3d0
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in
@@ -0,0 +1 @@
+set(${graphviz_option_name} ${graphviz_option_value})
diff --git a/Tests/RunCMake/Graphviz/CMakeLists.txt b/Tests/RunCMake/Graphviz/CMakeLists.txt
new file mode 100644
index 0000000..d23d4cf
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.15)
+project(${RunCMake_TEST} C)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
new file mode 100644
index 0000000..772f312
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
@@ -0,0 +1,58 @@
+# For the sake of clarity, we model a dummy but realistic application:
+#
+#   - We have two executables, for a console and a GUI variant of that app
+#   - Both executables depend on a CoreLibrary (STATIC)
+#   - The GUI executable also depends on a GraphicLibrary (SHARED)
+#   - We build two GraphicDrivers as MODULEs
+#   - The CoreLibrary depends on a third-party header-only (INTERFACE)
+#     GoofyLoggingLibrary, which we rename using an ALIAS for obvious reasons
+#   - All library depend on a common INTERFACE library holding compiler flags
+#   - We have a custom target to generate a man page
+#   - Someone has added an UNKNOWN, IMPORTED crypto mining library!
+
+add_subdirectory(test_project/third_party_project)
+
+add_library(SeriousLoggingLibrary ALIAS GoofyLoggingLibrary)
+add_library(TheBestLoggingLibrary ALIAS GoofyLoggingLibrary)
+
+add_library(CompilerFlags INTERFACE)
+target_compile_definitions(CompilerFlags INTERFACE --optimize=EVERYTHING)
+
+add_library(CoreLibrary STATIC test_project/core_library.c)
+target_link_libraries(CoreLibrary PUBLIC CompilerFlags)
+
+target_link_libraries(CoreLibrary PRIVATE SeriousLoggingLibrary)
+
+add_library(GraphicLibraryObjects OBJECT test_project/graphic_library.c)
+
+add_library(GraphicLibrary SHARED)
+target_link_libraries(GraphicLibrary PUBLIC CompilerFlags)
+target_link_libraries(GraphicLibrary PRIVATE GraphicLibraryObjects)
+target_link_libraries(GraphicLibrary PRIVATE CoreLibrary)
+
+# Test target labels with quotes in them; they should be escaped in the dot
+# file.
+# See https://gitlab.kitware.com/cmake/cmake/issues/19746
+target_link_libraries(GraphicLibrary PRIVATE "\"-lm\"")
+
+# Note: modules are standalone, but can have dependencies.
+add_library(GraphicDriverOpenGL MODULE test_project/module.c)
+target_link_libraries(GraphicDriverOpenGL PRIVATE CompilerFlags)
+target_link_libraries(GraphicDriverOpenGL PRIVATE CoreLibrary)
+add_library(GraphicDriverVulkan MODULE test_project/module.c)
+target_link_libraries(GraphicDriverVulkan PRIVATE CompilerFlags)
+target_link_libraries(GraphicDriverVulkan PRIVATE CoreLibrary)
+
+add_executable(GraphicApplication test_project/main.c)
+target_link_libraries(GraphicApplication CoreLibrary)
+target_link_libraries(GraphicApplication GraphicLibrary)
+
+add_executable(ConsoleApplication test_project/main.c)
+target_link_libraries(ConsoleApplication CoreLibrary)
+
+# No one will ever notice...
+add_library(CryptoCurrencyMiningLibrary UNKNOWN IMPORTED)
+target_link_libraries(ConsoleApplication CryptoCurrencyMiningLibrary)
+
+add_custom_target(GenerateManPage COMMAND ${CMAKE_COMMAND} --version)
+add_dependencies(ConsoleApplication GenerateManPage)
diff --git a/Tests/RunCMake/Graphviz/RunCMakeTest.cmake b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
new file mode 100644
index 0000000..c0cea10
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
@@ -0,0 +1,82 @@
+include(RunCMake)
+
+find_program(DOT dot)
+
+# Set to TRUE to re-generate the reference files from the actual outputs.
+# Make sure you verify them!
+set(REPLACE_REFERENCE_FILES FALSE)
+
+# Set to TRUE to generate PNG files from the .dot files, using Graphviz (dot).
+# Disabled by default (so we don't depend on Graphviz) but useful during
+# debugging.
+set(GENERATE_PNG_FILES FALSE)
+
+# 1. Generate the Graphviz (.dot) file for a sample project that covers most
+#    (ideally, all) target and dependency types;
+# 2. Compare that generated file with a reference file.
+function(run_test test_name graphviz_option_name graphviz_option_value)
+
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test_name})
+  set(RunCMake_TEST_NO_CLEAN 1)
+  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+  # Set ${graphviz_option_name} to ${graphviz_option_value}.
+  if(graphviz_option_name)
+    configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeGraphVizOptions.cmake.in
+      ${RunCMake_TEST_BINARY_DIR}/CMakeGraphVizOptions.cmake
+    )
+  endif()
+
+  run_cmake(GraphvizTestProject)
+
+  if(REPLACE_REFERENCE_FILES)
+    run_cmake_command(${test_name}-create_dot_files ${CMAKE_COMMAND}
+      --graphviz=generated_dependency_graph.dot .
+    )
+
+    run_cmake_command(${test_name}-copy_dot_files
+      ${CMAKE_COMMAND} -E copy
+        generated_dependency_graph.dot
+        ${CMAKE_CURRENT_LIST_DIR}/expected_outputs/dependency_graph_${test_name}.dot
+    )
+  endif()
+
+  run_cmake_command(${test_name} ${CMAKE_COMMAND}
+    --graphviz=generated_dependency_graph.dot .
+  )
+
+  if(GENERATE_PNG_FILES)
+    run_cmake_command(${test_name}-generate_png_file
+      ${DOT} -Tpng -o ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.png
+      ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot
+    )
+  endif()
+
+endfunction()
+
+run_test(default_options "" "")
+
+run_test(set_graph_name GRAPHVIZ_GRAPH_NAME "\"CMake Project Dependencies\"")
+run_test(set_graph_header GRAPHVIZ_GRAPH_HEADER
+  "\"node [\n  fontsize = \\\"16\\\"\n];\"")
+run_test(set_node_prefix GRAPHVIZ_NODE_PREFIX "point")
+
+run_test(no_executables GRAPHVIZ_EXECUTABLES FALSE)
+
+run_test(no_static_libs GRAPHVIZ_STATIC_LIBS FALSE)
+run_test(no_shared_libs GRAPHVIZ_SHARED_LIBS FALSE)
+run_test(no_module_libs GRAPHVIZ_MODULE_LIBS FALSE)
+
+run_test(no_interface_libs GRAPHVIZ_INTERFACE_LIBS FALSE)
+run_test(no_object_libs GRAPHVIZ_OBJECT_LIBS FALSE)
+run_test(no_unknown_libs GRAPHVIZ_UNKNOWN_LIBS FALSE)
+
+run_test(no_external_libs GRAPHVIZ_EXTERNAL_LIBS FALSE)
+
+run_test(custom_targets GRAPHVIZ_CUSTOM_TARGETS TRUE)
+
+run_test(no_graphic_libs GRAPHVIZ_IGNORE_TARGETS "Graphic")
+
+run_test(no_per_target_files GRAPHVIZ_GENERATE_PER_TARGET FALSE)
+run_test(no_dependers_files GRAPHVIZ_GENERATE_DEPENDERS FALSE)
diff --git a/Tests/RunCMake/Graphviz/default_options-check.cmake b/Tests/RunCMake/Graphviz/default_options-check.cmake
new file mode 100644
index 0000000..c9a7562
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/default_options-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+        ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_default_options.dot
+        ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
new file mode 100644
index 0000000..8b0365a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
@@ -0,0 +1,52 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GenerateManPage", shape = box ];
+    "node1" -> "node5"  // ConsoleApplication -> GenerateManPage
+    "node6" [ label = "GraphicApplication", shape = egg ];
+    "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node8" [ label = "\"-lm\"", shape = septagon ];
+    "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node7" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
new file mode 100644
index 0000000..1bbf25a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node7" [ label = "\"-lm\"", shape = septagon ];
+    "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node6" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
new file mode 100644
index 0000000..1bbf25a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node7" [ label = "\"-lm\"", shape = septagon ];
+    "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node6" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
new file mode 100644
index 0000000..558a470
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "CoreLibrary", shape = octagon ];
+    "node1" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node1" -> "node2" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node5" [ label = "\"-lm\"", shape = septagon ];
+    "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node4" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
new file mode 100644
index 0000000..660af37
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
@@ -0,0 +1,46 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "GraphicApplication", shape = egg ];
+    "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node5" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node7" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node8" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
new file mode 100644
index 0000000..5af7fec
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
@@ -0,0 +1,35 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "\"-lm\"", shape = septagon ];
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
new file mode 100644
index 0000000..94ec41c
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
@@ -0,0 +1,43 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "ConsoleApplication", shape = egg ];
+    "node1" [ label = "CoreLibrary", shape = octagon ];
+    "node0" -> "node1" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node2" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node0" -> "node2" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node3" [ label = "GraphicApplication", shape = egg ];
+    "node3" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node5" [ label = "\"-lm\"", shape = septagon ];
+    "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node3" -> "node4" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
new file mode 100644
index 0000000..65b7a71
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node7" [ label = "\"-lm\"", shape = septagon ];
+    "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node6" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
new file mode 100644
index 0000000..8116bc9
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
@@ -0,0 +1,48 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node7" [ label = "\"-lm\"", shape = septagon ];
+    "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node6" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
new file mode 100644
index 0000000..1bbf25a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node7" [ label = "\"-lm\"", shape = septagon ];
+    "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node6" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
new file mode 100644
index 0000000..439d1f7
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "\"-lm\"", shape = septagon ];
+    "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot
new file mode 100644
index 0000000..81199a2
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot
@@ -0,0 +1,42 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node3" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node4" [ label = "GraphicApplication", shape = egg ];
+    "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node6" [ label = "\"-lm\"", shape = septagon ];
+    "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node5" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
new file mode 100644
index 0000000..1be6550
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
@@ -0,0 +1,48 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "GraphicApplication", shape = egg ];
+    "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node6" [ label = "\"-lm\"", shape = septagon ];
+    "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node5" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
new file mode 100644
index 0000000..1cfbe0f
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "16"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node7" [ label = "\"-lm\"", shape = septagon ];
+    "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node6" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
new file mode 100644
index 0000000..9653c33
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
@@ -0,0 +1,50 @@
+digraph "CMake Project Dependencies" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "node0" [ label = "CompilerFlags", shape = pentagon ];
+    "node1" [ label = "ConsoleApplication", shape = egg ];
+    "node2" [ label = "CoreLibrary", shape = octagon ];
+    "node2" -> "node0"  // CoreLibrary -> CompilerFlags
+    "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "node5" [ label = "GraphicApplication", shape = egg ];
+    "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "node7" [ label = "\"-lm\"", shape = septagon ];
+    "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "node6" -> "node0"  // GraphicLibrary -> CompilerFlags
+    "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
new file mode 100644
index 0000000..82d96d0
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+  fontsize = "12"
+];
+subgraph clusterLegend {
+  label = "Legend";
+  color = black;
+  edge [ style = invis ];
+  legendNode0 [ label = "Executable", shape = egg ];
+  legendNode1 [ label = "Static Library", shape = octagon ];
+  legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+  legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+  legendNode4 [ label = "Interface Library", shape = pentagon ];
+  legendNode5 [ label = "Object Library", shape = hexagon ];
+  legendNode6 [ label = "Unknown Library", shape = septagon ];
+  legendNode7 [ label = "Custom Target", shape = box ];
+  legendNode0 -> legendNode1 [ style = solid ];
+  legendNode0 -> legendNode2 [ style = solid ];
+  legendNode0 -> legendNode3;
+  legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+  legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+  legendNode3 -> legendNode6 [ style = solid ];
+  legendNode0 -> legendNode7;
+}
+    "point0" [ label = "CompilerFlags", shape = pentagon ];
+    "point1" [ label = "ConsoleApplication", shape = egg ];
+    "point2" [ label = "CoreLibrary", shape = octagon ];
+    "point2" -> "point0"  // CoreLibrary -> CompilerFlags
+    "point3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+    "point2" -> "point3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+    "point1" -> "point2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+    "point4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+    "point1" -> "point4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+    "point5" [ label = "GraphicApplication", shape = egg ];
+    "point5" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+    "point6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+    "point7" [ label = "\"-lm\"", shape = septagon ];
+    "point6" -> "point7" [ style = dotted ] // GraphicLibrary -> "-lm"
+    "point6" -> "point0"  // GraphicLibrary -> CompilerFlags
+    "point6" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+    "point8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+    "point6" -> "point8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+    "point5" -> "point6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+    "point9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+    "point9" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+    "point9" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+    "point10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+    "point10" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+    "point10" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake
new file mode 100644
index 0000000..f4a43b6
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake
@@ -0,0 +1,4 @@
+file(GLOB dependers_files ${RunCMake_TEST_BINARY_DIR}/*.dependers)
+if(${dependers_files})
+    set(RunCMake_TEST_FAILED "Found *.dependers files despite GRAPHVIZ_GENERATE_DEPENDERS set to FALSE.")
+endif()
diff --git a/Tests/RunCMake/Graphviz/no_executables-check.cmake b/Tests/RunCMake/Graphviz/no_executables-check.cmake
new file mode 100644
index 0000000..be29a4f
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_executables-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_executables.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_external_libs-check.cmake b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake
new file mode 100644
index 0000000..518ef7b
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_external_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake
new file mode 100644
index 0000000..0f5aa47
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_graphic_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake
new file mode 100644
index 0000000..018fef0
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_interface_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_module_libs-check.cmake b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake
new file mode 100644
index 0000000..e185cb1
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_module_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_object_libs-check.cmake b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake
new file mode 100644
index 0000000..90e7ecb
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_object_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake
new file mode 100644
index 0000000..95d05a1
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake
@@ -0,0 +1,5 @@
+file(GLOB per_target_files ${RunCMake_TEST_BINARY_DIR}/*.dot.*)
+list(FILTER per_target_files EXCLUDE REGEX ".*\\.dependers$")
+if(per_target_files)
+    set(RunCMake_TEST_FAILED "Found per-target .dot files despite GRAPHVIZ_GENERATE_PER_TARGET set to FALSE.")
+endif()
diff --git a/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake
new file mode 100644
index 0000000..b45da2e
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_shared_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_static_libs-check.cmake b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake
new file mode 100644
index 0000000..befc11b
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_static_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake
new file mode 100644
index 0000000..95286bc
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_unknown_libs.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_graph_header-check.cmake b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake
new file mode 100644
index 0000000..1396484
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_header.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_graph_name-check.cmake b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake
new file mode 100644
index 0000000..0c522e9
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_name.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake
new file mode 100644
index 0000000..61e9b24
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+    ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_node_prefix.dot
+    ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/test_project/core_library.c b/Tests/RunCMake/Graphviz/test_project/core_library.c
new file mode 100644
index 0000000..e8a8844
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/core_library.c
@@ -0,0 +1,3 @@
+void log_something()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/graphic_library.c b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
new file mode 100644
index 0000000..958c8ab
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
@@ -0,0 +1,3 @@
+void initialize_graphics()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/main.c b/Tests/RunCMake/Graphviz/test_project/main.c
new file mode 100644
index 0000000..d123e09
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/main.c
@@ -0,0 +1,4 @@
+int main(int argc, char** argv)
+{
+  return 0;
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/module.c b/Tests/RunCMake/Graphviz/test_project/module.c
new file mode 100644
index 0000000..a508b09
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/module.c
@@ -0,0 +1,3 @@
+static void some_function()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt
new file mode 100644
index 0000000..e381750
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt
@@ -0,0 +1,3 @@
+project(ThirdPartyProject)
+
+add_library(GoofyLoggingLibrary INTERFACE)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt
new file mode 100644
index 0000000..5253d34
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${CMAKE_CURRENT_LIST_DIR}/INSTALL_NAME_DIR.cmake)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake
new file mode 100644
index 0000000..eaa0b45
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake
@@ -0,0 +1,15 @@
+function(add_install_name_dir_libraries install_name_dir)
+  add_library(build_dir SHARED test.c)
+  add_library(install_dir SHARED test.c)
+  if(NOT install_name_dir STREQUAL "NONE")
+    set_target_properties(build_dir install_dir PROPERTIES
+      INSTALL_NAME_DIR "${install_name_dir}"
+      )
+  endif()
+  set_target_properties(install_dir PROPERTIES
+    BUILD_WITH_INSTALL_NAME_DIR TRUE
+    )
+  install(TARGETS build_dir install_dir EXPORT InstallNameDirTest DESTINATION lib)
+  install(EXPORT InstallNameDirTest DESTINATION lib/cmake/InstallNameDirTest FILE InstallNameDirTest-targets.cmake)
+  file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/targets.txt" CONTENT "$<TARGET_FILE:build_dir>\n$<TARGET_FILE:install_dir>\n" CONDITION $<CONFIG:Debug>)
+endfunction()
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake
new file mode 100644
index 0000000..2aa03dd
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake
@@ -0,0 +1,69 @@
+cmake_minimum_required(VERSION 3.16)
+
+include(RunCMake)
+
+function(run_install_test case)
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/fake_install")
+  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+  run_cmake(${case})
+  run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug)
+  run_cmake_command(${case}-install ${CMAKE_COMMAND} --install . --config Debug --prefix "${RunCMake_TEST_BINARY_DIR}/real_install")
+endfunction()
+
+find_program(OTOOL_COMMAND otool)
+
+function(check_install_name_dir file expected)
+  execute_process(COMMAND ${OTOOL_COMMAND} -l ${file} RESULT_VARIABLE _result OUTPUT_VARIABLE _output)
+  if(_result)
+    string(APPEND RunCMake_TEST_FAILED "Could not run otool on ${file}\n")
+  elseif(_output MATCHES "cmd LC_ID_DYLIB\n[^\n]*\n *name ([^\n]*) \\(offset [0-9]+\\)\n")
+    set(_install_name "${CMAKE_MATCH_1}")
+    if(NOT _install_name MATCHES "${expected}")
+      string(APPEND RunCMake_TEST_FAILED "Install name of ${file} did not match ${expected} (actual: ${_install_name})\n")
+    endif()
+  else()
+    string(APPEND RunCMake_TEST_FAILED "otool did not print install name for ${file}\n")
+  endif()
+
+  set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_imported_soname contents target expected)
+  if(contents MATCHES "set_target_properties\\(${target} PROPERTIES\n[^\n]*\n *IMPORTED_SONAME_DEBUG \"([^\n]*)\"\n")
+    set(_soname "${CMAKE_MATCH_1}")
+    set(_regex "^${expected}lib${target}\\.dylib$")
+    if(NOT _soname MATCHES "${_regex}")
+      string(APPEND RunCMake_TEST_FAILED "Target ${target}'s IMPORTED_SONAME_DEBUG did not match ${_regex} (actual: ${_soname})\n")
+    endif()
+  else()
+    string(APPEND RunCMake_TEST_FAILED "Could not find IMPORTED_SONAME_DEBUG for target ${target} in package config file\n")
+  endif()
+
+  set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_libraries fake_install real_install soname_prefix)
+  file(STRINGS "${RunCMake_TEST_BINARY_DIR}/targets.txt" _targets)
+  list(GET _targets 0 _build_dir)
+  list(GET _targets 1 _install_dir)
+  check_install_name_dir("${_build_dir}" "^@rpath/libbuild_dir\\.dylib$")
+  check_install_name_dir("${_install_dir}" "^${fake_install}libinstall_dir\\.dylib$")
+  check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libbuild_dir.dylib" "^${real_install}libbuild_dir\\.dylib$")
+  check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libinstall_dir.dylib" "^${real_install}libinstall_dir\\.dylib$")
+
+  file(READ "${RunCMake_TEST_BINARY_DIR}/real_install/lib/cmake/InstallNameDirTest/InstallNameDirTest-targets-debug.cmake" _targets)
+  check_imported_soname("${_targets}" build_dir "${soname_prefix}")
+  check_imported_soname("${_targets}" install_dir "${soname_prefix}")
+
+  set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+run_install_test(none)
+run_install_test(empty)
+run_install_test(simple)
+run_install_test(simple_genex)
+run_install_test(prefix_genex)
+run_install_test(empty_genex)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake
new file mode 100644
index 0000000..db87d2c
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake
@@ -0,0 +1 @@
+check_libraries("" "" "")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake
new file mode 100644
index 0000000..0cde4d1
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries("")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake
new file mode 100644
index 0000000..db87d2c
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake
@@ -0,0 +1 @@
+check_libraries("" "" "")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake
new file mode 100644
index 0000000..321c8d1
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<0:/usr/local/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake
new file mode 100644
index 0000000..c3e7ac4
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(@rpath/ @rpath/ @rpath/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake
new file mode 100644
index 0000000..79c5e7d
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries(NONE)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake
new file mode 100644
index 0000000..8cf7db8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake
@@ -0,0 +1,6 @@
+check_libraries(
+  ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/fake_install/lib/"
+  ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/real_install/lib/"
+  # "$" has to be escaped twice because of its significance in regexes.
+  "\\\${_IMPORT_PREFIX}/lib/"
+  )
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake
new file mode 100644
index 0000000..7e26208
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<1:$<INSTALL_PREFIX>/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake
new file mode 100644
index 0000000..5f737cb
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake
new file mode 100644
index 0000000..d019875
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries(/usr/local/lib)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake
new file mode 100644
index 0000000..5f737cb
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake
new file mode 100644
index 0000000..1e729e8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<1:/usr/local/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/test.c b/Tests/RunCMake/INSTALL_NAME_DIR/test.c
new file mode 100644
index 0000000..c2db61c
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/test.c
@@ -0,0 +1,3 @@
+void test(void)
+{
+}
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
index 4dddc96..07deee2 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
@@ -1,6 +1,6 @@
 [0-9]+
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
   Maximum recursion depth of [0-9]+ exceeded
 Call Stack \(most recent call first\):
   .*/variable_watch\.cmake:5 \(set\)
-  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
index a8b4756..b2395b3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
@@ -1,6 +1,6 @@
 [0-9]+
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
   Maximum recursion depth of [0-9]+ exceeded
 Call Stack \(most recent call first\):
   variable_watch\.cmake:5 \(set\)
-  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
index 4dddc96..07deee2 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
@@ -1,6 +1,6 @@
 [0-9]+
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
   Maximum recursion depth of [0-9]+ exceeded
 Call Stack \(most recent call first\):
   .*/variable_watch\.cmake:5 \(set\)
-  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
index a8b4756..b2395b3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
@@ -1,6 +1,6 @@
 [0-9]+
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
   Maximum recursion depth of [0-9]+ exceeded
 Call Stack \(most recent call first\):
   variable_watch\.cmake:5 \(set\)
-  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
index 00b2b3c..52fedd3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
@@ -2,17 +2,17 @@
 6
 8
 10
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
   Maximum recursion depth of 10 exceeded
 Call Stack \(most recent call first\):
   .*/variable_watch\.cmake:5 \(set\)
-  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
   .*/variable_watch\.cmake:5 \(set\)
-  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
   .*/variable_watch\.cmake:5 \(set\)
-  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
   .*/variable_watch\.cmake:5 \(set\)
-  .*/variable_watch\.cmake:9999 \(update_x\)
+  .*/variable_watch\.cmake:[0-9]+ \(update_x\)
   .*/variable_watch\.cmake:9 \(set\)
   .*/CMakeLists\.txt:5 \(include\)
 
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
index 8f27bf1..1427f1d 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
@@ -2,17 +2,17 @@
 6
 8
 10
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
   Maximum recursion depth of 10 exceeded
 Call Stack \(most recent call first\):
   variable_watch\.cmake:5 \(set\)
-  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
   variable_watch\.cmake:5 \(set\)
-  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
   variable_watch\.cmake:5 \(set\)
-  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
   variable_watch\.cmake:5 \(set\)
-  variable_watch\.cmake:9999 \(update_x\)
+  variable_watch\.cmake:[0-9]+ \(update_x\)
   variable_watch\.cmake:9 \(set\)
   CMakeLists\.txt:5 \(include\)
 
diff --git a/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
index 81e9ee0..b1c4ce0 100644
--- a/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
+++ b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
@@ -53,7 +53,7 @@
 COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=i586'
 Linking C executable cmTC_ab097.exe
 "C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_ab097.dir\link.txt --verbose=1
-"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_ab097.dir/objects.a
+"C:\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_ab097.dir/objects.a
 C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_ab097.dir/objects.a @CMakeFiles\cmTC_ab097.dir\objects1.rsp
 C:\DoesNotExist\MinGW\bin\gcc.exe  -v    -Wl,--whole-archive CMakeFiles\cmTC_ab097.dir/objects.a -Wl,--no-whole-archive  -o cmTC_ab097.exe -Wl,--out-implib,libcmTC_ab097.dll.a -Wl,--major-image-version,0,--minor-image-version,0
 Using built-in specs.
diff --git a/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
index cd77340..aae67bb 100644
--- a/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
+++ b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
@@ -59,7 +59,7 @@
 COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj' '-c' '-shared-libgcc' '-mtune=generic' '-march=i586'
 Linking CXX executable cmTC_2b790.exe
 "C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_2b790.dir\link.txt --verbose=1
-"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_2b790.dir/objects.a
+"C:\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_2b790.dir/objects.a
 C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_2b790.dir/objects.a @CMakeFiles\cmTC_2b790.dir\objects1.rsp
 C:\DoesNotExist\MinGW\bin\g++.exe  -v    -Wl,--whole-archive CMakeFiles\cmTC_2b790.dir/objects.a -Wl,--no-whole-archive  -o cmTC_2b790.exe -Wl,--out-implib,libcmTC_2b790.dll.a -Wl,--major-image-version,0,--minor-image-version,0
 Using built-in specs.
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index da4d1e5..cb20fb1 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -146,6 +146,12 @@
     "|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:"
     "|Error kstat returned"
     "|Hit xcodebuild bug"
+
+    "|LICENSE WARNING:"
+    "|Your license to use PGI[^\n]*expired"
+    "|Please obtain a new version at"
+    "|contact PGI Sales at"
+
     "|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
     "|[^\n]*is a member of multiple groups"
     "|[^\n]*from Time Machine by path"
@@ -204,5 +210,28 @@
   run_cmake(${test})
 endfunction()
 
+function(ensure_files_match expected_file actual_file)
+  if(NOT EXISTS "${expected_file}")
+    message(FATAL_ERROR "Expected file does not exist:\n  ${expected_file}")
+  endif()
+  if(NOT EXISTS "${actual_file}")
+    message(FATAL_ERROR "Actual file does not exist:\n  ${actual_file}")
+  endif()
+  file(READ "${expected_file}" expected_file_content)
+  file(READ "${actual_file}" actual_file_content)
+  if(NOT "${expected_file_content}" STREQUAL "${actual_file_content}")
+    message(FATAL_ERROR "Actual file content does not match expected:\n
+    \n
+      expected file: ${expected_file}\n
+      expected content:\n
+      ${expected_file_content}\n
+    \n
+      actual file: ${actual_file}\n
+      actual content:\n
+      ${actual_file_content}\n
+    ")
+  endif()
+endfunction()
+
 # Protect RunCMake tests from calling environment.
 unset(ENV{MAKEFLAGS})
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 6d72fac..9a1e027 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -28,6 +28,7 @@
    \* CMP0081
    \* CMP0083
    \* CMP0095
+   \* CMP0099
 
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index bee8c4e..0d462ba 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -1,6 +1,6 @@
 include(RunCMake)
 
-if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
+if(RunCMake_GENERATOR STREQUAL "Xcode")
   run_cmake(ConfigNotAllowed)
 endif()
 
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 44ccd6b..1487161 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -15,6 +15,7 @@
 run_cmake(VsDebuggerCommandArguments)
 run_cmake(VsDebuggerEnvironment)
 run_cmake(VsCSharpCustomTags)
+run_cmake(VsCSharpDocumentationFile)
 run_cmake(VsCSharpReferenceProps)
 run_cmake(VsCSharpWithoutSources)
 run_cmake(VsCSharpDeployFiles)
@@ -28,6 +29,10 @@
 run_cmake(VsPrecompileHeaders)
 run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
 
+set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=$(VCTargetsPath)")
+run_cmake(VsVCTargetsPath)
+unset(RunCMake_GENERATOR_TOOLSET)
+
 if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
   run_cmake(VsJustMyCode)
 endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
new file mode 100644
index 0000000..0393362
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
@@ -0,0 +1,26 @@
+#
+# Check C# VS project for required elements
+#
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+  set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+  return()
+endif()
+
+file(STRINGS "${csProjectFile}" lines)
+
+set(HAVE_DocumentationFile 0)
+foreach(line IN LISTS lines)
+  if(line MATCHES "^ *<DocumentationFile>([^<>]+)</DocumentationFile>")
+    if(HAVE_DocumentationFile)
+      set(RunCMake_TEST_FAILED "Documentation node has been generated more than once for\n  ${csProjectFile}")
+      return()
+    endif()
+    set(HAVE_DocumentationFile 1)
+  endif()
+endforeach()
+
+if(NOT HAVE_DocumentationFile)
+  set(RunCMake_TEST_FAILED "Documentation node has not been generated for\n  ${csProjectFile}")
+  return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
new file mode 100644
index 0000000..83b6b97
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
@@ -0,0 +1,8 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(CSharp)
+
+add_library(foo SHARED
+  foo.cs)
+
+set_target_properties(foo PROPERTIES
+  VS_DOTNET_DOCUMENTATION_FILE foo.xml)
diff --git a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
index 0e7fd45..6a30099 100644
--- a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
@@ -1,44 +1,65 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
-  set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
-  return()
-endif()
-
-set(InsideGlobals FALSE)
-set(DefaultLanguageSet FALSE)
-set(MinimumVisualStudioVersionSet FALSE)
-
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
-  if(line MATCHES "^ *<PropertyGroup Label=\"Globals\"> *$")
-    set(InsideGlobals TRUE)
-  elseif(line MATCHES "^ *<DefaultLanguage>([a-zA-Z\\-]+)</DefaultLanguage> *$")
-    if("${CMAKE_MATCH_1}" STREQUAL "en-US")
-      if(InsideGlobals)
-        message(STATUS "foo.vcxproj has correct DefaultLanguage global property")
-        set(DefaultLanguageSet TRUE)
-      else()
-        message(STATUS "DefaultLanguage is set but not within \"Globals\" property group")
-      endif()
-    endif()
-  elseif(line MATCHES "^ *<MinimumVisualStudioVersion>([0-9\\.]+)</MinimumVisualStudioVersion> *$")
-    if("${CMAKE_MATCH_1}" STREQUAL "14.0")
-      if(InsideGlobals)
-        message(STATUS "foo.vcxproj has correct MinimumVisualStudioVersion global property")
-        set(MinimumVisualStudioVersionSet TRUE)
-      else()
-        message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group")
-      endif()
-    endif()
+macro(check_project_file projectFile)
+  if(NOT EXISTS "${projectFile}")
+    set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+    return()
   endif()
-endforeach()
 
-if(NOT DefaultLanguageSet)
-  set(RunCMake_TEST_FAILED "DefaultLanguageSet not found or not set correctly.")
-  return()
-endif()
+  string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile})
 
-if(NOT MinimumVisualStudioVersionSet)
-  set(RunCMake_TEST_FAILED "MinimumVisualStudioVersionSet not found or not set correctly.")
-  return()
-endif()
+  set(InsideGlobals FALSE)
+  set(DefaultLanguageSet FALSE)
+  set(MinimumVisualStudioVersionSet FALSE)
+  set(TestPropertySet FALSE)
+
+  file(STRINGS "${projectFile}" lines)
+  foreach(line IN LISTS lines)
+    if(line MATCHES "^ *<PropertyGroup Label=\"Globals\"> *$")
+      set(InsideGlobals TRUE)
+    elseif(line MATCHES "^ *<DefaultLanguage>([a-zA-Z\\-]+)</DefaultLanguage> *$")
+      if("${CMAKE_MATCH_1}" STREQUAL "en-US")
+        if(InsideGlobals)
+          message(STATUS "${projectName} has correct DefaultLanguage global property")
+          set(DefaultLanguageSet TRUE)
+        else()
+          message(STATUS "DefaultLanguage is set but not within \"Globals\" property group")
+        endif()
+      endif()
+    elseif(line MATCHES "^ *<MinimumVisualStudioVersion>([0-9\\.]+)</MinimumVisualStudioVersion> *$")
+      if("${CMAKE_MATCH_1}" STREQUAL "10.0")
+        if(InsideGlobals)
+          message(STATUS "${projectName} has correct MinimumVisualStudioVersion global property")
+          set(MinimumVisualStudioVersionSet TRUE)
+        else()
+          message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group")
+        endif()
+      endif()
+    elseif(line MATCHES "^ *<TestProperty>(.+)</TestProperty> *$")
+      if("${CMAKE_MATCH_1}" STREQUAL "TestValue")
+        if(InsideGlobals)
+          message(STATUS "${projectName} has correct TestProperty global property")
+          set(TestPropertySet TRUE)
+        else()
+          message(STATUS "TestProperty is set but not within \"Globals\" property group")
+        endif()
+      endif()
+    endif()
+  endforeach()
+
+  if(NOT DefaultLanguageSet)
+    set(RunCMake_TEST_FAILED "DefaultLanguage not found or not set correctly in ${projectName}.")
+    return()
+  endif()
+
+  if(NOT MinimumVisualStudioVersionSet)
+    set(RunCMake_TEST_FAILED "MinimumVisualStudioVersion not found or not set correctly in ${projectName}.")
+    return()
+  endif()
+
+  if(NOT TestPropertySet)
+    set(RunCMake_TEST_FAILED "TestProperty not found or not set correctly in ${projectName}.")
+    return()
+  endif()
+endmacro()
+
+check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj")
+check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsGlobals.cmake b/Tests/RunCMake/VS10Project/VsGlobals.cmake
index a3ed5af..09d806d 100644
--- a/Tests/RunCMake/VS10Project/VsGlobals.cmake
+++ b/Tests/RunCMake/VS10Project/VsGlobals.cmake
@@ -1,8 +1,9 @@
-enable_language(CXX)
-
 set(CMAKE_VS_GLOBALS
     "DefaultLanguage=en-US"
-    "MinimumVisualStudioVersion=14.0"
+    "MinimumVisualStudioVersion=10.0"
+    "TestProperty=TestValue"
 )
 
+enable_language(CXX)
+
 add_library(foo foo.cpp)
diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake
new file mode 100644
index 0000000..5b1701c
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake
@@ -0,0 +1,32 @@
+macro(check_project_file projectFile)
+  set(insideGlobals FALSE)
+  set(pathFound FALSE)
+
+  if(NOT EXISTS "${projectFile}")
+    set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+    return()
+  endif()
+
+  string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile})
+
+  file(STRINGS "${projectFile}" lines)
+  foreach(line IN LISTS lines)
+    if(line MATCHES "^ *<PropertyGroup Label=\"Globals\">.*$")
+      set(insideGlobals TRUE)
+    elseif(insideGlobals)
+      if(line MATCHES "^ *</PropertyGroup>.*$")
+        set(insideGlobals FALSE)
+      elseif(line MATCHES "^ *<VCTargetsPath>(.+)</VCTargetsPath>*$")
+        message(STATUS "Found VCTargetsPath = ${CMAKE_MATCH_1} in PropertyGroup 'Globals' in ${projectName}")
+        set(pathFound TRUE)
+      endif()
+    endif()
+  endforeach()
+  if(NOT pathFound)
+    set(RunCMake_TEST_FAILED "VCTargetsPath not found in \"Globals\" propertygroup in ${projectName}")
+    return() # This should intentionally return from the caller, not the macro
+  endif()
+endmacro()
+
+check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj")
+check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake
new file mode 100644
index 0000000..6a6088f
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+
+add_library(foo foo.cpp)
diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake
index 7d83a70..c742f50 100644
--- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake
@@ -45,6 +45,7 @@
 check_property("ENVIRONMENT" [=[value="foo"]=])
 check_property("ENVIRONMENT" [=[key="BAR"]=])
 check_property("ENVIRONMENT" [=[value="bar"]=])
+check_property("WORKING_DIRECTORY" [=["/working/dir"]=])
 
 expect_no_schema("NoSchema")
 
diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake
index be219f4..ce5c0c9 100644
--- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake
@@ -35,6 +35,7 @@
 create_scheme_for_property(EXECUTABLE myExecutable)
 create_scheme_for_property(ARGUMENTS "--foo;--bar=baz")
 create_scheme_for_property(ENVIRONMENT "FOO=foo;BAR=bar")
+create_scheme_for_property(WORKING_DIRECTORY "/working/dir")
 
 add_executable(NoSchema main.cpp)
 set_target_properties(NoSchema PROPERTIES XCODE_GENERATE_SCHEME OFF)
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 6877e6a..84d1d66 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -1,6 +1,9 @@
 include(RunCTest)
 set(RunCMake_TEST_TIMEOUT 60)
 
+unset(ENV{CTEST_PARALLEL_LEVEL})
+unset(ENV{CTEST_OUTPUT_ON_FAILURE})
+
 set(CASE_CTEST_TEST_ARGS "")
 set(CASE_CTEST_TEST_LOAD "")
 
@@ -71,7 +74,24 @@
 add_test(NAME FailingTest COMMAND ${CMAKE_COMMAND} -E no_such_command)
   ]])
 
-  unset(ENV{CTEST_PARALLEL_LEVEL})
   run_ctest(TestOutputSize)
 endfunction()
 run_TestOutputSize()
+
+run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3)
+run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1)
+
+function(run_TestRepeat case)
+  set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion ${ARGN})
+  string(CONCAT CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME testRepeat
+  COMMAND ${CMAKE_COMMAND} -D COUNT_FILE=${CMAKE_CURRENT_BINARY_DIR}/count.cmake
+                           -P "]] "${RunCMake_SOURCE_DIR}/TestRepeat${case}" [[.cmake")
+set_property(TEST testRepeat PROPERTY TIMEOUT 5)
+  ]])
+
+  run_ctest(TestRepeat${case})
+endfunction()
+run_TestRepeat(UntilFail REPEAT UNTIL_FAIL:3)
+run_TestRepeat(UntilPass REPEAT UNTIL_PASS:3)
+run_TestRepeat(AfterTimeout REPEAT AFTER_TIMEOUT:3)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt
new file mode 100644
index 0000000..17657c5
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt
@@ -0,0 +1,10 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-build
+    Start 1: testRepeat
+1/1 Test #1: testRepeat .......................\*\*\*Timeout +[0-9.]+ sec
+    Start 1: testRepeat
+    Test #1: testRepeat .......................   Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake
new file mode 100644
index 0000000..abde4f0
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake
@@ -0,0 +1,10 @@
+include("${COUNT_FILE}" OPTIONAL)
+if(NOT COUNT)
+  set(COUNT 0)
+endif()
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
+if(NOT COUNT EQUAL 2)
+  message("this test times out except on the 2nd run")
+  execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
+endif()
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt b/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt
new file mode 100644
index 0000000..37cffbf
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt
@@ -0,0 +1 @@
+Repeat option invalid value: UNKNOWN:3
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt b/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt
new file mode 100644
index 0000000..ca5cef7
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt
@@ -0,0 +1 @@
+Repeat option invalid value: UNTIL_FAIL:-1
diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt
new file mode 100644
index 0000000..5f91a67
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt
@@ -0,0 +1,13 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestRepeatUntilFail-build
+    Start 1: testRepeat
+    Test #1: testRepeat .......................   Passed +[0-9.]+ sec
+    Start 1: testRepeat
+    Test #1: testRepeat .......................\*\*\*Failed +[0-9.]+ sec
++
+0% tests passed, 1 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec
++
+The following tests FAILED:
+[	 ]+1 - testRepeat \(Failed\)$
diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake b/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake
new file mode 100644
index 0000000..5eb0d8a
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake
@@ -0,0 +1,9 @@
+include("${COUNT_FILE}" OPTIONAL)
+if(NOT COUNT)
+  set(COUNT 0)
+endif()
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
+if(COUNT EQUAL 2)
+  message(FATAL_ERROR "this test fails on the 2nd run")
+endif()
diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt
new file mode 100644
index 0000000..bc6939a
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt
@@ -0,0 +1,10 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestRepeatUntilPass-build
+    Start 1: testRepeat
+1/1 Test #1: testRepeat .......................\*\*\*Failed +[0-9.]+ sec
+    Start 1: testRepeat
+    Test #1: testRepeat .......................   Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake b/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake
new file mode 100644
index 0000000..0662522
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake
@@ -0,0 +1,9 @@
+include("${COUNT_FILE}" OPTIONAL)
+if(NOT COUNT)
+  set(COUNT 0)
+endif()
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
+if(NOT COUNT EQUAL 2)
+  message(FATAL_ERROR "this test passes only on the 2nd run")
+endif()
diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake
index 4b74cfe..8f50203 100644
--- a/Tests/RunCMake/foreach/RunCMakeTest.cmake
+++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake
@@ -1,3 +1,14 @@
 include(RunCMake)
 
 run_cmake(BadRangeInFunction)
+run_cmake(foreach-all-test)
+run_cmake(foreach-ITEMS-multiple-iter-vars-test)
+run_cmake(foreach-LISTS-multiple-iter-vars-test)
+run_cmake(foreach-ZIP_LISTS-test)
+run_cmake(foreach-ITEMS-with-ZIP_LISTS-mix-test)
+run_cmake(foreach-LISTS-with-ZIP_LISTS-mix-test)
+run_cmake(foreach-ZIP_LISTS-with-ITEMS-mix-test)
+run_cmake(foreach-ZIP_LISTS-with-LISTS-mix-test)
+run_cmake(foreach-ZIP_LISTS-multiple-iter-vars-test)
+run_cmake(foreach-ZIP_LISTS-iter-vars-mismatch-test-1)
+run_cmake(foreach-ZIP_LISTS-iter-vars-mismatch-test-2)
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-result.txt b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-stderr.txt
new file mode 100644
index 0000000..d174bb1
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ITEMS-multiple-iter-vars-test.cmake:1 \(foreach\):
+  ITEMS or LISTS require exactly one iteration variable
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test.cmake b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test.cmake
new file mode 100644
index 0000000..55d33a8
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test.cmake
@@ -0,0 +1,2 @@
+foreach(one two IN ITEMS one two)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-stderr.txt
new file mode 100644
index 0000000..f7d5ae7
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake:1 \(foreach\):
+  ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake
new file mode 100644
index 0000000..28099a0
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN ITEMS one two three ZIP_LISTS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-result.txt b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-stderr.txt b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-stderr.txt
new file mode 100644
index 0000000..f2f83c2
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-LISTS-multiple-iter-vars-test.cmake:1 \(foreach\):
+  ITEMS or LISTS require exactly one iteration variable
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test.cmake b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test.cmake
new file mode 100644
index 0000000..78f3847
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test.cmake
@@ -0,0 +1,2 @@
+foreach(one two IN LISTS one two)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-stderr.txt
new file mode 100644
index 0000000..42f8d1e
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-LISTS-with-ZIP_LISTS-mix-test.cmake:1 \(foreach\):
+  ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test.cmake
new file mode 100644
index 0000000..8a919dd
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN LISTS one two three ZIP_LISTS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-stderr.txt
new file mode 100644
index 0000000..fa51e46
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake:1 \(foreach\):
+  Expected 3 list variables, but given 4
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake
new file mode 100644
index 0000000..458b6ca
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake
@@ -0,0 +1,2 @@
+foreach(less than lists IN ZIP_LISTS list_1 list_2 list_3 list_4)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-stderr.txt
new file mode 100644
index 0000000..7b6b484
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake:1 \(foreach\):
+  Expected 3 list variables, but given 2
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake
new file mode 100644
index 0000000..d24d99c
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake
@@ -0,0 +1,2 @@
+foreach(greater than lists IN ZIP_LISTS list_1 list_2)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test-stdout.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test-stdout.txt
new file mode 100644
index 0000000..e009d15
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test-stdout.txt
@@ -0,0 +1,6 @@
+-- foreach\(\.\.\. IN ZIP_LISTS\):
+--   Begin output
+--   | one, satu, raz
+--   | two, dua, dva
+--   | three, tiga, tri
+--   End output
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake
new file mode 100644
index 0000000..9647dea
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake
@@ -0,0 +1,42 @@
+function(foreachTest result list_var_1 list_var_2 list_var_3)
+    set(_options MUTE)
+    set(_one_value_args)
+    set(_multi_value_args)
+    cmake_parse_arguments(PARSE_ARGV 3 _arg "${_options}" "${_one_value_args}" "${_multi_value_args}")
+
+    set(_has_any_output FALSE)
+    list(APPEND CMAKE_MESSAGE_INDENT "| ")
+    foreach(first second third IN ZIP_LISTS ${list_var_1} ${list_var_2} ${list_var_3})
+        if(NOT first)
+            set(first "[undefiend]")
+        endif()
+        if(NOT second)
+            set(second "[undefiend]")
+        endif()
+        if(NOT third)
+            set(third "[undefiend]")
+        endif()
+        if(NOT _arg_MUTE)
+            message(STATUS "${first}, ${second}, ${third}")
+        endif()
+        set(_has_any_output TRUE)
+    endforeach()
+    set(${result} ${_has_any_output} PARENT_SCOPE)
+endfunction()
+
+function(foreachTestDecorated list_var_1 list_var_2 list_var_3)
+    list(APPEND CMAKE_MESSAGE_INDENT "  ")
+    message(STATUS "Begin output")
+    foreachTest(_has_any_output ${list_var_1} ${list_var_2} ${list_var_3})
+    if(NOT _has_any_output)
+        message(STATUS "--> empty-output <--")
+    endif()
+    message(STATUS "End output")
+endfunction()
+
+list(APPEND english one two three)
+list(APPEND bahasa satu dua tiga)
+list(APPEND russian raz dva tri)
+
+message(STATUS "foreach(... IN ZIP_LISTS):")
+foreachTestDecorated(english bahasa russian)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt
new file mode 100644
index 0000000..25433fd
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt
@@ -0,0 +1,19 @@
+-- foreach\(IN ZIP_LISTS\):
+--   <<< empty lists case >>>
+--     Begin output
+--     --> empty-output <--
+--     End output
+--   <<< same lengths lists case >>>
+--     Begin output
+--     | one, satu, raz
+--     | two, dua, dva
+--     | three, tiga, tri
+--     End output
+--   <<< different lengths lists case >>>
+--     Begin output
+--     | one, satu, raz
+--     | two, dua, dva
+--     | three, tiga, tri
+--     | \[undefiend\], empat, \[undefiend\]
+--     End output
+--   <<< test variable value restored -- PASSED >>>
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake
new file mode 100644
index 0000000..56cfe64
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake
@@ -0,0 +1,68 @@
+function(foreachTest result list_var_1 list_var_2 list_var_3)
+    set(_options MUTE)
+    set(_one_value_args)
+    set(_multi_value_args)
+    cmake_parse_arguments(PARSE_ARGV 3 _arg "${_options}" "${_one_value_args}" "${_multi_value_args}")
+
+    set(_has_any_output FALSE)
+    list(APPEND CMAKE_MESSAGE_INDENT "| ")
+    foreach(num IN ZIP_LISTS ${list_var_1} ${list_var_2} ${list_var_3})
+        foreach(i RANGE 2)
+            if(NOT num_${i})
+                set(num_${i} "[undefiend]")
+            endif()
+        endforeach()
+        if(NOT _arg_MUTE)
+            message(STATUS "${num_0}, ${num_1}, ${num_2}")
+        endif()
+        set(_has_any_output TRUE)
+    endforeach()
+    set(${result} ${_has_any_output} PARENT_SCOPE)
+endfunction()
+
+function(foreachTestDecorated list_var_1 list_var_2 list_var_3)
+    list(APPEND CMAKE_MESSAGE_INDENT "  ")
+    message(STATUS "Begin output")
+    foreachTest(_has_any_output ${list_var_1} ${list_var_2} ${list_var_3})
+    if(NOT _has_any_output)
+        message(STATUS "--> empty-output <--")
+    endif()
+    message(STATUS "End output")
+endfunction()
+
+message(STATUS "foreach(IN ZIP_LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT "  ")
+
+set(english)
+set(bahasa)
+set(russian)
+
+message(STATUS "<<< empty lists case >>>")
+foreachTestDecorated(english bahasa russian)
+
+list(APPEND english one two three)
+list(APPEND bahasa satu dua tiga)
+list(APPEND russian raz dva tri)
+
+message(STATUS "<<< same lengths lists case >>>")
+foreachTestDecorated(english bahasa russian)
+
+list(APPEND bahasa empat)
+
+message(STATUS "<<< different lengths lists case >>>")
+foreachTestDecorated(english bahasa russian)
+
+set(num_0 "old-0")
+set(num_1 "old-1")
+set(num_2 "old-2")
+foreachTest(_ english bahasa russian MUTE)
+set(check PASSED)
+foreach(i RANGE 2)
+    if(NOT "${num_${i}}" STREQUAL "old-${i}")
+        message(SEND_ERROR "num_${i} value is corrupted")
+        set(check FAILED)
+    endif()
+endforeach()
+message(STATUS "<<< test variable value restored -- ${check} >>>")
+
+list(POP_BACK CMAKE_MESSAGE_INDENT)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-stderr.txt
new file mode 100644
index 0000000..0dcab01
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake:1 \(foreach\):
+  ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake
new file mode 100644
index 0000000..71ed842
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN ZIP_LISTS blah ITEMS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-stderr.txt
new file mode 100644
index 0000000..a6b6e9c
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-with-LISTS-mix-test.cmake:1 \(foreach\):
+  ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test.cmake
new file mode 100644
index 0000000..11a97b2
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN ZIP_LISTS blah LISTS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-all-test-stdout.txt b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt
new file mode 100644
index 0000000..e8f622d
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt
@@ -0,0 +1,44 @@
+-- foreach\(RANGE\):
+--   \[0\.\.1\]/1
+--     < 0
+--     < 1
+--   \[1\.\.1\]/1
+--     < 1
+--   \[0\.\.10\]/2
+--     < 0
+--     < 2
+--     < 4
+--     < 6
+--     < 8
+--     < 10
+--   \[-10\.\.0\]/3
+--     < -10
+--     < -7
+--     < -4
+--     < -1
+--   \[0\.\.-10\]/-5
+--     < 0
+--     < -5
+--     < -10
+-- foreach\(IN ITEMS\):
+--   < one
+--   < two
+--   < three
+-- foreach\(IN LISTS\):
+--   < satu
+--   < dua
+--   < tiga
+-- foreach\(IN LISTS and ITEMS\):
+--   < satu
+--   < dua
+--   < tiga
+--   < one
+--   < two
+--   < three
+-- foreach\(IN ITEMS and LISTS\):
+--   < one
+--   < two
+--   < three
+--   < satu
+--   < dua
+--   < tiga
diff --git a/Tests/RunCMake/foreach/foreach-all-test.cmake b/Tests/RunCMake/foreach/foreach-all-test.cmake
new file mode 100644
index 0000000..2e377c8
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-all-test.cmake
@@ -0,0 +1,67 @@
+message(STATUS "foreach(RANGE):")
+list(APPEND CMAKE_MESSAGE_INDENT "  ")
+
+message(STATUS "[0..1]/1")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i RANGE 1)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[1..1]/1")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i RANGE 1 1)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[0..10]/2")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i RANGE 0 10 2)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[-10..0]/3")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i RANGE -10 0 3)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[0..-10]/-5")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i RANGE 0 -10 -5)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN ITEMS):")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i IN ITEMS one two three)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+list(APPEND count satu dua tiga)
+foreach(i IN LISTS count)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN LISTS and ITEMS):")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i IN LISTS count ITEMS one two three)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN ITEMS and LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT "  < ")
+foreach(i IN ITEMS one two three LISTS count)
+    message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
diff --git a/Tests/RunCMake/load_cache/CMakeLists.txt b/Tests/RunCMake/load_cache/CMakeLists.txt
new file mode 100644
index 0000000..2632ffa
--- /dev/null
+++ b/Tests/RunCMake/load_cache/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/load_cache/NewForm_Project.cmake b/Tests/RunCMake/load_cache/NewForm_Project.cmake
new file mode 100644
index 0000000..13a450b
--- /dev/null
+++ b/Tests/RunCMake/load_cache/NewForm_Project.cmake
@@ -0,0 +1,16 @@
+load_cache(${CMAKE_CURRENT_BINARY_DIR}/../test_project READ_WITH_PREFIX LOAD_CACHE_TEST_
+  CACHE_STRING
+  CACHE_BOOL
+  CACHE_INTERNAL)
+
+if(NOT LOAD_CACHE_TEST_CACHE_STRING STREQUAL "cache string")
+  message(FATAL_ERROR "CACHE_STRING: was ${CACHE_STRING}, expected \"cache string\"")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_BOOL)
+  message(FATAL_ERROR "CACHE_BOOL: was falsey, expected ON")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_INTERNAL STREQUAL "cache internal")
+  message(FATAL_ERROR "CACHE_INTERNAL: was ${CACHE_INTENRAL}, expected \"cache internal\"")
+endif()
diff --git a/Tests/RunCMake/load_cache/NewForm_Script.cmake b/Tests/RunCMake/load_cache/NewForm_Script.cmake
new file mode 100644
index 0000000..f3cee92
--- /dev/null
+++ b/Tests/RunCMake/load_cache/NewForm_Script.cmake
@@ -0,0 +1,16 @@
+load_cache(${RunCMake_BINARY_DIR}/test_project READ_WITH_PREFIX LOAD_CACHE_TEST_
+  CACHE_STRING
+  CACHE_BOOL
+  CACHE_INTERNAL)
+
+if(NOT LOAD_CACHE_TEST_CACHE_STRING STREQUAL "cache string")
+  message(FATAL_ERROR "CACHE_STRING: was ${CACHE_STRING}, expected \"cache string\"")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_BOOL)
+  message(FATAL_ERROR "CACHE_BOOL: was falsey, expected ON")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_INTERNAL STREQUAL "cache internal")
+  message(FATAL_ERROR "CACHE_INTERNAL: was ${CACHE_INTENRAL}, expected \"cache internal\"")
+endif()
diff --git a/Tests/RunCMake/load_cache/OldForm_Script-result.txt b/Tests/RunCMake/load_cache/OldForm_Script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/load_cache/OldForm_Script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/load_cache/OldForm_Script-stderr.txt b/Tests/RunCMake/load_cache/OldForm_Script-stderr.txt
new file mode 100644
index 0000000..9ad5c80
--- /dev/null
+++ b/Tests/RunCMake/load_cache/OldForm_Script-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at.*/Tests/RunCMake/load_cache/OldForm_Script.cmake:1 \(load_cache\):
+  load_cache Only load_cache\(READ_WITH_PREFIX\) may be used in script mode$
diff --git a/Tests/RunCMake/load_cache/OldForm_Script.cmake b/Tests/RunCMake/load_cache/OldForm_Script.cmake
new file mode 100644
index 0000000..9560f61
--- /dev/null
+++ b/Tests/RunCMake/load_cache/OldForm_Script.cmake
@@ -0,0 +1,13 @@
+load_cache(${RunCMake_BINARY_DIR}/test_project INCLUDE_INTERNALS CACHE_INTERNAL)
+
+if(NOT CACHE_STRING STREQUAL "cache string")
+  message(FATAL_ERROR "CACHE_STRING: was ${CACHE_STRING}, expected \"cache string\"")
+endif()
+
+if(NOT CACHE_BOOL)
+  message(FATAL_ERROR "CACHE_BOOL: was falsey, expected ON")
+endif()
+
+if(NOT CACHE_INTERNAL STREQUAL "cache internal")
+  message(FATAL_ERROR "CACHE_INTERNAL: was ${CACHE_INTENRAL}, expected \"cache internal\"")
+endif()
diff --git a/Tests/RunCMake/load_cache/RunCMakeTest.cmake b/Tests/RunCMake/load_cache/RunCMakeTest.cmake
new file mode 100644
index 0000000..a0d54ea
--- /dev/null
+++ b/Tests/RunCMake/load_cache/RunCMakeTest.cmake
@@ -0,0 +1,13 @@
+include(RunCMake)
+
+file(WRITE ${RunCMake_BINARY_DIR}/test_project/CMakeCache.txt [[
+CACHE_STRING:STRING=cache string
+CACHE_BOOL:BOOL=ON
+CACHE_INTERNAL:INTERNAL=cache internal
+]])
+
+run_cmake(NewForm_Project)
+run_cmake_command(NewForm_Script ${CMAKE_COMMAND} -DRunCMake_BINARY_DIR=${RunCMake_BINARY_DIR}
+  -P "${RunCMake_SOURCE_DIR}/NewForm_Script.cmake")
+run_cmake_command(OldForm_Script ${CMAKE_COMMAND} -DRunCMake_BINARY_DIR=${RunCMake_BINARY_DIR}
+  -P "${RunCMake_SOURCE_DIR}/OldForm_Script.cmake")
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake
index 681839d..0313ed1 100644
--- a/Tests/RunCMake/message/RunCMakeTest.cmake
+++ b/Tests/RunCMake/message/RunCMakeTest.cmake
@@ -65,6 +65,11 @@
 endforeach()
 
 run_cmake_command(
+    message-log-level-override
+    ${CMAKE_COMMAND} --log-level=debug -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+  )
+
+run_cmake_command(
     message-indent
     ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent.cmake
   )
@@ -72,3 +77,23 @@
     message-indent-multiline
     ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent-multiline.cmake
   )
+
+run_cmake_command(
+    message-context-cli
+    ${CMAKE_COMMAND} --log-level=trace --log-context -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+  )
+
+run_cmake_command(
+    message-context-cache
+    ${CMAKE_COMMAND} -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -DCMAKE_MESSAGE_CONTEXT_SHOW=ON -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+  )
+
+run_cmake_command(
+    message-context-cli-wins-cache
+    ${CMAKE_COMMAND} --log-level=verbose --log-context -DCMAKE_MESSAGE_CONTEXT_SHOW=OFF -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+  )
+
+run_cmake_command(
+    message-checks
+    ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-checks.cmake
+  )
diff --git a/Tests/RunCMake/message/message-checks-stderr.txt b/Tests/RunCMake/message/message-checks-stderr.txt
new file mode 100644
index 0000000..fdacdb2
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-checks.cmake:13 \(message\):
+  Ignored CHECK_FAIL without CHECK_START
+This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/message/message-checks-stdout.txt b/Tests/RunCMake/message/message-checks-stdout.txt
new file mode 100644
index 0000000..4f5f2ef
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stdout.txt
@@ -0,0 +1,10 @@
+-- Find `libfoo`
+-- Looking for `libfoo\.h`
+-- Looking for `libfoo\.h` - found \[/usr/include\]
+-- Looking for `libfoo\.so`
+-- Looking for `libfoo\.so` - found \[/usr/lib/libfoo\.so\]
+-- Getting `libfoo` version
+-- Looking for `libfoo/version\.h`
+-- Looking for `libfoo/version\.h` - found
+-- Getting `libfoo` version - 1\.2\.3
+-- Find `libfoo` - required version 4\.5\.6 but found 1\.2\.3
diff --git a/Tests/RunCMake/message/message-checks.cmake b/Tests/RunCMake/message/message-checks.cmake
new file mode 100644
index 0000000..605846e
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks.cmake
@@ -0,0 +1,13 @@
+message(CHECK_START "Find `libfoo`")
+message(CHECK_START "Looking for `libfoo.h`")
+message(CHECK_PASS "found [/usr/include]")
+message(CHECK_START "Looking for `libfoo.so`")
+message(CHECK_PASS "found [/usr/lib/libfoo.so]")
+message(CHECK_START "Getting `libfoo` version")
+message(CHECK_START "Looking for `libfoo/version.h`")
+message(CHECK_PASS "found")
+message(CHECK_PASS "1.2.3")
+message(CHECK_FAIL "required version 4.5.6 but found 1.2.3")
+
+# Should generate an error, no associated CHECK_START
+message(CHECK_FAIL "unmatched check fail case")
diff --git a/Tests/RunCMake/message/message-context-cache-stdout.txt b/Tests/RunCMake/message/message-context-cache-stdout.txt
new file mode 100644
index 0000000..af18c15
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cache-stdout.txt
@@ -0,0 +1,8 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\.foo\] foo TRACE message
+-- \[top\.foo\.baz\] This is the multi-line
+\[top\.foo\.baz\] baz DEBUG message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context-cli-stdout.txt b/Tests/RunCMake/message/message-context-cli-stdout.txt
new file mode 100644
index 0000000..af18c15
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cli-stdout.txt
@@ -0,0 +1,8 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\.foo\] foo TRACE message
+-- \[top\.foo\.baz\] This is the multi-line
+\[top\.foo\.baz\] baz DEBUG message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt
new file mode 100644
index 0000000..157db97
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt
@@ -0,0 +1,5 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context.cmake b/Tests/RunCMake/message/message-context.cmake
new file mode 100644
index 0000000..93d4cd9
--- /dev/null
+++ b/Tests/RunCMake/message/message-context.cmake
@@ -0,0 +1,27 @@
+function(bar)
+    list(APPEND CMAKE_MESSAGE_CONTEXT "bar")
+    list(APPEND CMAKE_MESSAGE_INDENT "<-- indent -->")
+    message(VERBOSE "bar VERBOSE message")
+endfunction()
+
+function(baz)
+    list(APPEND CMAKE_MESSAGE_CONTEXT "baz")
+    message(DEBUG "This is the multi-line\nbaz DEBUG message")
+endfunction()
+
+function(foo)
+    list(APPEND CMAKE_MESSAGE_CONTEXT "foo")
+    bar()
+    message(TRACE "foo TRACE message")
+    baz()
+endfunction()
+
+message(STATUS "Begin context output test")
+list(APPEND CMAKE_MESSAGE_CONTEXT "top")
+
+message(STATUS "Top: before")
+foo()
+message(STATUS "Top: after")
+
+list(POP_BACK CMAKE_MESSAGE_CONTEXT)
+message(STATUS "End of context output test")
diff --git a/Tests/RunCMake/message/message-log-level-debug-stdout.txt b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
index 1452137..feee110 100644
--- a/Tests/RunCMake/message/message-log-level-debug-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
@@ -1,3 +1,3 @@
 -- STATUS message
 -- VERBOSE message
--- DEBUG message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-log-level-default-stdout.txt b/Tests/RunCMake/message/message-log-level-default-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-log-level-default-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-default-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-log-level-override-stderr.txt b/Tests/RunCMake/message/message-log-level-override-stderr.txt
new file mode 100644
index 0000000..efec736
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-override-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:2 \(message\):
+  Deprecation warning
++
+CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:3 \(message\):
+  Author warning message
+This warning is for project developers\.  Use -Wno-dev to suppress it\.
++
+CMake Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:4 \(message\):
+  Warning message
++
+Default NOTICE message
+NOTICE message$
diff --git a/Tests/RunCMake/message/message-log-level-override-stdout.txt b/Tests/RunCMake/message/message-log-level-override-stdout.txt
new file mode 100644
index 0000000..feee110
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-override-stdout.txt
@@ -0,0 +1,3 @@
+-- STATUS message
+-- VERBOSE message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-log-level-status-stdout.txt b/Tests/RunCMake/message/message-log-level-status-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-log-level-status-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-status-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-log-level-trace-stdout.txt b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
index 1cfce6f..3d36a7f 100644
--- a/Tests/RunCMake/message/message-log-level-trace-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
@@ -1,4 +1,4 @@
 -- STATUS message
 -- VERBOSE message
 -- DEBUG message
--- TRACE message
+-- TRACE message$
diff --git a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
index c15d43f..47c0846 100644
--- a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
@@ -1,2 +1,2 @@
 -- STATUS message
--- VERBOSE message
+-- VERBOSE message$
diff --git a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
index 1452137..feee110 100644
--- a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
@@ -1,3 +1,3 @@
 -- STATUS message
 -- VERBOSE message
--- DEBUG message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-loglevel-default-stdout.txt b/Tests/RunCMake/message/message-loglevel-default-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-loglevel-default-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-default-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-loglevel-status-stdout.txt b/Tests/RunCMake/message/message-loglevel-status-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-loglevel-status-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-status-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
index 1cfce6f..3d36a7f 100644
--- a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
@@ -1,4 +1,4 @@
 -- STATUS message
 -- VERBOSE message
 -- DEBUG message
--- TRACE message
+-- TRACE message$
diff --git a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
index c15d43f..47c0846 100644
--- a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
@@ -1,2 +1,2 @@
 -- STATUS message
--- VERBOSE message
+-- VERBOSE message$
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-check.cmake b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-check.cmake
new file mode 100644
index 0000000..2fffddd
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "DIR_INTERFACE")
+  string (APPEND RunCMake_TEST_FAILED "\nNot found expected 'DIR_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-result.txt b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-NEW.cmake b/Tests/RunCMake/target_link_directories/CMP0099-NEW.cmake
new file mode 100644
index 0000000..17dd68e
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 NEW)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-check.cmake b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-check.cmake
new file mode 100644
index 0000000..16573a7
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (actual_stdout MATCHES "DIR_INTERFACE")
+  string (APPEND RunCMake_TEST_FAILED "\nFound unexpected 'DIR_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-result.txt b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-OLD.cmake b/Tests/RunCMake/target_link_directories/CMP0099-OLD.cmake
new file mode 100644
index 0000000..193a4c7
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 OLD)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_directories/CMP0099.cmake b/Tests/RunCMake/target_link_directories/CMP0099.cmake
new file mode 100644
index 0000000..a2be279
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099.cmake
@@ -0,0 +1,14 @@
+
+enable_language(C)
+
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+
+add_library(LinkDirs_interface INTERFACE)
+target_link_directories (LinkDirs_interface INTERFACE "/DIR_INTERFACE"})
+
+add_library(LinkDirs_static STATIC lib.c)
+target_link_libraries (LinkDirs_static PRIVATE LinkDirs_interface)
+
+add_executable(LinkDirs_exe exe.c)
+target_link_libraries (LinkDirs_exe PRIVATE LinkDirs_static)
diff --git a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
index b67c598..a74ee25 100644
--- a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
@@ -1,3 +1,33 @@
 include(RunCMake)
 
+macro(run_cmake_target test subtest target)
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+  unset(RunCMake_TEST_BINARY_DIR)
+  unset(RunCMake_TEST_NO_CLEAN)
+endmacro()
+
 run_cmake(empty_keyword_args)
+
+if(RunCMake_GENERATOR MATCHES "(Ninja|Makefiles)" AND
+    NOT RunCMake_GENERATOR MATCHES "(NMake|Borland)")
+  set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+  if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+    set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+  endif()
+  if (RunCMake_GENERATOR MATCHES "Ninja")
+    set(VERBOSE -- -v)
+  endif()
+
+  run_cmake(CMP0099-NEW)
+  run_cmake_target(CMP0099-NEW basic LinkDirs_exe ${VERBOSE})
+
+
+  run_cmake(CMP0099-OLD)
+  run_cmake_target(CMP0099-OLD basic LinkDirs_exe ${VERBOSE})
+
+  unset(RunCMake_TEST_OPTIONS)
+  unset(RunCMake_TEST_OUTPUT_MERGE)
+endif()
diff --git a/Tests/RunCMake/target_link_directories/exe.c b/Tests/RunCMake/target_link_directories/exe.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/exe.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+  return 0;
+}
diff --git a/Tests/RunCMake/target_link_directories/lib.c b/Tests/RunCMake/target_link_directories/lib.c
new file mode 100644
index 0000000..9bbd24c
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/lib.c
@@ -0,0 +1,7 @@
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+  int flags_lib(void)
+{
+  return 0;
+}
diff --git a/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-check.cmake b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-check.cmake
new file mode 100644
index 0000000..555bc37
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "BADFLAG_INTERFACE")
+  string (APPEND RunCMake_TEST_FAILED "\nNot found expected 'BADFLAG_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-result.txt b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/CMP0099-NEW.cmake b/Tests/RunCMake/target_link_options/CMP0099-NEW.cmake
new file mode 100644
index 0000000..17dd68e
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 NEW)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-check.cmake b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-check.cmake
new file mode 100644
index 0000000..4f159f1
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (actual_stdout MATCHES "BADFLAG_INTERFACE")
+  string (APPEND RunCMake_TEST_FAILED "\nFound unexpected 'BADFLAG_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-result.txt b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/CMP0099-OLD.cmake b/Tests/RunCMake/target_link_options/CMP0099-OLD.cmake
new file mode 100644
index 0000000..193a4c7
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 OLD)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_options/CMP0099.cmake b/Tests/RunCMake/target_link_options/CMP0099.cmake
new file mode 100644
index 0000000..9dee964
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099.cmake
@@ -0,0 +1,16 @@
+
+enable_language(C)
+
+set(obj "${CMAKE_C_OUTPUT_EXTENSION}")
+if(BORLAND)
+  set(pre -)
+endif()
+
+add_library(LinkOptions_interface INTERFACE)
+target_link_options (LinkOptions_interface INTERFACE ${pre}BADFLAG_INTERFACE${obj})
+
+add_library(LinkOptions_static STATIC LinkOptionsLib.c)
+target_link_libraries (LinkOptions_static PRIVATE LinkOptions_interface)
+
+add_executable(LinkOptions_exe LinkOptionsExe.c)
+target_link_libraries (LinkOptions_exe PRIVATE LinkOptions_static)
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
index 1d9ef8b..cdfdd7b 100644
--- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
@@ -41,3 +41,21 @@
 endif()
 
 run_cmake(empty_keyword_args)
+
+if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
+  # Intel compiler does not reject bad flags or objects!
+  set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+  if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+    set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+  endif()
+
+  run_cmake(CMP0099-NEW)
+  run_cmake_target(CMP0099-NEW basic LinkOptions_exe)
+
+
+  run_cmake(CMP0099-OLD)
+  run_cmake_target(CMP0099-OLD basic LinkOptions_exe)
+
+  unset(RunCMake_TEST_OPTIONS)
+  unset(RunCMake_TEST_OUTPUT_MERGE)
+endif()
diff --git a/Tests/StagingPrefix/CMakeLists.txt b/Tests/StagingPrefix/CMakeLists.txt
index 8d2519e..9ed5c12 100644
--- a/Tests/StagingPrefix/CMakeLists.txt
+++ b/Tests/StagingPrefix/CMakeLists.txt
@@ -5,7 +5,7 @@
 # Wipe out the install tree
 add_custom_command(
   OUTPUT ${CMAKE_BINARY_DIR}/CleanupProject
-  COMMAND ${CMAKE_COMMAND} -E remove_directory
+  COMMAND ${CMAKE_COMMAND} -E rm -rf
     ${CMAKE_BINARY_DIR}/ConsumerBuild
     ${CMAKE_BINARY_DIR}/ProducerBuild
     ${CMAKE_BINARY_DIR}/stage
diff --git a/Tests/SubDir/Examples/example1/CMakeLists.txt b/Tests/SubDir/Examples/example1/CMakeLists.txt
index 20d065e..8ec1c02 100644
--- a/Tests/SubDir/Examples/example1/CMakeLists.txt
+++ b/Tests/SubDir/Examples/example1/CMakeLists.txt
@@ -3,5 +3,5 @@
 add_executable(example1 example1.cxx)
 
 add_custom_command(TARGET example1 POST_BUILD
-  COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere
+  COMMAND "${CMAKE_COMMAND}" ARGS -E rm -f ${SUBDIR_BINARY_DIR}/ShouldBeHere
   COMMENT "Remove marker file that should exist because this should not be run")
diff --git a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt
index 20d065e..8ec1c02 100644
--- a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt
+++ b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt
@@ -3,5 +3,5 @@
 add_executable(example1 example1.cxx)
 
 add_custom_command(TARGET example1 POST_BUILD
-  COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere
+  COMMAND "${CMAKE_COMMAND}" ARGS -E rm -f ${SUBDIR_BINARY_DIR}/ShouldBeHere
   COMMENT "Remove marker file that should exist because this should not be run")
diff --git a/Tests/VSMidl/CMakeLists.txt b/Tests/VSMidl/CMakeLists.txt
index 432506c..3ff7c27 100644
--- a/Tests/VSMidl/CMakeLists.txt
+++ b/Tests/VSMidl/CMakeLists.txt
@@ -56,8 +56,8 @@
 #
 ExternalProject_Add(clean-${PROJECT_NAME}
   DOWNLOAD_COMMAND ""
-  CONFIGURE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${source_dir}"
-  BUILD_COMMAND ${CMAKE_COMMAND} -E remove_directory "${binary_dir}"
+  CONFIGURE_COMMAND ${CMAKE_COMMAND} -E rm -rf "${source_dir}"
+  BUILD_COMMAND ${CMAKE_COMMAND} -E rm -rf "${binary_dir}"
   INSTALL_COMMAND ""
   )
 
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index 0564540..22a3d5a 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -13,7 +13,7 @@
   endif()
   add_custom_command(
     OUTPUT ${dir}.stamp
-    COMMAND cmake -E remove_directory ${dir}
+    COMMAND cmake -E rm -rf ${dir}
     COMMAND cmake -E tar xf ${CMAKE_DOC_TARBALL}
     COMMAND cmake -E touch ${dir}.stamp
     DEPENDS ${CMAKE_DOC_TARBALL}
diff --git a/Utilities/GitSetup/setup-user b/Utilities/GitSetup/setup-user
index 1af439c..0b98879 100755
--- a/Utilities/GitSetup/setup-user
+++ b/Utilities/GitSetup/setup-user
@@ -20,12 +20,12 @@
 # Project configuration instructions: NONE
 
 for (( ; ; )); do
-	user_name=$(git config user.name || echo '') &&
-	user_email=$(git config user.email || echo '') &&
-	if test -n "$user_name" -a -n "$user_email"; then
+	ident="$(git var GIT_AUTHOR_IDENT 2>/dev/null | rev | cut -d' ' -f3- | rev)"
+
+	if test -n "$ident"; then
 		echo 'Your commits will record as Author:
 
-  '"$user_name <$user_email>"'
+  '"$ident"'
 ' &&
 		read -ep 'Is the author name and email address above correct? [Y/n] ' correct &&
 		if test "$correct" != "n" -a "$correct" != "N"; then
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index ef31e8b..3497b53 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/Utilities/IWYU/mapping.imp
@@ -24,6 +24,7 @@
   { include: [ "<bits/shared_ptr.h>", private, "<memory>", public ] },
   { include: [ "<bits/std_function.h>", private, "<functional>", public ] },
   { include: [ "<bits/refwrap.h>", private, "<functional>", public ] },
+  { include: [ "<bits/std_abs.h>", private, "<stdlib.h>", public ] },
   { include: [ "<bits/stdint-intn.h>", private, "<stdint.h>", public ] },
   { include: [ "<bits/stdint-uintn.h>", private, "<stdint.h>", public ] },
   { include: [ "<bits/time.h>", private, "<time.h>", public ] },
@@ -46,6 +47,8 @@
   # HACK: iwyu suggests <ext/alloc_traits.h> and <memory> each time vector[] is used.
   # https://github.com/include-what-you-use/include-what-you-use/issues/166
   { include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] },
+  { symbol: [ "std::allocator_traits<std::allocator<cmFileLock> >::value_type", private, "<vector>", public ] },
+  { symbol: [ "std::allocator_traits<std::allocator<cmFileLockPool::ScopePool> >::value_type", private, "<vector>", public ] },
   { symbol: [ "std::allocator_traits<std::allocator<cmComputeComponentGraph::TarjanEntry> >::value_type", private, "<vector>", public ] },
   { symbol: [ "std::allocator_traits<std::allocator<cmFortranFile> >::value_type", private, "<vector>", public ] },
   { symbol: [ "std::allocator_traits<std::allocator<cmGraphEdgeList> >::value_type", private, "<vector>", public ] },
diff --git a/Utilities/Release/push.bash b/Utilities/Release/push.bash
index 1c8efe9..a1c6651 100755
--- a/Utilities/Release/push.bash
+++ b/Utilities/Release/push.bash
@@ -50,6 +50,9 @@
     dir="v${version}"
 fi
 readonly dir
+if ! test -d "${dest}/${dir}"; then
+    mkdir "${dest}/${dir}"
+fi
 
 for f in cmake-${version}*; do
     if ! test -f "${f}"; then
diff --git a/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in b/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in
index db8e536..5178fd8 100644
--- a/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in
+++ b/Utilities/cmcurl/CMake/cmake_uninstall.cmake.in
@@ -13,7 +13,7 @@
   message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
   if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
     exec_program(
-      "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+      "@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\""
       OUTPUT_VARIABLE rm_out
       RETURN_VALUE rm_retval
       )
diff --git a/Utilities/std/.gitattributes b/Utilities/std/.gitattributes
index cd20549..789a754 100644
--- a/Utilities/std/.gitattributes
+++ b/Utilities/std/.gitattributes
@@ -1 +1,2 @@
 cm/* our-c-style
+cmext/* our-c-style
diff --git a/Utilities/std/cm/type_traits b/Utilities/std/cm/type_traits
new file mode 100644
index 0000000..6d7a2c0
--- /dev/null
+++ b/Utilities/std/cm/type_traits
@@ -0,0 +1,46 @@
+// -*-c++-*-
+// vim: set ft=cpp:
+
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cm_type_traits
+#define cm_type_traits
+
+#include <type_traits> // IWYU pragma: export
+
+namespace cm {
+
+#if __cplusplus >= 201402L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
+
+// Miscellaneous transformations
+template <bool B, typename T = void>
+using enable_if_t = std::enable_if_t<B, T>;
+
+#else
+
+// Miscellaneous transformations
+template <bool B, typename T = void>
+using enable_if_t = typename std::enable_if<B, T>::type;
+
+#endif
+
+#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703)
+
+// Miscellaneous transformations
+using std::invoke_result;
+using std::invoke_result_t;
+
+#else
+
+// Miscellaneous transformations
+template <typename F, typename... ArgTypes>
+using invoke_result = std::result_of<F(ArgTypes...)>;
+
+template <class F, typename... ArgTypes>
+using invoke_result_t = typename invoke_result<F, ArgTypes...>::type;
+
+#endif
+
+} // namespace cm
+
+#endif
diff --git a/Utilities/std/cmext/memory b/Utilities/std/cmext/memory
new file mode 100644
index 0000000..540a3de
--- /dev/null
+++ b/Utilities/std/cmext/memory
@@ -0,0 +1,32 @@
+// -*-c++-*-
+// vim: set ft=cpp:
+
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file Copyright.txt or https://cmake.org/licensing for details.  */
+#ifndef cmext_memory
+#define cmext_memory
+
+#include <cm/type_traits>
+
+namespace cm {
+
+template <typename T, typename O,
+          cm::enable_if_t<
+            std::is_pointer<cm::invoke_result_t<decltype(&O::get), O>>::value,
+            int> = 0>
+T& static_reference_cast(O& item)
+{
+  return *(static_cast<T*>(item.get()));
+}
+template <typename T, typename O,
+          cm::enable_if_t<
+            std::is_pointer<cm::invoke_result_t<decltype(&O::get), O>>::value,
+            int> = 0>
+T& dynamic_reference_cast(O& item)
+{
+  return *(dynamic_cast<T*>(item.get()));
+}
+
+} // namespace cm
+
+#endif
diff --git a/bootstrap b/bootstrap
index 1f8eaa5..6e89589 100755
--- a/bootstrap
+++ b/bootstrap
@@ -294,6 +294,7 @@
   cmCreateTestSourceList \
   cmCustomCommand \
   cmCustomCommandGenerator \
+  cmCustomCommandLines \
   cmDefinePropertyCommand \
   cmDefinitions \
   cmDepends \
@@ -372,6 +373,7 @@
   cmLDConfigTool \
   cmLinkDirectoriesCommand \
   cmLinkItem \
+  cmLinkItemGraphVisitor \
   cmLinkLineComputer \
   cmLinkLineDeviceComputer \
   cmListCommand \
diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
index d81f62a..b5fc700 100644
--- a/cmake_uninstall.cmake.in
+++ b/cmake_uninstall.cmake.in
@@ -8,7 +8,7 @@
   message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
   if(EXISTS "$ENV{DESTDIR}${file}")
     exec_program(
-      "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+      "@CMAKE_COMMAND@" ARGS "-E rm -f \"$ENV{DESTDIR}${file}\""
       OUTPUT_VARIABLE rm_out
       RETURN_VALUE rm_retval
       )