Merge topic 'doc-EXCLUDE_FROM_ALL'

e262123fee Help: Clarify the effect of EXCLUDE_FROM_ALL on target installation
a09195e7bf Help: Rename 'artefact' to 'artifact' in target_precompile_headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4840
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e7440f2..cf7cb26 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,7 +14,7 @@
     - when: never
 
 .fedora31: &fedora31
-    image: "kitware/cmake:ci-fedora31-x86_64-2020-05-08"
+    image: "kitware/cmake:ci-fedora31-x86_64-2020-06-01"
 
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -57,6 +57,14 @@
         CMAKE_CONFIGURATION: fedora31_ninja
         CTEST_NO_WARNINGS_ALLOWED: 1
 
+.fedora31_ninja_multi: &fedora31_ninja_multi
+    extends: .fedora31
+
+    variables:
+        CMAKE_CONFIGURATION: fedora31_ninja_multi
+        CTEST_NO_WARNINGS_ALLOWED: 1
+        CMAKE_GENERATOR: "Ninja Multi-Config"
+
 .fedora31_makefiles: &fedora31_makefiles
     extends: .fedora31
 
@@ -297,6 +305,20 @@
 
     interruptible: true
 
+.cmake_test_unix_external: &cmake_test_unix_external
+    stage: test-ext
+
+    script:
+        - *before_script_unix
+        - .gitlab/ci/sccache.sh
+        # Allow the server to already be running.
+        - "sccache --start-server || :"
+        - sccache --show-stats
+        - "$LAUNCHER build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake"
+        - sccache --show-stats
+
+    interruptible: true
+
 .cmake_test_windows_external: &cmake_test_windows_external
     stage: test-ext
 
@@ -321,7 +343,7 @@
     <<:
         - *fedora31_tidy
         - *cmake_build_unix
-        - *linux_builder_tags
+        - *linux_builder_tags_qt
     rules: *rules_settings
 
 build:fedora31-sphinx:
@@ -336,7 +358,7 @@
         - *fedora31_ninja
         - *cmake_build_unix
         - *cmake_build_artifacts
-        - *linux_builder_tags
+        - *linux_builder_tags_qt
     rules: *manual_rules_settings
 
 test:fedora31-ninja:
@@ -344,18 +366,30 @@
         - *fedora31_ninja
         - *cmake_test_unix
         - *linux_builder_tags_qt
+        - *cmake_test_artifacts
     rules: *rules_settings
     dependencies:
         - build:fedora31-ninja
     needs:
         - build:fedora31-ninja
 
+test:fedora31-ninja-multi:
+    <<:
+        - *fedora31_ninja_multi
+        - *cmake_test_unix_external
+        - *linux_builder_tags_qt
+    rules: *rules_settings
+    dependencies:
+        - test:fedora31-ninja
+    needs:
+        - test:fedora31-ninja
+
 build:fedora31-makefiles:
     <<:
         - *fedora31_makefiles
         - *cmake_build_unix
         - *cmake_build_artifacts
-        - *linux_builder_tags
+        - *linux_builder_tags_qt
     rules: *manual_rules_settings
 
 test:fedora31-makefiles:
diff --git a/.gitlab/ci/configure_fedora31_common.cmake b/.gitlab/ci/configure_fedora31_common.cmake
new file mode 100644
index 0000000..dc068d5
--- /dev/null
+++ b/.gitlab/ci/configure_fedora31_common.cmake
@@ -0,0 +1,4 @@
+set(BUILD_CursesDialog ON CACHE BOOL "")
+set(BUILD_QtDialog ON CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_fedora31_makefiles.cmake b/.gitlab/ci/configure_fedora31_makefiles.cmake
index 33f0db0..74768b7 100644
--- a/.gitlab/ci/configure_fedora31_makefiles.cmake
+++ b/.gitlab/ci/configure_fedora31_makefiles.cmake
@@ -1 +1 @@
-include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora31_common.cmake")
diff --git a/.gitlab/ci/configure_fedora31_ninja.cmake b/.gitlab/ci/configure_fedora31_ninja.cmake
index 33f0db0..74768b7 100644
--- a/.gitlab/ci/configure_fedora31_ninja.cmake
+++ b/.gitlab/ci/configure_fedora31_ninja.cmake
@@ -1 +1 @@
-include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora31_common.cmake")
diff --git a/.gitlab/ci/configure_fedora31_ninja_multi.cmake b/.gitlab/ci/configure_fedora31_ninja_multi.cmake
new file mode 100644
index 0000000..20863a2
--- /dev/null
+++ b/.gitlab/ci/configure_fedora31_ninja_multi.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora31_tidy.cmake b/.gitlab/ci/configure_fedora31_tidy.cmake
index f41ad82..55d022c 100644
--- a/.gitlab/ci/configure_fedora31_tidy.cmake
+++ b/.gitlab/ci/configure_fedora31_tidy.cmake
@@ -1,3 +1,3 @@
 set(CMake_RUN_CLANG_TIDY ON CACHE BOOL "")
 
-include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora31_common.cmake")
diff --git a/.gitlab/ci/docker/fedora31/install_deps.sh b/.gitlab/ci/docker/fedora31/install_deps.sh
index bcb1564..0d857c1 100755
--- a/.gitlab/ci/docker/fedora31/install_deps.sh
+++ b/.gitlab/ci/docker/fedora31/install_deps.sh
@@ -1,8 +1,10 @@
 #!/bin/sh
 
 # Install build requirements.
-dnf install -y \
-    openssl-devel
+dnf install --setopt=install_weak_deps=False -y \
+    ncurses-devel \
+    openssl-devel \
+    qt5-qtbase-devel
 
 # Install development tools.
 dnf install --setopt=install_weak_deps=False -y \
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index 0a7d7e1..e073228 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -1,8 +1,15 @@
 add_executable
 --------------
 
+.. only:: html
+
+  .. contents::
+
 Add an executable to the project using the specified source files.
 
+Normal Executables
+^^^^^^^^^^^^^^^^^^
+
 .. code-block:: cmake
 
   add_executable(<name> [WIN32] [MACOSX_BUNDLE]
@@ -45,7 +52,8 @@
 pre-processed, and you want to have the original sources reachable from
 within IDE.
 
---------------------------------------------------------------------------
+Imported Executables
+^^^^^^^^^^^^^^^^^^^^
 
 .. code-block:: cmake
 
@@ -65,7 +73,8 @@
 the main executable file on disk.  See documentation of the ``IMPORTED_*``
 properties for more information.
 
---------------------------------------------------------------------------
+Alias Executables
+^^^^^^^^^^^^^^^^^
 
 .. code-block:: cmake
 
@@ -74,8 +83,13 @@
 Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can
 be used to refer to ``<target>`` in subsequent commands.  The ``<name>``
 does not appear in the generated buildsystem as a make target.  The
-``<target>`` may not be a non-``GLOBAL``
-:ref:`Imported Target <Imported Targets>` or an ``ALIAS``.
+``<target>`` may not be an ``ALIAS``.
+
+An ``ALIAS`` to a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`
+has scope in the directory in which the alias is created and below.
+The :prop_tgt:`ALIAS_GLOBAL` target property can be used to check if the
+alias is global or not.
+
 ``ALIAS`` targets can be used as targets to read properties
 from, executables for custom commands and custom targets.  They can also be
 tested for existence with the regular :command:`if(TARGET)` subcommand.
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 7274e44..01c415a 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -139,8 +139,13 @@
 Creates an :ref:`Alias Target <Alias Targets>`, such that ``<name>`` can be
 used to refer to ``<target>`` in subsequent commands.  The ``<name>`` does
 not appear in the generated buildsystem as a make target.  The ``<target>``
-may not be a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>` or an
-``ALIAS``.
+may not be an ``ALIAS``.
+
+An ``ALIAS`` to a non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`
+has scope in the directory in which the alias is created and below.
+The :prop_tgt:`ALIAS_GLOBAL` target property can be used to check if the
+alias is global or not.
+
 ``ALIAS`` targets can be used as linkable targets and as targets to
 read properties from.  They can also be tested for existence with the
 regular :command:`if(TARGET)` subcommand.  The ``<name>`` may not be used
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 8d41ed8..e98038a 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@
 .. toctree::
    :maxdepth: 1
 
+   CMP0108: A target cannot link to itself through an alias. </policy/CMP0108>
    CMP0107: An ALIAS target cannot overwrite another target. </policy/CMP0107>
    CMP0106: The Documentation module is removed. </policy/CMP0106>
    CMP0105: Device link step uses the link options. </policy/CMP0105>
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index a68170a..7f7ed50 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -105,6 +105,7 @@
 
    /prop_tgt/ADDITIONAL_CLEAN_FILES
    /prop_tgt/AIX_EXPORT_ALL_SYMBOLS
+   /prop_tgt/ALIAS_GLOBAL
    /prop_tgt/ALIASED_TARGET
    /prop_tgt/ANDROID_ANT_ADDITIONAL_OPTIONS
    /prop_tgt/ANDROID_API
diff --git a/Help/policy/CMP0108.rst b/Help/policy/CMP0108.rst
new file mode 100644
index 0000000..0d54cfa
--- /dev/null
+++ b/Help/policy/CMP0108.rst
@@ -0,0 +1,19 @@
+CMP0108
+-------
+
+A target is not allowed to link to itself even through an ``ALIAS`` target.
+
+In CMake 3.17 and below, a target can link to a target aliased to itself.
+
+The ``OLD`` behavior for this policy is to allow a target to link to a target
+aliased to itself.
+
+The ``NEW`` behavior of this policy is to prevent a target to link to itself
+through an ``ALIAS`` target.
+
+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/ALIAS_GLOBAL.rst b/Help/prop_tgt/ALIAS_GLOBAL.rst
new file mode 100644
index 0000000..8854f57
--- /dev/null
+++ b/Help/prop_tgt/ALIAS_GLOBAL.rst
@@ -0,0 +1,17 @@
+ALIAS_GLOBAL
+------------
+
+Read-only property indicating of whether an :ref:`ALIAS target <Alias Targets>`
+is globally visible.
+
+The boolean value of this property is ``TRUE`` for aliases to
+:ref:`IMPORTED targets <Imported Targets>` created
+with the ``GLOBAL`` options to :command:`add_executable()` or
+:command:`add_library()`, ``FALSE`` otherwise. It is undefined for
+targets built within the project.
+
+.. note::
+
+  Promoting an :ref:`IMPORTED target <Imported Targets>` from ``LOCAL``
+  to ``GLOBAL`` scope by changing the value or :prop_tgt:`IMPORTED_GLOBAL`
+  target property do not change the scope of local aliases.
diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst
index e7f7904..6a05139 100644
--- a/Help/prop_tgt/C_STANDARD.rst
+++ b/Help/prop_tgt/C_STANDARD.rst
@@ -6,8 +6,8 @@
 This property specifies the C standard whose features are requested
 to build this target.  For some compilers, this results in adding a
 flag such as ``-std=gnu11`` to the compile line.  For compilers that
-have no notion of a standard level, such as Microsoft Visual C++ before
-2015 Update 3, this has no effect.
+have no notion of a C standard level, such as all versions of
+MSVC known as of this version of CMake, this has no effect.
 
 Supported values are ``90``, ``99`` and ``11``.
 
diff --git a/Help/prop_tgt/IMPORTED_GLOBAL.rst b/Help/prop_tgt/IMPORTED_GLOBAL.rst
index 1feca04..1a9129f 100644
--- a/Help/prop_tgt/IMPORTED_GLOBAL.rst
+++ b/Help/prop_tgt/IMPORTED_GLOBAL.rst
@@ -16,7 +16,15 @@
 target to global scope. This promotion can only be done in the same
 directory where that ``IMPORTED`` target was created in the first place.
 
-Once an imported target has been made global, it cannot be changed back to
-non-global. Therefore, if a project sets this property, it may only
-provide a value of True. CMake will issue an error if the project tries to
-set the property to a non-True value, even if the value was already False.
+.. note::
+
+  Once an imported target has been made global, it cannot be changed back to
+  non-global. Therefore, if a project sets this property, it may only
+  provide a value of True. CMake will issue an error if the project tries to
+  set the property to a non-True value, even if the value was already False.
+
+.. note::
+
+  Local :ref:`ALIAS targets <Alias Targets>` created before promoting an
+  :ref:`IMPORTED target <Imported Targets>` from ``LOCAL`` to ``GLOBAL``, keep
+  their initial scope (see :prop_tgt:`ALIAS_GLOBAL` target property).
diff --git a/Help/release/dev/alias-local-imported-target.rst b/Help/release/dev/alias-local-imported-target.rst
new file mode 100644
index 0000000..026d793
--- /dev/null
+++ b/Help/release/dev/alias-local-imported-target.rst
@@ -0,0 +1,6 @@
+alias-local-imported-target
+---------------------------
+
+* :command:`add_library` and :command:`add_executable` gain the capability
+  to create an ``ALIAS`` to
+  non-``GLOBAL`` :ref:`Imported Target <Imported Targets>`.
diff --git a/Help/release/dev/self-link-through-alias.rst b/Help/release/dev/self-link-through-alias.rst
new file mode 100644
index 0000000..d91d7ae
--- /dev/null
+++ b/Help/release/dev/self-link-through-alias.rst
@@ -0,0 +1,5 @@
+self-link-through-alias
+-----------------------
+
+* Linking a target to itself through an alias now raise an error.
+  See policy :policy:`CMP0108`.
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake
index 2518ac7..f0fdcd5 100644
--- a/Modules/Compiler/ARMClang.cmake
+++ b/Modules/Compiler/ARMClang.cmake
@@ -19,6 +19,13 @@
 set(CMAKE_AR "${CMAKE_ARMClang_AR}" CACHE FILEPATH "The ARMClang archiver" FORCE)
 mark_as_advanced(CMAKE_ARMClang_AR)
 
+if (CMAKE_LINKER MATCHES "armlink")
+  set(__CMAKE_ARMClang_USING_armlink TRUE)
+  set(CMAKE_LIBRARY_PATH_FLAG "--userlibpath=")
+else()
+  set(__CMAKE_ARMClang_USING_armlink FALSE)
+endif()
+
 # get compiler supported cpu list
 function(__armclang_set_processor_list lang out_var)
   execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" --target=${CMAKE_${lang}_COMPILER_TARGET} -mcpu=list
@@ -60,10 +67,15 @@
   string(APPEND CMAKE_${lang}_FLAGS_INIT "-mcpu=${CMAKE_SYSTEM_PROCESSOR}")
   string(APPEND CMAKE_${lang}_LINK_FLAGS "--cpu=${CMAKE_SYSTEM_PROCESSOR}")
 
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --list <TARGET_BASE>.map")
+  if(__CMAKE_ARMClang_USING_armlink)
+    set(__CMAKE_ARMClang_USING_armlink_WRAPPER "")
+  else()
+    set(__CMAKE_ARMClang_USING_armlink_WRAPPER ${CMAKE_${lang}_LINKER_WRAPPER_FLAG})
+  endif()
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> ${__CMAKE_ARMClang_USING_armlink_WRAPPER} --list <TARGET_BASE>.map")
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
   set(CMAKE_${lang}_ARCHIVE_CREATE         "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
-  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "--via=")
+  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "${__CMAKE_ARMClang_USING_armlink_WRAPPER} --via=")
   set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
   set(CMAKE_${lang}_OUTPUT_EXTENSION_REPLACE 1)
 endmacro()
diff --git a/Modules/Compiler/GNU-ASM.cmake b/Modules/Compiler/GNU-ASM.cmake
index 3daa57d..94af401 100644
--- a/Modules/Compiler/GNU-ASM.cmake
+++ b/Modules/Compiler/GNU-ASM.cmake
@@ -9,4 +9,5 @@
   set(CMAKE_DEPFILE_FLAGS_ASM${ASM_DIALECT} "--MD <DEPFILE>")
   set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
     "<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+  set(CMAKE_ASM_DEFINE_FLAG "--defsym ")
 endif()
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index df6d6b8..668a6a9 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -111,11 +111,13 @@
   endif()
   list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
 
-  set(CMAKE_PCH_EXTENSION .gch)
-  if (NOT CMAKE_GENERATOR MATCHES "Xcode")
-    set(CMAKE_PCH_PROLOGUE "#pragma GCC system_header")
+  if(NOT "x${lang}" STREQUAL "xFortran")
+    set(CMAKE_PCH_EXTENSION .gch)
+    if (NOT CMAKE_GENERATOR MATCHES "Xcode")
+      set(CMAKE_PCH_PROLOGUE "#pragma GCC system_header")
+    endif()
+    set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
+    set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -include <PCH_HEADER>)
+    set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -x ${__pch_header_${lang}} -include <PCH_HEADER>)
   endif()
-  set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
-  set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -include <PCH_HEADER>)
-  set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -x ${__pch_header_${lang}} -include <PCH_HEADER>)
 endmacro()
diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake
index 63a20af..9a760c8 100644
--- a/Modules/Compiler/Intel.cmake
+++ b/Modules/Compiler/Intel.cmake
@@ -33,12 +33,14 @@
     endif()
     list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
 
-    # Precompile Headers
-    set(CMAKE_PCH_EXTENSION .pchi)
-    set(CMAKE_LINK_PCH ON)
-    set(CMAKE_PCH_EPILOGUE "#pragma hdrstop")
-    set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
-    set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>)
-    set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>)
+    if(NOT "x${lang}" STREQUAL "xFortran")
+      # Precompile Headers
+      set(CMAKE_PCH_EXTENSION .pchi)
+      set(CMAKE_LINK_PCH ON)
+      set(CMAKE_PCH_EPILOGUE "#pragma hdrstop")
+      set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
+      set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>)
+      set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>)
+    endif()
   endmacro()
 endif()
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 0a4d4e1..c6de3b0 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -42,6 +42,7 @@
 
 set(CMAKE_SHARED_LIBRARY_PREFIX "lib")
 set(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
+set(CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES ".tbd" ".so")
 set(CMAKE_SHARED_MODULE_PREFIX "lib")
 set(CMAKE_SHARED_MODULE_SUFFIX ".so")
 set(CMAKE_MODULE_EXISTS 1)
@@ -156,6 +157,13 @@
       break()
     endif()
   endforeach()
+
+  if(EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/lib)
+    list(INSERT CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES 0 ${_CMAKE_OSX_SYSROOT_PATH}/usr/lib)
+  endif()
+  if(EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/local/lib)
+    list(INSERT CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES 0 ${_CMAKE_OSX_SYSROOT_PATH}/usr/local/lib)
+  endif()
 endif()
 if (OSX_DEVELOPER_ROOT AND EXISTS "${OSX_DEVELOPER_ROOT}/Library/Frameworks")
   list(APPEND CMAKE_SYSTEM_FRAMEWORK_PATH
@@ -208,11 +216,19 @@
 unset(_apps_paths)
 
 include(Platform/UnixPaths)
-if(_CMAKE_OSX_SYSROOT_PATH AND EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
-  list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_CMAKE_OSX_SYSROOT_PATH}/usr)
-  foreach(lang C CXX OBJC OBJCXX Swift)
-    list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
-  endforeach()
+if(_CMAKE_OSX_SYSROOT_PATH)
+  if(EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
+    list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 ${_CMAKE_OSX_SYSROOT_PATH}/usr)
+    foreach(lang C CXX OBJC OBJCXX Swift)
+      list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
+    endforeach()
+  endif()
+  if(EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/local/include)
+    list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 ${_CMAKE_OSX_SYSROOT_PATH}/usr/local)
+    foreach(lang C CXX OBJC OBJCXX Swift)
+      list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT ${_CMAKE_OSX_SYSROOT_PATH}/usr/local/include)
+    endforeach()
+  endif()
 endif()
 list(APPEND CMAKE_SYSTEM_PREFIX_PATH
   /sw        # Fink
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index f6a20f8..a60e05e 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -41,6 +41,14 @@
     configuration-specific files generated by ``SWIG``. All build
     configurations must result in the same generated source file.
 
+  .. note::
+
+    For Make-based generators, ``swig_add_library`` does not track file
+    dependencies, so depending on the ``<name>_swig_compilation`` custom target
+    is required for targets which require the ``swig``-generated files to
+    exist. Other generators may depend on the source files that would be
+    generated by SWIG.
+
   ``TYPE``
     ``SHARED``, ``MODULE`` and ``STATIC`` have the same semantic as for the
     :command:`add_library` command. If ``USE_BUILD_SHARED_LIBS`` is specified,
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 51eb215..72d71e6 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 17)
-set(CMake_VERSION_PATCH 20200601)
+set(CMake_VERSION_PATCH 20200603)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 08fd2a2..288dc58 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -921,11 +921,11 @@
     }
   }
 
-  if (nullptr != mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
+  if (auto d = mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) {
     if (!absoluteDestFiles.empty()) {
       absoluteDestFiles += ";";
     }
-    absoluteDestFiles += mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES");
+    absoluteDestFiles += d;
     cmCPackLogger(cmCPackLog::LOG_DEBUG,
                   "Got some ABSOLUTE DESTINATION FILES: " << absoluteDestFiles
                                                           << std::endl);
@@ -936,8 +936,7 @@
         GetComponentInstallDirNameSuffix(component);
       if (nullptr != this->GetOption(absoluteDestFileComponent)) {
         std::string absoluteDestFilesListComponent =
-          cmStrCat(this->GetOption(absoluteDestFileComponent), ';',
-                   mf.GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES"));
+          cmStrCat(this->GetOption(absoluteDestFileComponent), ';', d);
         this->SetOption(absoluteDestFileComponent,
                         absoluteDestFilesListComponent.c_str());
       } else {
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 2989025..ea36df5 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -21,6 +21,7 @@
 #include "cmCurl.h"
 #include "cmDuration.h"
 #include "cmGeneratedFileStream.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 9250fbc..35f09fd 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -15,6 +15,7 @@
 #include "cmCursesPathWidget.h"
 #include "cmCursesStringWidget.h"
 #include "cmCursesWidget.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index df34283..6fc556c 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -17,6 +17,7 @@
 #include "cmCursesStandardIncludes.h"
 #include "cmCursesStringWidget.h"
 #include "cmCursesWidget.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
@@ -853,11 +854,7 @@
       }
       // switch advanced on/off
       else if (key == 't') {
-        if (this->AdvancedMode) {
-          this->AdvancedMode = false;
-        } else {
-          this->AdvancedMode = true;
-        }
+        this->AdvancedMode = !this->AdvancedMode;
         getmaxyx(stdscr, y, x);
         this->RePost();
         this->Render(1, 1, x, y);
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index c629478..4830d63 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -105,12 +105,10 @@
     if (!this->InEdit && (key != 10 && key != KEY_ENTER && key != 'i')) {
       return false;
     }
-    // enter edit with return and i (vim binding)
-    if (!this->InEdit && (key == 10 || key == KEY_ENTER || key == 'i')) {
-      this->OnReturn(fm, w);
-    }
-    // leave edit with return (but not i -- not a toggle)
-    else if (this->InEdit && (key == 10 || key == KEY_ENTER)) {
+    // toggle edit with return
+    if ((key == 10 || key == KEY_ENTER)
+        // enter edit with i (and not-edit mode)
+        || (!this->InEdit && key == 'i')) {
       this->OnReturn(fm, w);
     } else if (key == KEY_DOWN || key == ctrl('n') || key == KEY_UP ||
                key == ctrl('p') || key == KEY_NPAGE || key == ctrl('d') ||
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 930f300..6dbfe11 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -595,7 +595,11 @@
 
   QDialog dialog;
   QFontMetrics met(this->font());
+#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
+  int msgWidth = met.horizontalAdvance(msg);
+#else
   int msgWidth = met.width(msg);
+#endif
   dialog.setMinimumSize(msgWidth / 15, 20);
   dialog.setWindowTitle(tr("Help"));
   QVBoxLayout* l = new QVBoxLayout(&dialog);
@@ -1056,14 +1060,7 @@
     this->GenerateAction->setEnabled(false);
     this->OpenProjectButton->setEnabled(false);
     this->GenerateButton->setText(tr("&Stop"));
-  } else if (s == ReadyConfigure) {
-    this->setEnabledState(true);
-    this->GenerateButton->setEnabled(true);
-    this->GenerateAction->setEnabled(true);
-    this->ConfigureButton->setEnabled(true);
-    this->ConfigureButton->setText(tr("&Configure"));
-    this->GenerateButton->setText(tr("&Generate"));
-  } else if (s == ReadyGenerate) {
+  } else if (s == ReadyConfigure || s == ReadyGenerate) {
     this->setEnabledState(true);
     this->GenerateButton->setEnabled(true);
     this->GenerateAction->setEnabled(true);
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 3e6a49e..40cc89c 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -209,6 +209,10 @@
 
 void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
 {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
+  this->beginResetModel();
+#endif
+
   QSet<QCMakeProperty> newProps;
   QSet<QCMakeProperty> newProps2;
 
@@ -231,8 +235,13 @@
   if (View == FlatView) {
     QCMakePropertyList newP = newProps.toList();
     QCMakePropertyList newP2 = newProps2.toList();
+#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
+    std::sort(newP.begin(), newP.end());
+    std::sort(newP2.begin(), newP2.end());
+#else
     qSort(newP);
     qSort(newP2);
+#endif
     int row_count = 0;
     foreach (QCMakeProperty const& p, newP) {
       this->insertRow(row_count);
@@ -262,10 +271,17 @@
       parentItems.append(
         new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key));
       parentItems.append(new QStandardItem());
+#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
+      parentItems[0]->setData(QBrush(QColor(255, 100, 100)),
+                              Qt::BackgroundRole);
+      parentItems[1]->setData(QBrush(QColor(255, 100, 100)),
+                              Qt::BackgroundRole);
+#else
       parentItems[0]->setData(QBrush(QColor(255, 100, 100)),
                               Qt::BackgroundColorRole);
       parentItems[1]->setData(QBrush(QColor(255, 100, 100)),
                               Qt::BackgroundColorRole);
+#endif
       parentItems[0]->setData(1, GroupRole);
       parentItems[1]->setData(1, GroupRole);
       root->appendRow(parentItems);
@@ -305,7 +321,11 @@
   }
 
   this->blockSignals(b);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
+  this->endResetModel();
+#else
   this->reset();
+#endif
 }
 
 QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const
@@ -315,6 +335,10 @@
 
 void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t)
 {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
+  this->beginResetModel();
+#endif
+
   this->View = t;
 
   QCMakePropertyList props = this->properties();
@@ -330,7 +354,11 @@
   this->setProperties(oldProps);
   this->setProperties(props);
   this->blockSignals(b);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
+  this->endResetModel();
+#else
   this->reset();
+#endif
 }
 
 void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1,
@@ -356,10 +384,15 @@
   }
 
   if (isNew) {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
+    this->setData(idx1, QBrush(QColor(255, 100, 100)), Qt::BackgroundRole);
+    this->setData(idx2, QBrush(QColor(255, 100, 100)), Qt::BackgroundRole);
+#else
     this->setData(idx1, QBrush(QColor(255, 100, 100)),
                   Qt::BackgroundColorRole);
     this->setData(idx2, QBrush(QColor(255, 100, 100)),
                   Qt::BackgroundColorRole);
+#endif
   }
 }
 
@@ -409,7 +442,11 @@
       reorgProps.append((*iter)[0]);
       iter = tmp.erase(iter);
     } else {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
+      std::sort(iter->begin(), iter->end());
+#else
       qSort(*iter);
+#endif
       ++iter;
     }
   }
@@ -639,9 +676,15 @@
   // increase to checkbox size
   QStyleOptionButton opt;
   opt.QStyleOption::operator=(option);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
+  sz = sz.expandedTo(
+    style->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &opt, nullptr)
+      .size());
+#else
   sz = sz.expandedTo(
     style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, nullptr)
       .size());
+#endif
 
   return sz;
 }
diff --git a/Source/QtDialog/RegexExplorer.cxx b/Source/QtDialog/RegexExplorer.cxx
index 746fd8a..6194940 100644
--- a/Source/QtDialog/RegexExplorer.cxx
+++ b/Source/QtDialog/RegexExplorer.cxx
@@ -147,9 +147,6 @@
       } else if (nextc == 'n') {
         result.append(1, '\n');
         in++;
-      } else if (nextc == 't') {
-        result.append(1, '\t');
-        in++;
       } else if (isalnum(nextc) || nextc == '\0') {
         return false;
       } else {
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index e738bc4..9dd8a19 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -117,14 +117,9 @@
                                "\" is not an executable."));
       return false;
     }
-    if (aliasedTarget->IsImported() &&
-        !aliasedTarget->IsImportedGloballyVisible()) {
-      status.SetError(cmStrCat("cannot create ALIAS target \"", exename,
-                               "\" because target \"", aliasedName,
-                               "\" is imported but not globally visible."));
-      return false;
-    }
-    mf.AddAlias(exename, aliasedName);
+    mf.AddAlias(exename, aliasedName,
+                !aliasedTarget->IsImported() ||
+                  aliasedTarget->IsImportedGloballyVisible());
     return true;
   }
 
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index d79c04f..3e5d764 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -219,14 +219,9 @@
                                "\" is not a library."));
       return false;
     }
-    if (aliasedTarget->IsImported() &&
-        !aliasedTarget->IsImportedGloballyVisible()) {
-      status.SetError(cmStrCat("cannot create ALIAS target \"", libName,
-                               "\" because target \"", aliasedName,
-                               "\" is imported but not globally visible."));
-      return false;
-    }
-    mf.AddAlias(libName, aliasedName);
+    mf.AddAlias(libName, aliasedName,
+                !aliasedTarget->IsImported() ||
+                  aliasedTarget->IsImportedGloballyVisible());
     return true;
   }
 
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 78bb6e0..addfbff 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -282,7 +282,12 @@
       time_t epochTime;
       iss >> epochTime;
       if (iss.eof() && !iss.fail()) {
+        // Set all of the file times to the epoch time to handle archive
+        // formats that include creation/access time.
         archive_entry_set_mtime(e, epochTime, 0);
+        archive_entry_set_atime(e, epochTime, 0);
+        archive_entry_set_ctime(e, epochTime, 0);
+        archive_entry_set_birthtime(e, epochTime, 0);
       }
     }
   }
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 9b023d9..bca7540 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -54,6 +54,7 @@
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
 #include "cmProcessOutput.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 3d946b4..f036258 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -12,6 +12,7 @@
 #include <utility>
 #include <vector>
 
+#include "cmProperty.h"
 #include "cmPropertyMap.h"
 #include "cmStateTypes.h"
 
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 0516d26..87eb91c 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -11,6 +11,7 @@
 
 #include "cmCommandArgumentLexer.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 32a33ee..051eff6 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -14,6 +14,7 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmSourceFile.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 8723d08..4c5f57d 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -21,6 +21,7 @@
 #include "cmOrderDirectories.h"
 #include "cmOutputConverter.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
@@ -1330,18 +1331,13 @@
   std::vector<std::string> implicitDirVec;
 
   // Get platform-wide implicit directories.
-  if (const char* implicitLinks = this->Makefile->GetDefinition(
-        "CMAKE_PLATFORM_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES")) {
-    cmExpandList(implicitLinks, implicitDirVec);
-  }
+  this->Makefile->GetDefExpandList(
+    "CMAKE_PLATFORM_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES", implicitDirVec);
 
   // Get language-specific implicit directories.
   std::string implicitDirVar = cmStrCat(
     "CMAKE_", this->LinkLanguage, "_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES");
-  if (const char* implicitDirs =
-        this->Makefile->GetDefinition(implicitDirVar)) {
-    cmExpandList(implicitDirs, implicitDirVec);
-  }
+  this->Makefile->GetDefExpandList(implicitDirVar, implicitDirVec);
 
   this->FrameworkPathsEmmitted.insert(implicitDirVec.begin(),
                                       implicitDirVec.end());
@@ -1554,10 +1550,8 @@
   std::vector<std::string> implicitDirVec;
 
   // Get platform-wide implicit directories.
-  if (const char* implicitLinks = (this->Makefile->GetDefinition(
-        "CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES"))) {
-    cmExpandList(implicitLinks, implicitDirVec);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES",
+                                   implicitDirVec);
 
   // Append library architecture to all implicit platform directories
   // and add them to the set
@@ -1571,10 +1565,7 @@
   // Get language-specific implicit directories.
   std::string implicitDirVar =
     cmStrCat("CMAKE_", this->LinkLanguage, "_IMPLICIT_LINK_DIRECTORIES");
-  if (const char* implicitDirs =
-        this->Makefile->GetDefinition(implicitDirVar)) {
-    cmExpandList(implicitDirs, implicitDirVec);
-  }
+  this->Makefile->GetDefExpandList(implicitDirVar, implicitDirVec);
 
   // Store implicit link directories.
   this->ImplicitLinkDirs.insert(implicitDirVec.begin(), implicitDirVec.end());
@@ -1583,10 +1574,7 @@
   std::vector<std::string> implicitLibVec;
   std::string implicitLibVar =
     cmStrCat("CMAKE_", this->LinkLanguage, "_IMPLICIT_LINK_LIBRARIES");
-  if (const char* implicitLibs =
-        this->Makefile->GetDefinition(implicitLibVar)) {
-    cmExpandList(implicitLibs, implicitLibVec);
-  }
+  this->Makefile->GetDefExpandList(implicitLibVar, implicitLibVec);
 
   // Store implicit link libraries.
   for (std::string const& item : implicitLibVec) {
@@ -1598,10 +1586,8 @@
   }
 
   // Get platform specific rpath link directories
-  if (const char* rpathDirs =
-        (this->Makefile->GetDefinition("CMAKE_PLATFORM_RUNTIME_PATH"))) {
-    cmExpandList(rpathDirs, this->RuntimeLinkDirs);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_PLATFORM_RUNTIME_PATH",
+                                   this->RuntimeLinkDirs);
 }
 
 std::vector<std::string> const&
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 0fe19b6..60504ba 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -14,6 +14,7 @@
 #include "cmGeneratorTarget.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index 4499a66..e05c964 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -384,9 +384,7 @@
   // Get the transformation rules.
   std::vector<std::string> transformRules;
   cmMakefile* mf = this->LocalGenerator->GetMakefile();
-  if (const char* xform = mf->GetDefinition("CMAKE_INCLUDE_TRANSFORMS")) {
-    cmExpandList(xform, transformRules, true);
-  }
+  mf->GetDefExpandList("CMAKE_INCLUDE_TRANSFORMS", transformRules, true);
   for (std::string const& tr : transformRules) {
     this->ParseTransform(tr);
   }
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 95dfc4e..8f02d95 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -80,10 +80,7 @@
   // Get the list of definitions.
   std::vector<std::string> definitions;
   cmMakefile* mf = this->LocalGenerator->GetMakefile();
-  if (const char* c_defines =
-        mf->GetDefinition("CMAKE_TARGET_DEFINITIONS_Fortran")) {
-    cmExpandList(c_defines, definitions);
-  }
+  mf->GetDefExpandList("CMAKE_TARGET_DEFINITIONS_Fortran", definitions);
 
   // translate i.e. FOO=BAR to FOO and add it to the list of defined
   // preprocessor symbols
@@ -243,10 +240,7 @@
   // Load information about other targets.
   cmMakefile* mf = this->LocalGenerator->GetMakefile();
   std::vector<std::string> infoFiles;
-  if (const char* infoFilesValue =
-        mf->GetDefinition("CMAKE_TARGET_LINKED_INFO_FILES")) {
-    cmExpandList(infoFilesValue, infoFiles);
-  }
+  mf->GetDefExpandList("CMAKE_TARGET_LINKED_INFO_FILES", infoFiles);
   for (std::string const& i : infoFiles) {
     std::string targetDir = cmSystemTools::GetFilenamePath(i);
     std::string fname = targetDir + "/fortran.internal";
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index ed0689a..4d0e099 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -21,6 +21,7 @@
 #include "cmMessageType.h"
 #include "cmOutputConverter.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmPropertyMap.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index be63278..7f31dd2 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -14,6 +14,7 @@
 #include "cmGlobalGenerator.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
@@ -23,8 +24,6 @@
 
 class cmListFileBacktrace;
 
-using cmProp = const std::string*;
-
 static void FinalAction(cmMakefile& makefile, std::string const& filename,
                         bool append)
 {
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 46056c1..c6b6184 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -12,6 +12,7 @@
 #include "cmGlobalGenerator.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmTarget.h"
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 582a9f0..7bc4536 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -19,6 +19,7 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmProperty.h"
 #include "cmSourceFile.h"
 #include "cmSourceGroup.h"
 #include "cmState.h"
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 253834f..613a943 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -17,14 +17,13 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmProperty.h"
 #include "cmSourceFile.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-using cmProp = const std::string*; // just to silence IWYU
-
 /*
 Sublime Text 2 Generator
 Author: Morné Chamberlain
diff --git a/Source/cmFileAPICache.cxx b/Source/cmFileAPICache.cxx
index 25e5916..3ba943a 100644
--- a/Source/cmFileAPICache.cxx
+++ b/Source/cmFileAPICache.cxx
@@ -10,6 +10,7 @@
 #include <cm3p/json/value.h>
 
 #include "cmFileAPI.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmake.h"
 
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index b7daebe..fe331ec 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -31,6 +31,7 @@
 #include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmSourceFile.h"
 #include "cmSourceGroup.h"
 #include "cmState.h"
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index b5553b8..743ac75 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -10,6 +10,7 @@
 #include <cmext/algorithm>
 
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmSearchPath.h"
 #include "cmState.h"
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 82acfed..3e97150 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -4,7 +4,6 @@
 
 #include <algorithm>
 #include <array>
-#include <cstring>
 #include <utility>
 
 #include <cmext/algorithm>
@@ -280,12 +279,7 @@
   // Construct the list of path roots with no trailing slashes.
   for (const char** pathName = paths; *pathName; ++pathName) {
     // Get the list of paths to ignore from the variable.
-    const char* ignorePath = this->Makefile->GetDefinition(*pathName);
-    if ((ignorePath == nullptr) || (strlen(ignorePath) == 0)) {
-      continue;
-    }
-
-    cmExpandList(ignorePath, ignore);
+    this->Makefile->GetDefExpandList(*pathName, ignore);
   }
 
   for (std::string& i : ignore) {
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index d1517fe..8d5b177 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -24,6 +24,7 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmSearchPath.h"
 #include "cmState.h"
@@ -504,9 +505,7 @@
       case cmPolicies::NEW: {
         // NEW behavior is to honor the <pkg>_ROOT variables.
         std::string const rootVar = this->Name + "_ROOT";
-        if (const char* pkgRoot = this->Makefile->GetDefinition(rootVar)) {
-          cmExpandList(pkgRoot, rootPaths, false);
-        }
+        this->Makefile->GetDefExpandList(rootVar, rootPaths, false);
         cmSystemTools::GetPath(rootPaths, rootVar.c_str());
       } break;
     }
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 32e7892..3b82e0a 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -113,8 +113,8 @@
   // At end of for each execute recorded commands
   // store the old value
   std::string oldDef;
-  if (mf.GetDefinition(this->Args.front())) {
-    oldDef = mf.GetDefinition(this->Args.front());
+  if (auto d = mf.GetDefinition(this->Args.front())) {
+    oldDef = d;
   }
 
   auto restore = false;
@@ -186,8 +186,8 @@
   // 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]));
+    if (auto d = mf.GetDefinition(iterationVars[i])) {
+      oldDefs.emplace(iterationVars[i], d);
     }
   }
 
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index e3de2d8..e4fb67e 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -35,6 +35,7 @@
 #include "cmMessageType.h"
 #include "cmOutputConverter.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmState.h"
 #include "cmStateSnapshot.h"
@@ -1341,6 +1342,14 @@
         }
         return std::string();
       }
+      if (propertyName == "ALIAS_GLOBAL"_s) {
+        if (context->LG->GetMakefile()->IsAlias(targetName)) {
+          return context->LG->GetGlobalGenerator()->IsAlias(targetName)
+            ? "TRUE"
+            : "FALSE";
+        }
+        return std::string();
+      }
       target = context->LG->FindGeneratorTargetToUse(targetName);
 
       if (!target) {
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 39224d1..250910a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1486,11 +1486,8 @@
   }
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugSources =
     !this->DebugSourcesDone && cm::contains(debugProperties, "SOURCES");
@@ -3306,11 +3303,8 @@
                                              nullptr, nullptr);
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugIncludes = !this->DebugIncludesDone &&
     cm::contains(debugProperties, "INCLUDE_DIRECTORIES");
@@ -3493,11 +3487,8 @@
                                              nullptr);
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugOptions = !this->DebugCompileOptionsDone &&
     cm::contains(debugProperties, "COMPILE_OPTIONS");
@@ -3538,11 +3529,8 @@
                                              nullptr);
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugFeatures = !this->DebugCompileFeaturesDone &&
     cm::contains(debugProperties, "COMPILE_FEATURES");
@@ -3585,11 +3573,8 @@
                                              nullptr, nullptr);
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugDefines = !this->DebugCompileDefinitionsDone &&
     cm::contains(debugProperties, "COMPILE_DEFINITIONS");
@@ -3645,11 +3630,8 @@
                                              nullptr, nullptr);
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugDefines = !this->DebugPrecompileHeadersDone &&
     std::find(debugProperties.begin(), debugProperties.end(),
@@ -4024,11 +4006,8 @@
                                              nullptr);
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugOptions = !this->DebugLinkOptionsDone &&
     cm::contains(debugProperties, "LINK_OPTIONS");
@@ -4286,11 +4265,8 @@
                                              nullptr);
 
   std::vector<std::string> debugProperties;
-  const char* debugProp =
-    this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Makefile->GetDefExpandList("CMAKE_DEBUG_TARGET_PROPERTIES",
+                                   debugProperties);
 
   bool debugDirectories = !this->DebugLinkDirectoriesDone &&
     cm::contains(debugProperties, "LINK_DIRECTORIES");
@@ -5811,11 +5787,8 @@
   const std::string& compatibilityType) const
 {
   std::vector<std::string> debugProperties;
-  const char* debugProp = this->Target->GetMakefile()->GetDefinition(
-    "CMAKE_DEBUG_TARGET_PROPERTIES");
-  if (debugProp) {
-    cmExpandList(debugProp, debugProperties);
-  }
+  this->Target->GetMakefile()->GetDefExpandList(
+    "CMAKE_DEBUG_TARGET_PROPERTIES", debugProperties);
 
   bool debugOrigin = !this->DebugCompatiblePropertiesDone[p] &&
     cm::contains(debugProperties, p);
@@ -7030,6 +7003,13 @@
 
       // Skip entries that resolve to the target itself or are empty.
       std::string name = this->CheckCMP0004(lib);
+      if (this->GetPolicyStatusCMP0108() == cmPolicies::NEW) {
+        // resolve alias name
+        auto target = this->Makefile->FindTargetToUse(name);
+        if (target) {
+          name = target->GetName();
+        }
+      }
       if (name == this->GetName() || name.empty()) {
         if (name == this->GetName()) {
           bool noMessage = false;
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 788fa23..7aa7d32 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -31,7 +31,7 @@
 struct cmGeneratorExpressionContext;
 struct cmGeneratorExpressionDAGChecker;
 
-using cmProp = const std::string*;
+#include "cmProperty.h"
 
 class cmGeneratorTarget
 {
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index 0480876..79cbe44 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -7,6 +7,7 @@
 #include "cmExecutionStatus.h"
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStringAlgorithms.h"
 
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 2833977..fa4a40b 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -7,6 +7,7 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmSystemTools.h"
 
 namespace {
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 851f426..cba7704 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -344,10 +344,20 @@
   }
 
   if (cmTarget* target = status.GetMakefile().FindTargetToUse(name)) {
-    if (propertyName == "ALIASED_TARGET") {
+    if (propertyName == "ALIASED_TARGET" || propertyName == "ALIAS_GLOBAL") {
       if (status.GetMakefile().IsAlias(name)) {
-        return StoreResult(infoType, status.GetMakefile(), variable,
-                           target->GetName().c_str());
+        if (propertyName == "ALIASED_TARGET") {
+
+          return StoreResult(infoType, status.GetMakefile(), variable,
+                             target->GetName().c_str());
+        }
+        if (propertyName == "ALIAS_GLOBAL") {
+          return StoreResult(
+            infoType, status.GetMakefile(), variable,
+            status.GetMakefile().GetGlobalGenerator()->IsAlias(name)
+              ? "TRUE"
+              : "FALSE");
+        }
       }
       return StoreResult(infoType, status.GetMakefile(), variable, nullptr);
     }
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index 6b850d1..8a304be 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -5,10 +5,12 @@
 #include <sstream>
 
 #include "cmExecutionStatus.h"
+#include "cmGlobalGenerator.h"
 #include "cmListFileCache.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmTarget.h"
 #include "cmTargetPropertyComputer.h"
 
@@ -28,10 +30,17 @@
   cmMakefile& mf = status.GetMakefile();
 
   if (cmTarget* tgt = mf.FindTargetToUse(targetName)) {
-    if (args[2] == "ALIASED_TARGET") {
+    if (args[2] == "ALIASED_TARGET" || args[2] == "ALIAS_GLOBAL") {
       if (mf.IsAlias(targetName)) {
-        prop = tgt->GetName();
         prop_exists = true;
+        if (args[2] == "ALIASED_TARGET") {
+
+          prop = tgt->GetName();
+        }
+        if (args[2] == "ALIAS_GLOBAL") {
+          prop =
+            mf.GetGlobalGenerator()->IsAlias(targetName) ? "TRUE" : "FALSE";
+        }
       }
     } else if (!args[2].empty()) {
       cmProp prop_cstr = nullptr;
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index a5e496b..358d65a 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -19,6 +19,7 @@
 #include "cmLocalGhsMultiGenerator.h"
 #include "cmMakefile.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmSourceFile.h"
 #include "cmSourceFileLocation.h"
 #include "cmSourceGroup.h"
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index f57ef04..9dc86f4 100644
--- a/Source/cmGlobalCommonGenerator.cxx
+++ b/Source/cmGlobalCommonGenerator.cxx
@@ -7,6 +7,7 @@
 
 #include "cmGeneratorTarget.h"
 #include "cmLocalGenerator.h"
+#include "cmProperty.h"
 #include "cmStateDirectory.h"
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d388224..4dc4092 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -42,6 +42,7 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmSourceFile.h"
 #include "cmState.h"
@@ -2523,9 +2524,8 @@
   cmCustomCommandLine singleLine;
   singleLine.push_back(cmSystemTools::GetCTestCommand());
   singleLine.push_back("--force-new-ctest-process");
-  if (auto testArgs = mf->GetDefinition("CMAKE_CTEST_ARGUMENTS")) {
-    std::vector<std::string> args;
-    cmExpandList(testArgs, args);
+  std::vector<std::string> args;
+  if (mf->GetDefExpandList("CMAKE_CTEST_ARGUMENTS", args)) {
     for (auto const& arg : args) {
       singleLine.push_back(arg);
     }
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 651bfbd..d36adfb 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -19,6 +19,7 @@
 #include "cmLocalGenerator.h"
 #include "cmLocalGhsMultiGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 5363ea5..c31983b 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -20,6 +20,7 @@
 #include "cmMakefile.h"
 #include "cmMakefileTargetGenerator.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateDirectory.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 0932d06..c688da2 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -167,7 +167,7 @@
       if (this->ExpressEdition) {
         fout << "# Visual Studio Express 16 for Windows Desktop\n";
       } else {
-        fout << "# Visual Studio 16\n";
+        fout << "# Visual Studio Version 16\n";
       }
       break;
   }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index cda3338..a5ce5d1 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3204,10 +3204,9 @@
 void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
 {
   this->Architectures.clear();
-  const char* osxArch = mf->GetDefinition("CMAKE_OSX_ARCHITECTURES");
   const char* sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT");
-  if (osxArch && sysroot) {
-    cmExpandList(std::string(osxArch), this->Architectures);
+  if (sysroot) {
+    mf->GetDefExpandList("CMAKE_OSX_ARCHITECTURES", this->Architectures);
   }
 
   if (this->Architectures.empty()) {
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index ac57bc2..178af73 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -28,6 +28,7 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSubcommandTable.h"
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 37d8c28..178d5df 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -18,14 +18,13 @@
 #include "cmMessageType.h"
 #include "cmOutputConverter.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmTarget.h"
 #include "cmake.h"
 
-using cmProp = const std::string*; // just to silence IWYU
-
 cmInstallTargetGenerator::cmInstallTargetGenerator(
   std::string targetName, std::string const& dest, bool implib,
   std::string file_permissions, std::vector<std::string> const& configurations,
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index a4f78bc..9f17f15 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -28,6 +28,7 @@
 #include "cmLinkLineComputer.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmPropertyMap.h"
 #include "cmSourceFile.h"
 #include "cmState.h"
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index eebf328..c50a786 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -15,6 +15,7 @@
 #include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmStateDirectory.h"
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ff05024..f299202 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -34,6 +34,7 @@
 #include "cmInstallTargetGenerator.h"
 #include "cmLinkLineComputer.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmRulePlaceholderExpander.h"
 #include "cmSourceFile.h"
 #include "cmSourceFileLocation.h"
@@ -1235,11 +1236,10 @@
     // * Compilers like gfortran do not search their own implicit include
     //   directories for modules ('.mod' files).
     if (lang != "Fortran") {
-      const char* value = this->Makefile->GetDefinition(
-        cmStrCat("CMAKE_", lang, "_IMPLICIT_INCLUDE_DIRECTORIES"));
-      if (value != nullptr) {
-        size_t const impDirVecOldSize = impDirVec.size();
-        cmExpandList(value, impDirVec);
+      size_t const impDirVecOldSize = impDirVec.size();
+      if (this->Makefile->GetDefExpandList(
+            cmStrCat("CMAKE_", lang, "_IMPLICIT_INCLUDE_DIRECTORIES"),
+            impDirVec)) {
         // FIXME: Use cmRange with 'advance()' when it supports non-const.
         for (size_t i = impDirVecOldSize; i < impDirVec.size(); ++i) {
           cmSystemTools::ConvertToUnixSlashes(impDirVec[i]);
@@ -2049,6 +2049,15 @@
     return imported->second;
   }
 
+  // find local alias to imported target
+  auto aliased = this->AliasTargets.find(name);
+  if (aliased != this->AliasTargets.end()) {
+    imported = this->ImportedGeneratorTargets.find(aliased->second);
+    if (imported != this->ImportedGeneratorTargets.end()) {
+      return imported->second;
+    }
+  }
+
   if (cmGeneratorTarget* t = this->FindLocalNonAliasGeneratorTarget(name)) {
     return t;
   }
@@ -2468,7 +2477,8 @@
           std::ostringstream e;
           e << "Variable " << flagsVar
             << " has been modified. CMake "
-               "will ignore the POSITION_INDEPENDENT_CODE target property for "
+               "will ignore the POSITION_INDEPENDENT_CODE target property "
+               "for "
                "shared libraries and will use the "
             << flagsVar
             << " variable "
@@ -2565,7 +2575,8 @@
   }
 
   for (std::string const& config : configsList) {
-    // FIXME: Refactor collection of sources to not evaluate object libraries.
+    // FIXME: Refactor collection of sources to not evaluate object
+    // libraries.
     std::vector<cmSourceFile*> sources;
     target->GetSourceFiles(sources, config);
 
@@ -3270,8 +3281,8 @@
                                          const std::string& config)
 {
   std::string featureName = feature;
-  // TODO: Define accumulation policy for features (prepend, append, replace).
-  // Currently we always replace.
+  // TODO: Define accumulation policy for features (prepend, append,
+  // replace). Currently we always replace.
   if (!config.empty()) {
     featureName += "_";
     featureName += cmSystemTools::UpperCase(config);
@@ -4120,9 +4131,9 @@
   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, stdPipesUTF8);
+    no_implicit_depends, commandLines, comment, workingDir,
+    /*replace=*/false, escapeOldStyle, uses_terminal, command_expand_lists,
+    /*depfile=*/"", job_pool, stdPipesUTF8);
   if (rule) {
     lg.GetMakefile()->AddTargetByproducts(target, byproducts);
   }
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index e52e0d3..87e8aa4 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -23,6 +23,7 @@
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
 #include "cmNinjaTargetGenerator.h"
+#include "cmProperty.h"
 #include "cmRulePlaceholderExpander.h"
 #include "cmSourceFile.h"
 #include "cmState.h"
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4c7c8c4..4545a8e 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -28,6 +28,7 @@
 #include "cmMakefile.h"
 #include "cmMakefileTargetGenerator.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmRulePlaceholderExpander.h"
 #include "cmSourceFile.h"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 154da50..c78b751 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2035,10 +2035,13 @@
   }
 }
 
-void cmMakefile::AddAlias(const std::string& lname, std::string const& tgtName)
+void cmMakefile::AddAlias(const std::string& lname, std::string const& tgtName,
+                          bool globallyVisible)
 {
   this->AliasTargets[lname] = tgtName;
-  this->GetGlobalGenerator()->AddAlias(lname, tgtName);
+  if (globallyVisible) {
+    this->GetGlobalGenerator()->AddAlias(lname, tgtName);
+  }
 }
 
 cmTarget* cmMakefile::AddLibrary(const std::string& lname,
@@ -2745,6 +2748,18 @@
   return *def;
 }
 
+bool cmMakefile::GetDefExpandList(const std::string& name,
+                                  std::vector<std::string>& out,
+                                  bool emptyArgs) const
+{
+  cmProp def = this->GetDef(name);
+  if (!def) {
+    return false;
+  }
+  cmExpandList(*def, out, emptyArgs);
+  return true;
+}
+
 std::vector<std::string> cmMakefile::GetDefinitions() const
 {
   std::vector<std::string> res = this->StateSnapshot.ClosureKeys();
@@ -3273,10 +3288,7 @@
                                           bool singleConfig) const
 {
   if (this->GetGlobalGenerator()->IsMultiConfig()) {
-    if (const char* configTypes =
-          this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
-      cmExpandList(configTypes, configs);
-    }
+    this->GetDefExpandList("CMAKE_CONFIGURATION_TYPES", configs);
     return "";
   }
   const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
@@ -4277,7 +4289,15 @@
 {
   // Look for an imported target.  These take priority because they
   // are more local in scope and do not have to be globally unique.
-  auto imported = this->ImportedTargets.find(name);
+  auto targetName = name;
+  if (!excludeAliases) {
+    // Look for local alias targets.
+    auto alias = this->AliasTargets.find(name);
+    if (alias != this->AliasTargets.end()) {
+      targetName = alias->second;
+    }
+  }
+  auto imported = this->ImportedTargets.find(targetName);
   if (imported != this->ImportedTargets.end()) {
     return imported->second;
   }
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 04a1f2d..45d7109 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -26,6 +26,7 @@
 #include "cmMessageType.h"
 #include "cmNewLineStyle.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmSourceFileLocationKind.h"
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
@@ -58,8 +59,6 @@
 class cmVariableWatch;
 class cmake;
 
-using cmProp = const std::string*;
-
 /** Flag if byproducts shall also be considered.  */
 enum class cmSourceOutputKind
 {
@@ -357,7 +356,8 @@
                        cmStateEnums::TargetType type,
                        const std::vector<std::string>& srcs,
                        bool excludeFromAll = false);
-  void AddAlias(const std::string& libname, const std::string& tgt);
+  void AddAlias(const std::string& libname, const std::string& tgt,
+                bool globallyVisible = true);
 
   //@{
   /**
@@ -513,6 +513,8 @@
   const std::string& GetSafeDefinition(const std::string&) const;
   const std::string& GetRequiredDefinition(const std::string& name) const;
   bool IsDefinitionSet(const std::string&) const;
+  bool GetDefExpandList(const std::string& name, std::vector<std::string>& out,
+                        bool emptyArgs = false) const;
   /**
    * Get the list of all variables in the current space. If argument
    * cacheonly is specified and is greater than 0, then only cache
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index e15b016..446f225 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -478,9 +478,7 @@
     // add it now.
     std::string implibRuleVar =
       cmStrCat("CMAKE_", linkLanguage, "_CREATE_IMPORT_LIBRARY");
-    if (const char* rule = this->Makefile->GetDefinition(implibRuleVar)) {
-      cmExpandList(rule, real_link_commands);
-    }
+    this->Makefile->GetDefExpandList(implibRuleVar, real_link_commands);
   }
 
   bool useResponseFileForObjects =
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2d360e6..5809b4a 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -642,27 +642,21 @@
     arCreateVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
       arCreateVar, linkLanguage, this->GetConfigName());
 
-    if (const char* rule = this->Makefile->GetDefinition(arCreateVar)) {
-      cmExpandList(rule, archiveCreateCommands);
-    }
+    this->Makefile->GetDefExpandList(arCreateVar, archiveCreateCommands);
     std::string arAppendVar =
       cmStrCat("CMAKE_", linkLanguage, "_ARCHIVE_APPEND");
 
     arAppendVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
       arAppendVar, linkLanguage, this->GetConfigName());
 
-    if (const char* rule = this->Makefile->GetDefinition(arAppendVar)) {
-      cmExpandList(rule, archiveAppendCommands);
-    }
+    this->Makefile->GetDefExpandList(arAppendVar, archiveAppendCommands);
     std::string arFinishVar =
       cmStrCat("CMAKE_", linkLanguage, "_ARCHIVE_FINISH");
 
     arFinishVar = this->GeneratorTarget->GetFeatureSpecificLinkRuleVariable(
       arFinishVar, linkLanguage, this->GetConfigName());
 
-    if (const char* rule = this->Makefile->GetDefinition(arFinishVar)) {
-      cmExpandList(rule, archiveFinishCommands);
-    }
+    this->Makefile->GetDefExpandList(arFinishVar, archiveFinishCommands);
   }
 
   // Decide whether to use archiving rules.
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index c98e3a9..8396fa3 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -26,6 +26,7 @@
 #include "cmMakefileLibraryTargetGenerator.h"
 #include "cmMakefileUtilityTargetGenerator.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmRulePlaceholderExpander.h"
 #include "cmSourceFile.h"
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index f87eba7..b92548f 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -29,6 +29,7 @@
 #include "cmNinjaTypes.h"
 #include "cmOSXBundleGenerator.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmRulePlaceholderExpander.h"
 #include "cmSourceFile.h"
 #include "cmState.h"
@@ -453,14 +454,12 @@
     case cmStateEnums::STATIC_LIBRARY:
     case cmStateEnums::SHARED_LIBRARY:
     case cmStateEnums::MODULE_LIBRARY: {
-      const std::string cudaLinkCmd(
-        this->GetMakefile()->GetDefinition("CMAKE_CUDA_DEVICE_LINK_LIBRARY"));
-      cmExpandList(cudaLinkCmd, linkCmds);
+      this->GetMakefile()->GetDefExpandList("CMAKE_CUDA_DEVICE_LINK_LIBRARY",
+                                            linkCmds);
     } break;
     case cmStateEnums::EXECUTABLE: {
-      const std::string cudaLinkCmd(this->GetMakefile()->GetDefinition(
-        "CMAKE_CUDA_DEVICE_LINK_EXECUTABLE"));
-      cmExpandList(cudaLinkCmd, linkCmds);
+      this->GetMakefile()->GetDefExpandList(
+        "CMAKE_CUDA_DEVICE_LINK_EXECUTABLE", linkCmds);
     } break;
     default:
       break;
@@ -557,9 +556,8 @@
     case cmStateEnums::EXECUTABLE:
       if (this->TargetLinkLanguage(config) == "Swift") {
         if (this->GeneratorTarget->IsExecutableWithExports()) {
-          const std::string flags =
-            this->Makefile->GetSafeDefinition("CMAKE_EXE_EXPORTS_Swift_FLAG");
-          cmExpandList(flags, linkCmds);
+          this->Makefile->GetDefExpandList("CMAKE_EXE_EXPORTS_Swift_FLAG",
+                                           linkCmds);
         }
       }
       break;
@@ -1027,8 +1025,8 @@
     gt->GetFullNameComponents(prefix, base, suffix, config);
     std::string dbg_suffix = ".dbg";
     // TODO: Where to document?
-    if (mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) {
-      dbg_suffix = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX");
+    if (auto d = mf->GetDefinition("CMAKE_DEBUG_SYMBOL_SUFFIX")) {
+      dbg_suffix = d;
     }
     vars["TARGET_PDB"] = base + suffix + dbg_suffix;
   }
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c77a85b..d406c99 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -29,6 +29,7 @@
 #include "cmNinjaNormalTargetGenerator.h"
 #include "cmNinjaUtilityTargetGenerator.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmRulePlaceholderExpander.h"
 #include "cmSourceFile.h"
@@ -749,9 +750,9 @@
     if (!mf->GetIsSourceFileTryCompile()) {
       rule.DepType = "gcc";
       rule.DepFile = "$DEP_FILE";
-      const std::string cl = mf->GetDefinition("CMAKE_C_COMPILER")
-        ? mf->GetSafeDefinition("CMAKE_C_COMPILER")
-        : mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
+      auto d = mf->GetDefinition("CMAKE_C_COMPILER");
+      const std::string cl =
+        d ? d : mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
       cldeps = cmStrCat('"', cmSystemTools::GetCMClDepsCommand(), "\" ", lang,
                         ' ', vars.Source, " $DEP_FILE $out \"",
                         mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDES_PREFIX"),
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index b0b7953..8d863c3 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -17,6 +17,7 @@
 #include "cmLocalNinjaGenerator.h"
 #include "cmNinjaTypes.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmSourceFile.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index a9adf99..a58e2f8 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -6,6 +6,7 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index b18c205..aa5abcb 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -15,13 +15,12 @@
 #include "cmExecutionStatus.h"
 #include "cmGeneratorExpression.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmSourceFile.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmTarget.h"
 
-using cmProp = const std::string*;
-
 namespace {
 /** \class cmDependInformation
  * \brief Store dependency information for a single source file.
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 4dff1d8..a82f421 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -318,6 +318,8 @@
   SELECT(POLICY, CMP0106, "The Documentation module is removed.", 3, 18, 0,   \
          cmPolicies::WARN)                                                    \
   SELECT(POLICY, CMP0107, "An ALIAS target cannot overwrite another target.", \
+         3, 18, 0, cmPolicies::WARN)                                          \
+  SELECT(POLICY, CMP0108, "A target cannot link to itself through an alias.", \
          3, 18, 0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
@@ -350,7 +352,8 @@
   F(CMP0095)                                                                  \
   F(CMP0099)                                                                  \
   F(CMP0104)                                                                  \
-  F(CMP0105)
+  F(CMP0105)                                                                  \
+  F(CMP0108)
 
 /** \class cmPolicies
  * \brief Handles changes in CMake behavior and policies
diff --git a/Source/cmProperty.h b/Source/cmProperty.h
index 80f131a..b0fcce7 100644
--- a/Source/cmProperty.h
+++ b/Source/cmProperty.h
@@ -5,6 +5,8 @@
 
 #include "cmConfigure.h" // IWYU pragma: keep
 
+#include <string>
+
 class cmProperty
 {
 public:
@@ -22,4 +24,6 @@
   };
 };
 
+using cmProp = const std::string*;
+
 #endif
diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h
index 40ac356..5fc46a2 100644
--- a/Source/cmPropertyMap.h
+++ b/Source/cmPropertyMap.h
@@ -10,7 +10,7 @@
 #include <utility>
 #include <vector>
 
-using cmProp = const std::string*;
+#include "cmProperty.h"
 
 /** \class cmPropertyMap
  * \brief String property map.
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index 48c4b10..795c2ee 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -5,6 +5,7 @@
 #include "cmCustomCommandLines.h"
 #include "cmExecutionStatus.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmSourceFile.h"
 #include "cmStringAlgorithms.h"
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index a32f3e7..3d4f5d7 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -13,6 +13,7 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmProcessOutput.h"
+#include "cmProperty.h"
 #include "cmQtAutoGen.h"
 #include "cmQtAutoGenInitializer.h"
 #include "cmState.h"
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 003a300..511a018 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -35,6 +35,7 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmQtAutoGen.h"
 #include "cmQtAutoGenGlobalInitializer.h"
 #include "cmSourceFile.h"
@@ -570,9 +571,8 @@
   if (this->GenTarget->GetPropertyAsBool("AUTOMOC_COMPILER_PREDEFINES") &&
       (this->QtVersion >= IntegerVersion(5, 8))) {
     // Command
-    cmExpandList(this->Makefile->GetSafeDefinition(
-                   "CMAKE_CXX_COMPILER_PREDEFINES_COMMAND"),
-                 this->Moc.PredefsCmd);
+    this->Makefile->GetDefExpandList("CMAKE_CXX_COMPILER_PREDEFINES_COMMAND",
+                                     this->Moc.PredefsCmd);
     // Header
     if (!this->Moc.PredefsCmd.empty()) {
       ConfigFileNames(this->Moc.PredefsFile,
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 00ac337..4f7131f 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -20,14 +20,13 @@
 #include "cmJsonObjectDictionary.h"
 #include "cmJsonObjects.h"
 #include "cmMessageType.h"
+#include "cmProperty.h"
 #include "cmServer.h"
 #include "cmServerDictionary.h"
 #include "cmState.h"
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-using cmProp = const std::string*; // just to silence IWYU
-
 // Get rid of some windows macros:
 #undef max
 
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 5c55427..354b4c3 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -5,6 +5,7 @@
 #include "cmExecutionStatus.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index e2dfdc1..e669015 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -11,14 +11,13 @@
 
 #include "cmCustomCommand.h"
 #include "cmListFileCache.h"
+#include "cmProperty.h"
 #include "cmPropertyMap.h"
 #include "cmSourceFileLocation.h"
 #include "cmSourceFileLocationKind.h"
 
 class cmMakefile;
 
-using cmProp = const std::string*;
-
 /** \class cmSourceFile
  * \brief Represent a class loaded from a makefile.
  *
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 18d8537..0b6b40f 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -26,8 +26,6 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-using cmProp = const std::string*;
-
 cmState::cmState()
 {
   this->CacheManager = cm::make_unique<cmCacheManager>();
diff --git a/Source/cmState.h b/Source/cmState.h
index 125e4dd..885496a 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -29,8 +29,6 @@
 class cmMessenger;
 class cmExecutionStatus;
 
-using cmProp = const std::string*;
-
 class cmState
 {
   friend class cmStateSnapshot;
diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h
index 8144160..765af6f 100644
--- a/Source/cmStateDirectory.h
+++ b/Source/cmStateDirectory.h
@@ -12,12 +12,11 @@
 #include "cmAlgorithms.h"
 #include "cmLinkedTree.h"
 #include "cmListFileCache.h"
+#include "cmProperty.h"
 #include "cmStatePrivate.h"
 #include "cmStateSnapshot.h"
 #include "cmStringAlgorithms.h"
 
-using cmProp = const std::string*;
-
 class cmStateDirectory
 {
   cmStateDirectory(
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index d79df6f..c223431 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -11,6 +11,7 @@
 
 #include "cmDefinitions.h"
 #include "cmListFileCache.h"
+#include "cmProperty.h"
 #include "cmPropertyMap.h"
 #include "cmState.h"
 #include "cmStateDirectory.h"
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 6bd47f7..f0ddb68 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -15,6 +15,7 @@
 #include "cmAlgorithms.h"
 #include "cmListFileCache.h"
 #include "cmPolicies.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmTargetLinkLibraryType.h"
@@ -28,8 +29,6 @@
 class cmSourceFile;
 class cmTargetInternals;
 
-using cmProp = const std::string*;
-
 /** \class cmTarget
  * \brief Represent a library or executable target loaded from a makefile.
  *
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 6325837..e714720 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -5,12 +5,11 @@
 #include "cmExecutionStatus.h"
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmTarget.h"
 #include "cmake.h"
 
-using cmProp = const std::string*;
-
 cmTargetPropCommandBase::cmTargetPropCommandBase(cmExecutionStatus& status)
   : Makefile(&status.GetMakefile())
   , Status(status)
diff --git a/Source/cmTargetPropertyComputer.h b/Source/cmTargetPropertyComputer.h
index 5387e00..f87b7c2 100644
--- a/Source/cmTargetPropertyComputer.h
+++ b/Source/cmTargetPropertyComputer.h
@@ -8,14 +8,13 @@
 #include <string>
 
 #include "cmListFileCache.h"
+#include "cmProperty.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 
 class cmMessenger;
 
-using cmProp = const std::string*;
-
 class cmTargetPropertyComputer
 {
 public:
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 4e41993..e10a8e2 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -12,6 +12,7 @@
 #include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 #include "cmOutputConverter.h"
+#include "cmProperty.h"
 #include "cmPropertyMap.h"
 #include "cmRange.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 329b3b9..64d71bc 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -9,6 +9,7 @@
 #include "cmDuration.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmProperty.h"
 #include "cmRange.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 5865a19..6de78ff 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -84,8 +84,8 @@
   std::string utilityDirectory =
     status.GetMakefile().GetCurrentBinaryDirectory();
   std::string exePath;
-  if (status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH")) {
-    exePath = status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH");
+  if (auto d = status.GetMakefile().GetDefinition("EXECUTABLE_OUTPUT_PATH")) {
+    exePath = d;
   }
   if (!exePath.empty()) {
     utilityDirectory = exePath;
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 65d5f10..162e807 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2286,9 +2286,7 @@
 
   // If any byproduct of makefile generation is missing we must re-run.
   std::vector<std::string> products;
-  if (const char* productStr = mf.GetDefinition("CMAKE_MAKEFILE_PRODUCTS")) {
-    cmExpandList(productStr, products);
-  }
+  mf.GetDefExpandList("CMAKE_MAKEFILE_PRODUCTS", products);
   for (std::string const& p : products) {
     if (!(cmSystemTools::FileExists(p) || cmSystemTools::FileIsSymlink(p))) {
       if (verbose) {
@@ -2303,11 +2301,8 @@
   // Get the set of dependencies and outputs.
   std::vector<std::string> depends;
   std::vector<std::string> outputs;
-  const char* dependsStr = mf.GetDefinition("CMAKE_MAKEFILE_DEPENDS");
-  const char* outputsStr = mf.GetDefinition("CMAKE_MAKEFILE_OUTPUTS");
-  if (dependsStr && outputsStr) {
-    cmExpandList(dependsStr, depends);
-    cmExpandList(outputsStr, outputs);
+  if (mf.GetDefExpandList("CMAKE_MAKEFILE_DEPENDS", depends)) {
+    mf.GetDefExpandList("CMAKE_MAKEFILE_OUTPUTS", outputs);
   }
   if (depends.empty() || outputs.empty()) {
     // Not enough information was provided to do the test.  Just rerun.
diff --git a/Source/cmake.h b/Source/cmake.h
index cd152cb..086ec87 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -22,6 +22,7 @@
 #include "cmInstalledFile.h"
 #include "cmListFileCache.h"
 #include "cmMessageType.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index b12990b..75280fb 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -18,6 +18,7 @@
 #include "cmDocumentationEntry.h" // IWYU pragma: keep
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
+#include "cmProperty.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.cmake
index 21921ef..0c7249a 100644
--- a/Tests/RunCMake/BuildDepends/GNU-AS.cmake
+++ b/Tests/RunCMake/BuildDepends/GNU-AS.cmake
@@ -5,6 +5,7 @@
 
 add_library(gnu_as STATIC gnu_as.s)
 target_include_directories(gnu_as PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_compile_definitions(gnu_as PRIVATE "TEST_DEF=Hello")
 
 file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
 set(check_pairs
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 868eb24..65d5e44 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -356,6 +356,7 @@
       CMAKE_CXX_COMPILER_VERSION
       CMAKE_CXX_STANDARD_DEFAULT
       CMake_TEST_CUDA
+      CMake_TEST_FILESYSTEM_1S
       CMAKE_OBJC_STANDARD_DEFAULT
       CMAKE_OBJCXX_STANDARD_DEFAULT
       )
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 24c3642..7d3c22b 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -111,6 +111,7 @@
 run_cmake(TARGET_PROPERTY-INCLUDE_DIRECTORIES)
 run_cmake(TARGET_PROPERTY-LOCATION)
 run_cmake(TARGET_PROPERTY-SOURCES)
+run_cmake(TARGET_PROPERTY-ALIAS_GLOBAL)
 run_cmake(LINK_ONLY-not-linking)
 run_cmake(TARGET_EXISTS-no-arg)
 run_cmake(TARGET_EXISTS-empty-arg)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL-check.cmake
new file mode 100644
index 0000000..0fbf837
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL-check.cmake
@@ -0,0 +1,6 @@
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/alias_global.txt alias_global)
+
+set(expected "TRUE(lib-global):TRUE;FALSE(lib-local):FALSE;TRUE(lib):FALSE")
+if(NOT alias_global STREQUAL expected)
+  set(RunCMake_TEST_FAILED "ALIAS_GLOBAL was:\n [[${alias_global}]]\nbut expected:\n [[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL.cmake
new file mode 100644
index 0000000..212c034
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL.cmake
@@ -0,0 +1,16 @@
+
+cmake_minimum_required(VERSION 3.17)
+
+add_library(lib-global SHARED IMPORTED GLOBAL)
+add_library(alias-lib-global ALIAS lib-global)
+
+add_library(lib-local SHARED IMPORTED)
+add_library(alias-lib-local ALIAS lib-local)
+
+add_library(lib SHARED IMPORTED)
+add_library(alias-lib ALIAS lib)
+# switch from local to global
+set_property (TARGET lib PROPERTY IMPORTED_GLOBAL TRUE)
+
+
+file(GENERATE OUTPUT alias_global.txt CONTENT "$<TARGET_PROPERTY:lib-global,IMPORTED_GLOBAL>($<TARGET_PROPERTY:alias-lib-global,ALIASED_TARGET>):$<TARGET_PROPERTY:alias-lib-global,ALIAS_GLOBAL>\n$<TARGET_PROPERTY:lib-local,IMPORTED_GLOBAL>($<TARGET_PROPERTY:alias-lib-local,ALIASED_TARGET>):$<TARGET_PROPERTY:alias-lib-local,ALIAS_GLOBAL>\n$<TARGET_PROPERTY:lib,IMPORTED_GLOBAL>($<TARGET_PROPERTY:alias-lib,ALIASED_TARGET>):$<TARGET_PROPERTY:alias-lib,ALIAS_GLOBAL>\n")
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 2d270c5..2454f25 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -31,6 +31,7 @@
    \* CMP0099
    \* CMP0104
    \* CMP0105
+   \* CMP0108
 
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/alias_targets/RunCMakeTest.cmake b/Tests/RunCMake/alias_targets/RunCMakeTest.cmake
index 676de08..4be1b9d 100644
--- a/Tests/RunCMake/alias_targets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/alias_targets/RunCMakeTest.cmake
@@ -12,6 +12,7 @@
 run_cmake(imported-target)
 run_cmake(alias-target)
 run_cmake(set_property)
+run_cmake(get_property)
 run_cmake(set_target_properties)
 run_cmake(target_link_libraries)
 run_cmake(target_include_directories)
diff --git a/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt
new file mode 100644
index 0000000..bfd9840
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+
+add_library(alias::import-local-subdir ALIAS import-local)
+
+check_property (alias::import-local-subdir ALIASED_TARGET "import-local")
+check_property (alias::import-local-subdir IMPORTED "TRUE")
+check_property (alias::import-local-subdir ALIAS_GLOBAL "FALSE")
+check_property (alias::import-local-subdir IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL")
diff --git a/Tests/RunCMake/alias_targets/get_property.cmake b/Tests/RunCMake/alias_targets/get_property.cmake
new file mode 100644
index 0000000..8a01c6f
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/get_property.cmake
@@ -0,0 +1,59 @@
+
+enable_language(CXX)
+
+function (check_property alias property value)
+  get_property (data TARGET ${alias} PROPERTY ${property})
+  if (NOT "${value}" STREQUAL "${data}")
+    message (SEND_ERROR "get_property(): Target property '${property}' from ALIAS '${alias}' has wrong value: '${data}' instead of '${value}'.")
+  endif()
+  get_target_property (data ${alias} ${property})
+  if (NOT "${value}" STREQUAL "${data}")
+    message (SEND_ERROR "get_target_property(): Target property '${property}' from ALIAS '${alias}' has wrong value: '${data}' instead of '${value}'.")
+  endif()
+endfunction()
+
+
+add_library(lib empty.cpp)
+set_property (TARGET lib PROPERTY LIB_PROPERTY "LIB")
+
+add_library(alias::lib ALIAS lib)
+
+check_property (alias::lib ALIASED_TARGET "lib")
+check_property (alias::lib IMPORTED "FALSE")
+check_property (alias::lib ALIAS_GLOBAL "TRUE")
+check_property (alias::lib LIB_PROPERTY "LIB")
+
+
+add_library(import-global SHARED IMPORTED GLOBAL)
+set_property (TARGET import-global PROPERTY IMPORT_GLOBAL_PROPERTY "IMPORT_GLOBAL")
+
+add_library(alias::import-global ALIAS import-global)
+
+check_property (alias::import-global ALIASED_TARGET "import-global")
+check_property (alias::import-global IMPORTED "TRUE")
+check_property (alias::import-global ALIAS_GLOBAL "TRUE")
+check_property (alias::import-global IMPORT_GLOBAL_PROPERTY "IMPORT_GLOBAL")
+
+
+add_library(import-local SHARED IMPORTED)
+set_property (TARGET import-local PROPERTY IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL")
+
+add_library(alias::import-local ALIAS import-local)
+
+check_property (alias::import-local ALIASED_TARGET "import-local")
+check_property (alias::import-local IMPORTED "TRUE")
+check_property (alias::import-local ALIAS_GLOBAL "FALSE")
+check_property (alias::import-local IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL")
+
+
+## upgrade imported target from local to global, alias stay local
+add_library(import-lib SHARED IMPORTED)
+add_library(alias::import-lib ALIAS import-lib)
+check_property (alias::import-lib IMPORTED_GLOBAL "FALSE")
+check_property (alias::import-lib ALIAS_GLOBAL "FALSE")
+set_property (TARGET import-lib PROPERTY IMPORTED_GLOBAL "TRUE")
+check_property (alias::import-lib IMPORTED_GLOBAL "TRUE")
+check_property (alias::import-lib ALIAS_GLOBAL "FALSE")
+
+
+add_subdirectory (get_property-subdir)
diff --git a/Tests/RunCMake/alias_targets/imported-target-stderr.txt b/Tests/RunCMake/alias_targets/imported-target-stderr.txt
index 465de03..8259c80 100644
--- a/Tests/RunCMake/alias_targets/imported-target-stderr.txt
+++ b/Tests/RunCMake/alias_targets/imported-target-stderr.txt
@@ -1,15 +1,2 @@
-^CMake Error at imported-target.cmake:[0-9]+ \(add_executable\):
-  add_executable cannot create ALIAS target \"alias-test-exe\" because target
-  \"test-exe\" is imported but not globally visible.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:[0-9]+ \(include\)
-+
-'alias-test-exe' does not exist![?]
-*
-CMake Error at imported-target.cmake:[0-9]+ \(add_library\):
-  add_library cannot create ALIAS target "alias-test-lib" because target
-  "test-lib" is imported but not globally visible.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:[0-9]+ \(include\)
-+
-'alias-test-lib' does not exist![?]$
+^'alias-test-exe' is an alias for 'test-exe' and its name-property contains 'test-exe'.
+'alias-test-lib' is an alias for 'test-lib' and its name-property contains 'test-lib'.$
diff --git a/Tests/RunCMake/alias_targets/imported-target-subdir1/CMakeLists.txt b/Tests/RunCMake/alias_targets/imported-target-subdir1/CMakeLists.txt
new file mode 100644
index 0000000..bec05b3
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/imported-target-subdir1/CMakeLists.txt
@@ -0,0 +1,6 @@
+
+add_executable(alias-test-exe-subdir1 ALIAS test-exe)
+add_executable(alias-test-exe-local ALIAS test-exe)
+
+add_library(alias-test-lib-subdir1 ALIAS test-lib)
+add_library(alias-test-lib-local ALIAS test-lib)
diff --git a/Tests/RunCMake/alias_targets/imported-target-subdir2/CMakeLists.txt b/Tests/RunCMake/alias_targets/imported-target-subdir2/CMakeLists.txt
new file mode 100644
index 0000000..23c85ba
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/imported-target-subdir2/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+add_executable(alias-test-exe-subdir2 ALIAS test-exe)
+add_executable(alias-test-exe-local ALIAS test-exe)
+
+add_library(alias-test-lib-subdir2 ALIAS test-lib)
+add_library(alias-test-lib-local ALIAS test-lib)
+
+
+foreach (item IN ITEMS exe lib)
+  get_property (aliasedTarget TARGET alias-test-${item}-local PROPERTY ALIASED_TARGET)
+  if (NOT aliasedTarget STREQUAL "test-${item}")
+    message (SEND_ERROR "Wrong aliased target '${aliasedTarget}' for ALIAS 'alias-test-${item}-local'.")
+  endif()
+endforeach()
+
+foreach (item IN ITEMS exe lib)
+  if (TARGET alias-test-${item}-subdir1)
+    message (SEND_ERROR "ALIAS 'alias-test-${item}-subdir1' unexpectedly defined.")
+  endif()
+endforeach()
diff --git a/Tests/RunCMake/alias_targets/imported-target.cmake b/Tests/RunCMake/alias_targets/imported-target.cmake
index bb682fe..fa6f8d3 100644
--- a/Tests/RunCMake/alias_targets/imported-target.cmake
+++ b/Tests/RunCMake/alias_targets/imported-target.cmake
@@ -44,3 +44,14 @@
 else()
     message("'alias-test-lib' does not exist!?")
 endif()
+
+add_subdirectory (imported-target-subdir1)
+add_subdirectory (imported-target-subdir2)
+
+foreach (alias IN ITEMS exe-local lib-local
+                        exe-subdir1 lib-subdir1
+                        exe-subdir2 lib-subdir2)
+  if (TARGET alias-test-${alias})
+    message (SEND_ERROR "ALIAS 'alias-test-${alias}' unexpectedly defined.")
+  endif()
+endforeach()
diff --git a/Tests/RunCMake/target_link_libraries/AliasTargets.cmake b/Tests/RunCMake/target_link_libraries/AliasTargets.cmake
new file mode 100644
index 0000000..73f8a7d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/AliasTargets.cmake
@@ -0,0 +1,36 @@
+
+cmake_minimum_required(VERSION 3.16...3.17)
+
+enable_language(C)
+
+add_library (func SHARED func.c)
+
+set (binary_dir "${CMAKE_BINARY_DIR}")
+get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if (is_multi_config)
+  string (APPEND binary_dir "/Release")
+endif()
+
+
+add_library(import-local SHARED IMPORTED)
+set_property(TARGET import-local PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}")
+set_property(TARGET import-local PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+add_library(alias-local ALIAS import-local)
+
+add_library (lib-local SHARED lib.c)
+target_link_libraries (lib-local PRIVATE import-local)
+
+add_executable (main-local main.c)
+target_link_libraries (main-local PRIVATE import-local)
+
+
+add_library(import-global SHARED IMPORTED GLOBAL)
+set_property(TARGET import-global PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}")
+set_property(TARGET import-global PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+add_library(alias-global ALIAS import-global)
+
+add_library (lib-global SHARED lib.c)
+target_link_libraries (lib-global PRIVATE import-global)
+
+add_executable (main-global main.c)
+target_link_libraries (main-global PRIVATE import-global)
diff --git a/Tests/RunCMake/alias_targets/imported-target-result.txt b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt
similarity index 100%
rename from Tests/RunCMake/alias_targets/imported-target-result.txt
rename to Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt
new file mode 100644
index 0000000..7389eff
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at CMP0108-self-link.cmake:[0-9]+ \(add_library\):
+  Target "foo" links to itself.
+Call Stack \(most recent call first\):
+  CMP0108-NEW-self-link.cmake:[0-9]+ \(include\)
+  CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake
new file mode 100644
index 0000000..4ee9621
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0108 NEW)
+
+include (CMP0108-self-link.cmake)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake
new file mode 100644
index 0000000..813104a
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0108 OLD)
+
+include (CMP0108-self-link.cmake)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
new file mode 100644
index 0000000..07a3490
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
@@ -0,0 +1,9 @@
+
+cmake_policy (SET CMP0038 NEW)
+cmake_policy (SET CMP0042 NEW)
+
+enable_language(C)
+
+add_library(foo SHARED lib.c)
+add_library(Bar::foo ALIAS foo)
+target_link_libraries(foo PRIVATE Bar::foo)
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index fb223ab..1f4077c 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -19,6 +19,8 @@
 run_cmake(CMP0079-link-OLD)
 run_cmake(CMP0079-link-NEW)
 run_cmake(CMP0079-link-NEW-bogus)
+run_cmake(CMP0108-OLD-self-link)
+run_cmake(CMP0108-NEW-self-link)
 run_cmake(ImportedTarget)
 run_cmake(ImportedTargetFailure)
 run_cmake(MixedSignature)
@@ -28,6 +30,29 @@
 run_cmake(StaticPrivateDepNotTarget)
 run_cmake(UNKNOWN-IMPORTED-GLOBAL)
 run_cmake(empty_keyword_args)
+
+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()
+
+set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+  set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+endif()
+run_cmake(AliasTargets)
+run_cmake_target(AliasTargets func func --config Release)
+run_cmake_target(AliasTargets lib-local lib-local --config Release)
+run_cmake_target(AliasTargets main-local main-local --config Release)
+run_cmake_target(AliasTargets lib-global lib-global --config Release)
+run_cmake_target(AliasTargets main-global main-global --config Release)
+unset(RunCMake_TEST_OPTIONS)
+unset(RunCMake_TEST_OUTPUT_MERGE)
+
 run_cmake(genex_LINK_LANGUAGE-bad-usage)
 
 if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake")
@@ -35,15 +60,6 @@
   run_cmake(genex_LINK_LANGUAGE-bad-mix-lang)
   run_cmake(genex_LINK_LANG_AND_ID-bad-mix-lang)
 
-  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()
-
   set(RunCMake_TEST_OUTPUT_MERGE TRUE)
   if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
     set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index bee9e5b..82c55cc 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -83,13 +83,17 @@
 
   message(STATUS "RerunCMake: first configuration...")
   run_cmake(RerunCMake)
-  run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+  if(NOT CMake_TEST_FILESYSTEM_1S)
+    run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+  endif()
 
   execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
   message(STATUS "RerunCMake: modify try_compile input...")
   file(WRITE "${in_tc}" "does-not-compile\n")
   run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .)
-  run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+  if(NOT CMake_TEST_FILESYSTEM_1S)
+    run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+  endif()
 
   unset(RunCMake_TEST_BINARY_DIR)
   unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Utilities/cmThirdPartyChecks.cmake b/Utilities/cmThirdPartyChecks.cmake
index e3ce469..0b57940 100644
--- a/Utilities/cmThirdPartyChecks.cmake
+++ b/Utilities/cmThirdPartyChecks.cmake
@@ -260,18 +260,6 @@
   # curl and expat: stdlib.h, stdarg.h, string.h, float.h
   set(STDC_HEADERS 1)
 
-  # FIXME: Teach libarchive to use #if instead of configure-time checks.
-  set(HAVE_DECL_INT32_MAX 1)
-  set(HAVE_DECL_INT32_MIN 1)
-  set(HAVE_DECL_INT64_MAX 1)
-  set(HAVE_DECL_INT64_MIN 1)
-  set(HAVE_DECL_INTMAX_MAX 1)
-  set(HAVE_DECL_INTMAX_MIN 1)
-  set(HAVE_DECL_SIZE_MAX 1)
-  set(HAVE_DECL_UINT32_MAX 1)
-  set(HAVE_DECL_UINT64_MAX 1)
-  set(HAVE_DECL_UINTMAX_MAX 1)
-
   # libarchive looks for external hash implementations.
   set(ARCHIVE_CRYPTO_MD5_LIBC 0)
   set(ARCHIVE_CRYPTO_MD5_LIBMD 0)
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index c90e768..90d104f 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -975,18 +975,8 @@
 
 check_type_size(size_t  SIZEOF_SIZE_T)
 check_type_size(ssize_t  SIZEOF_SSIZE_T)
-check_type_size("long long"  SIZEOF_LONG_LONG)
-check_type_size("long"  SIZEOF_LONG)
-check_type_size("short"  SIZEOF_SHORT)
-check_type_size("int"  SIZEOF_INT)
-check_type_size("__int64"  SIZEOF___INT64)
 check_type_size("time_t"  SIZEOF_TIME_T)
 
-if(HAVE_SIZEOF_LONG_LONG)
-  set(HAVE_LONGLONG 1)
-  set(HAVE_LL 1)
-endif()
-
 find_file(RANDOM_FILE urandom /dev)
 mark_as_advanced(RANDOM_FILE)
 
diff --git a/Utilities/cmcurl/lib/curl_config.h.cmake b/Utilities/cmcurl/lib/curl_config.h.cmake
index ab8f225..aa52b6a 100644
--- a/Utilities/cmcurl/lib/curl_config.h.cmake
+++ b/Utilities/cmcurl/lib/curl_config.h.cmake
@@ -1,5 +1,7 @@
 /* lib/curl_config.h.in.  Generated somehow by cmake.  */
 
+#include <cm3p/kwiml/abi.h>
+
 /* when building libcurl itself */
 #cmakedefine BUILDING_LIBCURL 1
 
@@ -404,9 +406,6 @@
 /* if brotli is available */
 #cmakedefine HAVE_BROTLI 1
 
-/* if your compiler supports LL */
-#cmakedefine HAVE_LL 1
-
 /* Define to 1 if you have the <locale.h> header file. */
 #cmakedefine HAVE_LOCALE_H 1
 
@@ -414,7 +413,9 @@
 #cmakedefine HAVE_LOCALTIME_R 1
 
 /* Define to 1 if the compiler supports the 'long long' data type. */
-#cmakedefine HAVE_LONGLONG 1
+#if KWIML_ABI_SIZEOF_LONG_LONG
+#  define HAVE_LONGLONG 1
+#endif
 
 /* Define to 1 if you have the malloc.h header file. */
 #cmakedefine HAVE_MALLOC_H 1
@@ -883,19 +884,21 @@
 */
 
 /* The size of `int', as computed by sizeof. */
-${SIZEOF_INT_CODE}
+#define SIZEOF_INT KWIML_ABI_SIZEOF_INT
 
 /* The size of `short', as computed by sizeof. */
-${SIZEOF_SHORT_CODE}
+#define SIZEOF_SHORT KWIML_ABI_SIZEOF_SHORT
 
 /* The size of `long', as computed by sizeof. */
-${SIZEOF_LONG_CODE}
+#define SIZEOF_LONG KWIML_ABI_SIZEOF_LONG
 
 /* The size of `long long', as computed by sizeof. */
-${SIZEOF_LONG_LONG_CODE}
+#define SIZEOF_LONG_LONG KWIML_ABI_SIZEOF_LONG_LONG
 
 /* The size of `__int64', as computed by sizeof. */
-${SIZEOF___INT64_CODE}
+#if KWIML_ABI_SIZEOF___INT64
+#  define SIZEOF___INT64 KWIML_ABI_SIZEOF___INT64
+#endif
 
 /* The size of `off_t', as computed by sizeof. */
 ${SIZEOF_OFF_T_CODE}
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index d4729b5..bfcaf30 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -690,7 +690,6 @@
 
 LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
 LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H)
-LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
 LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H)
 LA_CHECK_INCLUDE_FILE("langinfo.h" HAVE_LANGINFO_H)
 LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H)
@@ -716,7 +715,6 @@
 LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H)
 LA_CHECK_INCLUDE_FILE("spawn.h" HAVE_SPAWN_H)
 LA_CHECK_INCLUDE_FILE("stdarg.h" HAVE_STDARG_H)
-LA_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
 LA_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
 LA_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
 LA_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
@@ -1488,27 +1486,9 @@
 #
 # Check defines
 #
-SET(headers "limits.h")
-IF(HAVE_STDINT_H)
-  LIST(APPEND headers "stdint.h")
-ENDIF(HAVE_STDINT_H)
-IF(HAVE_INTTYPES_H)
-  LIST(APPEND headers "inttypes.h")
-ENDIF(HAVE_INTTYPES_H)
 CHECK_SYMBOL_EXISTS(EFTYPE           "errno.h"    HAVE_EFTYPE)
 CHECK_SYMBOL_EXISTS(EILSEQ           "errno.h"    HAVE_EILSEQ)
 CHECK_SYMBOL_EXISTS(D_MD_ORDER       "langinfo.h" HAVE_D_MD_ORDER)
-CHECK_SYMBOL_EXISTS(INT32_MAX        "${headers}" HAVE_DECL_INT32_MAX)
-CHECK_SYMBOL_EXISTS(INT32_MIN        "${headers}" HAVE_DECL_INT32_MIN)
-CHECK_SYMBOL_EXISTS(INT64_MAX        "${headers}" HAVE_DECL_INT64_MAX)
-CHECK_SYMBOL_EXISTS(INT64_MIN        "${headers}" HAVE_DECL_INT64_MIN)
-CHECK_SYMBOL_EXISTS(INTMAX_MAX       "${headers}" HAVE_DECL_INTMAX_MAX)
-CHECK_SYMBOL_EXISTS(INTMAX_MIN       "${headers}" HAVE_DECL_INTMAX_MIN)
-CHECK_SYMBOL_EXISTS(UINT32_MAX       "${headers}" HAVE_DECL_UINT32_MAX)
-CHECK_SYMBOL_EXISTS(UINT64_MAX       "${headers}" HAVE_DECL_UINT64_MAX)
-CHECK_SYMBOL_EXISTS(UINTMAX_MAX      "${headers}" HAVE_DECL_UINTMAX_MAX)
-CHECK_SYMBOL_EXISTS(SIZE_MAX         "${headers}" HAVE_DECL_SIZE_MAX)
-CHECK_SYMBOL_EXISTS(SSIZE_MAX        "limits.h"   HAVE_DECL_SSIZE_MAX)
 
 #
 # Check struct members
@@ -1557,33 +1537,6 @@
 CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec
     "sys/types.h;sys/time.h;time.h" TIME_WITH_SYS_TIME)
 
-#
-# Check for integer types
-#
-#
-CHECK_TYPE_SIZE("short" SIZE_OF_SHORT)
-CHECK_TYPE_SIZE("int" SIZE_OF_INT)
-CHECK_TYPE_SIZE("long" SIZE_OF_LONG)
-CHECK_TYPE_SIZE("long long"     SIZE_OF_LONG_LONG)
-
-CHECK_TYPE_SIZE("unsigned short" SIZE_OF_UNSIGNED_SHORT)
-CHECK_TYPE_SIZE("unsigned" SIZE_OF_UNSIGNED)
-CHECK_TYPE_SIZE("unsigned long" SIZE_OF_UNSIGNED_LONG)
-CHECK_TYPE_SIZE("unsigned long long" SIZE_OF_UNSIGNED_LONG_LONG)
-
-CHECK_TYPE_SIZE("__int64" __INT64)
-CHECK_TYPE_SIZE("unsigned __int64" UNSIGNED___INT64)
-
-CHECK_TYPE_SIZE(int16_t INT16_T)
-CHECK_TYPE_SIZE(int32_t INT32_T)
-CHECK_TYPE_SIZE(int64_t INT64_T)
-CHECK_TYPE_SIZE(intmax_t INTMAX_T)
-CHECK_TYPE_SIZE(uint8_t UINT8_T)
-CHECK_TYPE_SIZE(uint16_t UINT16_T)
-CHECK_TYPE_SIZE(uint32_t UINT32_T)
-CHECK_TYPE_SIZE(uint64_t UINT64_T)
-CHECK_TYPE_SIZE(uintmax_t UINTMAX_T)
-
 CHECK_TYPE_SIZE(dev_t       DEV_T)
 IF(NOT HAVE_DEV_T)
   IF(MSVC)
@@ -1659,24 +1612,6 @@
   ENDIF(WIN32)
 ENDIF(NOT HAVE_PID_T)
 #
-CHECK_TYPE_SIZE(intptr_t   INTPTR_T)
-IF(NOT HAVE_INTPTR_T)
-  IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
-    SET(intptr_t "int64_t")
-  ELSE()
-    SET(intptr_t "int32_t")
-  ENDIF()
-ENDIF(NOT HAVE_INTPTR_T)
-#
-CHECK_TYPE_SIZE(uintptr_t   UINTPTR_T)
-IF(NOT HAVE_UINTPTR_T)
-  IF("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
-    SET(uintptr_t "uint64_t")
-  ELSE()
-    SET(uintptr_t "uint32_t")
-  ENDIF()
-ENDIF(NOT HAVE_UINTPTR_T)
-#
 CHECK_TYPE_SIZE(wchar_t     SIZEOF_WCHAR_T)
 IF(HAVE_SIZEOF_WCHAR_T)
   SET(HAVE_WCHAR_T 1)
diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in
index bcda4c3..e889781 100644
--- a/Utilities/cmlibarchive/build/cmake/config.h.in
+++ b/Utilities/cmlibarchive/build/cmake/config.h.in
@@ -7,178 +7,6 @@
  * Ensure we have C99-style int64_t, etc, all defined.
  */
 
-/* First, we need to know if the system has already defined them. */
-#cmakedefine HAVE_INT16_T
-#cmakedefine HAVE_INT32_T
-#cmakedefine HAVE_INT64_T
-#cmakedefine HAVE_INTMAX_T
-
-#cmakedefine HAVE_UINT8_T
-#cmakedefine HAVE_UINT16_T
-#cmakedefine HAVE_UINT32_T
-#cmakedefine HAVE_UINT64_T
-#cmakedefine HAVE_UINTMAX_T
-
-/* We might have the types we want under other spellings. */
-#cmakedefine HAVE___INT64
-#cmakedefine HAVE_U_INT64_T
-#cmakedefine HAVE_UNSIGNED___INT64
-
-/* The sizes of various standard integer types. */
-@SIZE_OF_SHORT_CODE@
-@SIZE_OF_INT_CODE@
-@SIZE_OF_LONG_CODE@
-@SIZE_OF_LONG_LONG_CODE@
-@SIZE_OF_UNSIGNED_SHORT_CODE@
-@SIZE_OF_UNSIGNED_CODE@
-@SIZE_OF_UNSIGNED_LONG_CODE@
-@SIZE_OF_UNSIGNED_LONG_LONG_CODE@
-
-/*
- * If we lack int64_t, define it to the first of __int64, int, long, and long long
- * that exists and is the right size.
- */
-#if !defined(HAVE_INT64_T) && defined(HAVE___INT64)
-typedef __int64 int64_t;
-#define HAVE_INT64_T
-#endif
-
-#if !defined(HAVE_INT64_T) && SIZE_OF_INT == 8
-typedef int int64_t;
-#define HAVE_INT64_T
-#endif
-
-#if !defined(HAVE_INT64_T) && SIZE_OF_LONG == 8
-typedef long int64_t;
-#define HAVE_INT64_T
-#endif
-
-#if !defined(HAVE_INT64_T) && SIZE_OF_LONG_LONG == 8
-typedef long long int64_t;
-#define HAVE_INT64_T
-#endif
-
-#if !defined(HAVE_INT64_T)
-#error No 64-bit integer type was found.
-#endif
-
-/*
- * Similarly for int32_t
- */
-#if !defined(HAVE_INT32_T) && SIZE_OF_INT == 4
-typedef int int32_t;
-#define HAVE_INT32_T
-#endif
-
-#if !defined(HAVE_INT32_T) && SIZE_OF_LONG == 4
-typedef long int32_t;
-#define HAVE_INT32_T
-#endif
-
-#if !defined(HAVE_INT32_T)
-#error No 32-bit integer type was found.
-#endif
-
-/*
- * Similarly for int16_t
- */
-#if !defined(HAVE_INT16_T) && SIZE_OF_INT == 2
-typedef int int16_t;
-#define HAVE_INT16_T
-#endif
-
-#if !defined(HAVE_INT16_T) && SIZE_OF_SHORT == 2
-typedef short int16_t;
-#define HAVE_INT16_T
-#endif
-
-#if !defined(HAVE_INT16_T)
-#error No 16-bit integer type was found.
-#endif
-
-/*
- * Similarly for uint64_t
- */
-#if !defined(HAVE_UINT64_T) && defined(HAVE_UNSIGNED___INT64)
-typedef unsigned __int64 uint64_t;
-#define HAVE_UINT64_T
-#endif
-
-#if !defined(HAVE_UINT64_T) && SIZE_OF_UNSIGNED == 8
-typedef unsigned uint64_t;
-#define HAVE_UINT64_T
-#endif
-
-#if !defined(HAVE_UINT64_T) && SIZE_OF_UNSIGNED_LONG == 8
-typedef unsigned long uint64_t;
-#define HAVE_UINT64_T
-#endif
-
-#if !defined(HAVE_UINT64_T) && SIZE_OF_UNSIGNED_LONG_LONG == 8
-typedef unsigned long long uint64_t;
-#define HAVE_UINT64_T
-#endif
-
-#if !defined(HAVE_UINT64_T)
-#error No 64-bit unsigned integer type was found.
-#endif
-
-
-/*
- * Similarly for uint32_t
- */
-#if !defined(HAVE_UINT32_T) && SIZE_OF_UNSIGNED == 4
-typedef unsigned uint32_t;
-#define HAVE_UINT32_T
-#endif
-
-#if !defined(HAVE_UINT32_T) && SIZE_OF_UNSIGNED_LONG == 4
-typedef unsigned long uint32_t;
-#define HAVE_UINT32_T
-#endif
-
-#if !defined(HAVE_UINT32_T)
-#error No 32-bit unsigned integer type was found.
-#endif
-
-/*
- * Similarly for uint16_t
- */
-#if !defined(HAVE_UINT16_T) && SIZE_OF_UNSIGNED == 2
-typedef unsigned uint16_t;
-#define HAVE_UINT16_T
-#endif
-
-#if !defined(HAVE_UINT16_T) && SIZE_OF_UNSIGNED_SHORT == 2
-typedef unsigned short uint16_t;
-#define HAVE_UINT16_T
-#endif
-
-#if !defined(HAVE_UINT16_T)
-#error No 16-bit unsigned integer type was found.
-#endif
-
-/*
- * Similarly for uint8_t
- */
-#if !defined(HAVE_UINT8_T)
-typedef unsigned char uint8_t;
-#define HAVE_UINT8_T
-#endif
-
-#if !defined(HAVE_UINT16_T)
-#error No 8-bit unsigned integer type was found.
-#endif
-
-/* Define intmax_t and uintmax_t if they are not already defined. */
-#if !defined(HAVE_INTMAX_T)
-typedef int64_t intmax_t;
-#endif
-
-#if !defined(HAVE_UINTMAX_T)
-typedef uint64_t uintmax_t;
-#endif
-
 /* Define ZLIB_WINAPI if zlib was built on Visual Studio. */
 #cmakedefine ZLIB_WINAPI 1
 
@@ -426,58 +254,14 @@
    don't. */
 #cmakedefine HAVE_DECL_ACL_USER 1
 
-/* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_INT32_MAX 1
-
-/* Define to 1 if you have the declaration of `INT32_MIN', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_INT32_MIN 1
-
-/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_INT64_MAX 1
-
-/* Define to 1 if you have the declaration of `INT64_MIN', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_INT64_MIN 1
-
-/* Define to 1 if you have the declaration of `INTMAX_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_INTMAX_MAX 1
-
-/* Define to 1 if you have the declaration of `INTMAX_MIN', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_INTMAX_MIN 1
-
 /* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
    */
 #cmakedefine HAVE_DECL_SETACL 1
 
-/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_SIZE_MAX 1
-
-/* Define to 1 if you have the declaration of `SSIZE_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_SSIZE_MAX 1
-
 /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
    don't. */
 #cmakedefine HAVE_DECL_STRERROR_R 1
 
-/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_UINT32_MAX 1
-
-/* Define to 1 if you have the declaration of `UINT64_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_UINT64_MAX 1
-
-/* Define to 1 if you have the declaration of `UINTMAX_MAX', and to 0 if you
-   don't. */
-#cmakedefine HAVE_DECL_UINTMAX_MAX 1
-
 /* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
    you don't. */
 #cmakedefine HAVE_DECL_XATTR_NOFOLLOW 1
@@ -647,9 +431,6 @@
 /* Define to 1 if you have the <iconv.h> header file. */
 #cmakedefine HAVE_ICONV_H 1
 
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H 1
-
 /* Define to 1 if you have the <io.h> header file. */
 #cmakedefine HAVE_IO_H 1
 
@@ -955,9 +736,6 @@
 /* Define to 1 if you have the <stdarg.h> header file. */
 #cmakedefine HAVE_STDARG_H 1
 
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H 1
-
 /* Define to 1 if you have the <stdlib.h> header file. */
 #cmakedefine HAVE_STDLIB_H 1
 
@@ -1337,8 +1115,45 @@
 /* Define to `int' if <sys/types.h> doesn't define. */
 #cmakedefine uid_t ${uid_t}
 
-/* Define to `int' if <sys/types.h> does not define. */
-#cmakedefine intptr_t ${intptr_t}
+#include <cm3p/kwiml/int.h>
 
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#cmakedefine uintptr_t ${uintptr_t}
+#ifndef KWIML_INT_HAVE_INT64_T
+# define int64_t KWIML_INT_int64_t
+#endif
+#ifndef KWIML_INT_HAVE_INT32_T
+# define int32_t KWIML_INT_int32_t
+#endif
+#ifndef KWIML_INT_HAVE_INT16_T
+# define int16_t KWIML_INT_int16_t
+#endif
+#ifndef KWIML_INT_HAVE_INT8_T
+# define int8_t KWIML_INT_int8_t
+#endif
+#ifndef KWIML_INT_HAVE_INTPTR_T
+# define intptr_t KWIML_INT_intptr_t
+#endif
+#ifndef KWIML_INT_HAVE_UINT64_T
+# define uint64_t KWIML_INT_uint64_t
+#endif
+#ifndef KWIML_INT_HAVE_UINT32_T
+# define uint32_t KWIML_INT_uint32_t
+#endif
+#ifndef KWIML_INT_HAVE_UINT16_T
+# define uint16_t KWIML_INT_uint16_t
+#endif
+#ifndef KWIML_INT_HAVE_UINT8_T
+# define uint8_t KWIML_INT_uint8_t
+#endif
+#ifndef KWIML_INT_HAVE_UINTPTR_T
+# define uintptr_t KWIML_INT_uintptr_t
+#endif
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#ifdef KWIML_INT_HAVE_STDINT_H
+# define HAVE_STDINT_H 1
+#endif
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#ifdef KWIML_INT_HAVE_INTTYPES_H
+# define HAVE_INTTYPES_H 1
+#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_platform.h b/Utilities/cmlibarchive/libarchive/archive_platform.h
index 90db31f..3273930 100644
--- a/Utilities/cmlibarchive/libarchive/archive_platform.h
+++ b/Utilities/cmlibarchive/libarchive/archive_platform.h
@@ -107,56 +107,44 @@
 
 /* Borland warns about its own constants!  */
 #if defined(__BORLANDC__)
-# if HAVE_DECL_UINT64_MAX
-#  undef	UINT64_MAX
-#  undef	HAVE_DECL_UINT64_MAX
-# endif
-# if HAVE_DECL_UINT64_MIN
-#  undef	UINT64_MIN
-#  undef	HAVE_DECL_UINT64_MIN
-# endif
-# if HAVE_DECL_INT64_MAX
-#  undef	INT64_MAX
-#  undef	HAVE_DECL_INT64_MAX
-# endif
-# if HAVE_DECL_INT64_MIN
-#  undef	INT64_MIN
-#  undef	HAVE_DECL_INT64_MIN
-# endif
+# undef	UINT64_MAX
+# undef	UINT64_MIN
+# undef	INT64_MAX
+# undef	INT64_MIN
 #endif
 
 /* Some platforms lack the standard *_MAX definitions. */
-#if !HAVE_DECL_SIZE_MAX
+#ifndef SIZE_MAX
 #define	SIZE_MAX (~(size_t)0)
 #endif
-#if !HAVE_DECL_SSIZE_MAX
+#ifndef SSIZE_MAX
 #define	SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
 #endif
-#if !HAVE_DECL_UINT32_MAX
+#ifndef UINT32_MAX
 #define	UINT32_MAX (~(uint32_t)0)
 #endif
-#if !HAVE_DECL_INT32_MAX
+#ifndef INT32_MAX
 #define	INT32_MAX ((int32_t)(UINT32_MAX >> 1))
 #endif
-#if !HAVE_DECL_INT32_MIN
+#ifndef INT32_MIN
 #define	INT32_MIN ((int32_t)(~INT32_MAX))
 #endif
-#if !HAVE_DECL_UINT64_MAX
+#ifndef UINT64_MAX
 #define	UINT64_MAX (~(uint64_t)0)
 #endif
-#if !HAVE_DECL_INT64_MAX
+#ifndef INT64_MAX
 #define	INT64_MAX ((int64_t)(UINT64_MAX >> 1))
 #endif
-#if !HAVE_DECL_INT64_MIN
+#ifndef INT64_MIN
 #define	INT64_MIN ((int64_t)(~INT64_MAX))
 #endif
-#if !HAVE_DECL_UINTMAX_MAX
+#ifndef UINTMAX_MAX
 #define	UINTMAX_MAX (~(uintmax_t)0)
 #endif
-#if !HAVE_DECL_INTMAX_MAX
+#ifndef INTMAX_MAX
 #define	INTMAX_MAX ((intmax_t)(UINTMAX_MAX >> 1))
 #endif
-#if !HAVE_DECL_INTMAX_MIN
+#ifndef INTMAX_MIN
 #define	INTMAX_MIN ((intmax_t)(~INTMAX_MAX))
 #endif