[Cmake-commits] CMake branch, master, updated. v3.11.1-536-g423de69

Kitware Robot kwrobot at kitware.com
Thu Apr 19 08:25:06 EDT 2018


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

The branch, master has been updated
       via  423de692f91fada3b060359dd52608de29ac3a3a (commit)
       via  c4a2059eae1473db68fad8980d15d8200cc3e739 (commit)
       via  3c6388553aef091556b64daf9bcb6f64fbdcdba2 (commit)
       via  6c13ddd6cb0c51afd2789db34b41416b5706336b (commit)
       via  541b53375de703ad5bb7a90cd72beefbb5452f96 (commit)
       via  bdf660cab5234aa5e533691b0fe03c0766c9a9f0 (commit)
       via  909ab169eb83f0a60f717aa87c5549e77e09e35f (commit)
       via  a61ae3fb8017a297bd3f3efc447a1f1f29619bdf (commit)
       via  391a5837ee859c749c2a988eb873a2a9a2c58f91 (commit)
       via  3c47ac5b2571939f7d987d9f23a9969b1f67f46e (commit)
       via  459739678443d2d2074d6e1475e4267c6c110e05 (commit)
       via  e95b3fd9bbca94cb5f217847031c9c8f393aee78 (commit)
       via  84f9f63fccdadb9b8a0bdb3260a0c7a3f71cb251 (commit)
       via  9fa0f2eb5638b5863c573c0ef1922d4cb2c729d5 (commit)
       via  d67962c55a4be2653d40b27c4f5fc38fc5c223b0 (commit)
      from  67752aece33ca0643a354ce0f2037afc66d15bfc (commit)

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

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=423de692f91fada3b060359dd52608de29ac3a3a
commit 423de692f91fada3b060359dd52608de29ac3a3a
Merge: c4a2059 bdf660c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 19 12:24:32 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Apr 19 08:24:40 2018 -0400

    Merge topic 'InstallRequiredSystemLibraries-mfcm'
    
    bdf660cab5 InstallRequiredSystemLibraries: Check for existence of mfcm dlls
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1980


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4a2059eae1473db68fad8980d15d8200cc3e739
commit c4a2059eae1473db68fad8980d15d8200cc3e739
Merge: 3c63885 d67962c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 19 12:23:48 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Apr 19 08:23:52 2018 -0400

    Merge topic 'depfile-flag'
    
    d67962c55a SunPro,XL: Add depfile flags to support Ninja generator
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1969


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c6388553aef091556b64daf9bcb6f64fbdcdba2
commit 3c6388553aef091556b64daf9bcb6f64fbdcdba2
Merge: 6c13ddd a61ae3f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 19 12:23:05 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Apr 19 08:23:08 2018 -0400

    Merge topic 'CheckIncludeFile-required-libs'
    
    a61ae3fb80 CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES
    391a5837ee cmake_policy: Add undocumented PARENT_SCOPE option to GET
    3c47ac5b25 OpenWatcom: Add workaround for lack of error on missing library
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1978


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c13ddd6cb0c51afd2789db34b41416b5706336b
commit 6c13ddd6cb0c51afd2789db34b41416b5706336b
Merge: 541b533 909ab16
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 19 12:20:56 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Apr 19 08:21:00 2018 -0400

    Merge topic 'doc-synopsis-markup'
    
    909ab169eb Help: Fix command-line synopsis markup syntax
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1981


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=541b53375de703ad5bb7a90cd72beefbb5452f96
commit 541b53375de703ad5bb7a90cd72beefbb5452f96
Merge: 67752ae 4597396
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 19 12:20:08 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Apr 19 08:20:15 2018 -0400

    Merge topic '17870-effective-system-name'
    
    4597396784 Apple: Use include_guard() within compiler config
    e95b3fd9bb Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info
    84f9f63fcc Modules: Introduce CMAKE_EFFECTIVE_SYSTEM_NAME to lookup compiler info
    9fa0f2eb56 CMakeFindPackageMode: Perform platform-specific initialization
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1964


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bdf660cab5234aa5e533691b0fe03c0766c9a9f0
commit bdf660cab5234aa5e533691b0fe03c0766c9a9f0
Author:     Christof Krüger <christof.krueger at gmail.com>
AuthorDate: Wed Apr 18 02:05:33 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 09:18:57 2018 -0400

    InstallRequiredSystemLibraries: Check for existence of mfcm dlls
    
    Previously, only existence of `mfc${v}.dll` and `mfc${v}d.dll` variants
    was checked and it was assumed that the managed variants `mfcm*.dll`
    also existed.  This assumption doesn't hold with Visual Studio 2017.
    Check each file separately.
    
    Fixes: #17913

diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 797f9e4..eb17fd7 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -481,6 +481,10 @@ if(MSVC)
         if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
           set(__install__libs ${__install__libs}
             "${MSVC_MFC_DIR}/mfc${v}d.dll"
+          )
+        endif()
+        if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll")
+          set(__install__libs ${__install__libs}
             "${MSVC_MFC_DIR}/mfcm${v}d.dll"
           )
         endif()
@@ -495,6 +499,10 @@ if(MSVC)
         if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
           set(__install__libs ${__install__libs}
             "${MSVC_MFC_DIR}/mfc${v}.dll"
+          )
+        endif()
+        if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll")
+          set(__install__libs ${__install__libs}
             "${MSVC_MFC_DIR}/mfcm${v}.dll"
           )
         endif()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=909ab169eb83f0a60f717aa87c5549e77e09e35f
commit 909ab169eb83f0a60f717aa87c5549e77e09e35f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 18 08:25:47 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 08:28:32 2018 -0400

    Help: Fix command-line synopsis markup syntax
    
    Use `{}` to surround required parts instead of `()`.
    
    Fixes: #17917

diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst
index a5fe191..cc3ceec 100644
--- a/Help/manual/ccmake.1.rst
+++ b/Help/manual/ccmake.1.rst
@@ -8,7 +8,7 @@ Synopsis
 
 .. parsed-literal::
 
- ccmake [<options>] (<path-to-source> | <path-to-existing-build>)
+ ccmake [<options>] {<path-to-source> | <path-to-existing-build>}
 
 Description
 ===========
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index 032b51f..57a9850 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -9,7 +9,7 @@ Synopsis
 .. parsed-literal::
 
  cmake-gui [<options>]
- cmake-gui [<options>] (<path-to-source> | <path-to-existing-build>)
+ cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>}
 
 Description
 ===========
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index c2e6435..577d321 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -8,8 +8,8 @@ Synopsis
 
 .. parsed-literal::
 
- cmake [<options>] (<path-to-source> | <path-to-existing-build>)
- cmake [(-D <var>=<value>)...] -P <cmake-script-file>
+ cmake [<options>] {<path-to-source> | <path-to-existing-build>}
+ cmake [{-D <var>=<value>}...] -P <cmake-script-file>
  cmake --build <dir> [<options>...] [-- <build-tool-options>...]
  cmake --open <dir>
  cmake -E <command> [<options>...]
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 75af22e..9553d15 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -13,7 +13,7 @@ Synopsis
  ctest [<options>]
  ctest <path-to-source> <path-to-build> --build-generator <generator>
        [<options>...] [-- <build-options>...] [--test-command <test>]
- ctest (-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>)
+ ctest {-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>}
        [-- <dashboard-options>...]
 
 Description

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a61ae3fb8017a297bd3f3efc447a1f1f29619bdf
commit a61ae3fb8017a297bd3f3efc447a1f1f29619bdf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 17 13:12:01 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 08:09:56 2018 -0400

    CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES
    
    Other check modules honor this variable, so include file checks should
    too.  Add policy `CMP0075` to enable the behavior in a compatible way.
    
    This change was originally made by commit v3.11.0-rc1~108^2
    (CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES, 2017-12-24) but it
    was reverted by commit v3.11.1~9^2 (Revert "CheckIncludeFiles: Honor
    CMAKE_REQUIRED_LIBRARIES", 2018-04-04) because the behavior change could
    affect checks in existing projects in an incompatible way.
    
    Fixes: #9514

diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 7e2255d..631f75b 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.12
 .. toctree::
    :maxdepth: 1
 
+   CMP0075: Include file check macros honor CMAKE_REQUIRED_LIBRARIES. </policy/CMP0075>
    CMP0074: find_package uses PackageName_ROOT variables. </policy/CMP0074>
    CMP0073: Do not produce legacy _LIB_DEPENDS cache entries. </policy/CMP0073>
 
diff --git a/Help/policy/CMP0075.rst b/Help/policy/CMP0075.rst
new file mode 100644
index 0000000..aa5c3f7
--- /dev/null
+++ b/Help/policy/CMP0075.rst
@@ -0,0 +1,26 @@
+CMP0075
+-------
+
+Include file check macros honor ``CMAKE_REQUIRED_LIBRARIES``.
+
+In CMake 3.12 and above, the
+
+* ``check_include_file`` macro in the :module:`CheckIncludeFile` module, the
+* ``check_include_file_cxx`` macro in the
+  :module:`CheckIncludeFileCXX` module, and the
+* ``check_include_files`` macro in the :module:`CheckIncludeFiles` module
+
+now prefer to link the check executable to the libraries listed in the
+``CMAKE_REQUIRED_LIBRARIES`` variable.  This policy provides compatibility
+with projects that have not been updated to expect this behavior.
+
+The ``OLD`` behavior for this policy is to ignore ``CMAKE_REQUIRED_LIBRARIES``
+in the include file check macros.  The ``NEW`` behavior of this policy is to
+honor ``CMAKE_REQUIRED_LIBRARIES`` in the include file check macros.
+
+This policy was introduced in CMake version 3.12.  CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/dev/CheckIncludeFile-required-libs.rst b/Help/release/dev/CheckIncludeFile-required-libs.rst
new file mode 100644
index 0000000..6fb5c40
--- /dev/null
+++ b/Help/release/dev/CheckIncludeFile-required-libs.rst
@@ -0,0 +1,14 @@
+CheckIncludeFile-required-libs
+------------------------------
+
+* The :module:`CheckIncludeFile` module ``check_include_file`` macro
+  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
+  See policy :policy:`CMP0075`.
+
+* The :module:`CheckIncludeFileCXX` module ``check_include_file_cxx`` macro
+  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
+  See policy :policy:`CMP0075`.
+
+* The :module:`CheckIncludeFiles` module ``check_include_files`` macro
+  learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
+  See policy :policy:`CMP0075`.
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index e5554c4..24bc349 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -27,6 +27,8 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
+# ``CMAKE_REQUIRED_LIBRARIES``
+#   A list of libraries to link.  See policy :policy:`CMP0075`.
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -55,14 +57,39 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
       string(APPEND CMAKE_C_FLAGS " ${ARGV2}")
     endif()
 
+    set(_CIF_LINK_LIBRARIES "")
+    if(CMAKE_REQUIRED_LIBRARIES)
+      cmake_policy(GET CMP0075 _CIF_CMP0075
+        PARENT_SCOPE # undocumented, do not use outside of CMake
+        )
+      if("x${_CIF_CMP0075}x" STREQUAL "xNEWx")
+        set(_CIF_LINK_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+      elseif("x${_CIF_CMP0075}x" STREQUAL "xOLDx")
+      elseif(NOT _CIF_CMP0075_WARNED)
+        set(_CIF_CMP0075_WARNED 1)
+        message(AUTHOR_WARNING
+          "Policy CMP0075 is not set: Include file check macros honor CMAKE_REQUIRED_LIBRARIES.  "
+          "Run \"cmake --help-policy CMP0075\" for policy details.  "
+          "Use the cmake_policy command to set the policy and suppress this warning."
+          "\n"
+          "CMAKE_REQUIRED_LIBRARIES is set to:\n"
+          "  ${CMAKE_REQUIRED_LIBRARIES}\n"
+          "For compatibility with CMake 3.11 and below this check is ignoring it."
+          )
+      endif()
+      unset(_CIF_CMP0075)
+    endif()
+
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+      ${_CIF_LINK_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}"
       OUTPUT_VARIABLE OUTPUT)
+    unset(_CIF_LINK_LIBRARIES)
 
     if(${ARGC} EQUAL 3)
       set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_SAVE})
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index 7948bab..f13d983 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -27,6 +27,8 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
+# ``CMAKE_REQUIRED_LIBRARIES``
+#   A list of libraries to link.  See policy :policy:`CMP0075`.
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -54,14 +56,39 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
       string(APPEND CMAKE_CXX_FLAGS " ${ARGV2}")
     endif()
 
+    set(_CIF_LINK_LIBRARIES "")
+    if(CMAKE_REQUIRED_LIBRARIES)
+      cmake_policy(GET CMP0075 _CIF_CMP0075
+        PARENT_SCOPE # undocumented, do not use outside of CMake
+        )
+      if("x${_CIF_CMP0075}x" STREQUAL "xNEWx")
+        set(_CIF_LINK_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+      elseif("x${_CIF_CMP0075}x" STREQUAL "xOLDx")
+      elseif(NOT _CIF_CMP0075_WARNED)
+        set(_CIF_CMP0075_WARNED 1)
+        message(AUTHOR_WARNING
+          "Policy CMP0075 is not set: Include file check macros honor CMAKE_REQUIRED_LIBRARIES.  "
+          "Run \"cmake --help-policy CMP0075\" for policy details.  "
+          "Use the cmake_policy command to set the policy and suppress this warning."
+          "\n"
+          "CMAKE_REQUIRED_LIBRARIES is set to:\n"
+          "  ${CMAKE_REQUIRED_LIBRARIES}\n"
+          "For compatibility with CMake 3.11 and below this check is ignoring it."
+          )
+      endif()
+      unset(_CIF_CMP0075)
+    endif()
+
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+      ${_CIF_LINK_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
       "${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}"
       OUTPUT_VARIABLE OUTPUT)
+    unset(_CIF_LINK_LIBRARIES)
 
     if(${ARGC} EQUAL 3)
       set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVE})
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 59afdab..c689f05 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -33,6 +33,8 @@
 #   list of macros to define (-DFOO=bar)
 # ``CMAKE_REQUIRED_INCLUDES``
 #   list of include directories
+# ``CMAKE_REQUIRED_LIBRARIES``
+#   A list of libraries to link.  See policy :policy:`CMP0075`.
 # ``CMAKE_REQUIRED_QUIET``
 #   execute quietly without messages
 #
@@ -95,6 +97,29 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
       set(_description "include file ${_INCLUDE}")
     endif()
 
+    set(_CIF_LINK_LIBRARIES "")
+    if(CMAKE_REQUIRED_LIBRARIES)
+      cmake_policy(GET CMP0075 _CIF_CMP0075
+        PARENT_SCOPE # undocumented, do not use outside of CMake
+        )
+      if("x${_CIF_CMP0075}x" STREQUAL "xNEWx")
+        set(_CIF_LINK_LIBRARIES LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+      elseif("x${_CIF_CMP0075}x" STREQUAL "xOLDx")
+      elseif(NOT _CIF_CMP0075_WARNED)
+        set(_CIF_CMP0075_WARNED 1)
+        message(AUTHOR_WARNING
+          "Policy CMP0075 is not set: Include file check macros honor CMAKE_REQUIRED_LIBRARIES.  "
+          "Run \"cmake --help-policy CMP0075\" for policy details.  "
+          "Use the cmake_policy command to set the policy and suppress this warning."
+          "\n"
+          "CMAKE_REQUIRED_LIBRARIES is set to:\n"
+          "  ${CMAKE_REQUIRED_LIBRARIES}\n"
+          "For compatibility with CMake 3.11 and below this check is ignoring it."
+          )
+      endif()
+      unset(_CIF_CMP0075)
+    endif()
+
     if(NOT CMAKE_REQUIRED_QUIET)
       message(STATUS "Looking for ${_description}")
     endif()
@@ -102,10 +127,12 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
       ${CMAKE_BINARY_DIR}
       ${src}
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+      ${_CIF_LINK_LIBRARIES}
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
       "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
       OUTPUT_VARIABLE OUTPUT)
+    unset(_CIF_LINK_LIBRARIES)
     if(${VARIABLE})
       if(NOT CMAKE_REQUIRED_QUIET)
         message(STATUS "Looking for ${_description} - found")
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index a21c778..9b9ef60 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -219,7 +219,10 @@ class cmMakefile;
          "Do not produce legacy _LIB_DEPENDS cache entries.", 3, 12, 0,       \
          cmPolicies::WARN)                                                    \
   SELECT(POLICY, CMP0074, "find_package uses PackageName_ROOT variables.", 3, \
-         12, 0, cmPolicies::WARN)
+         12, 0, cmPolicies::WARN)                                             \
+  SELECT(POLICY, CMP0075,                                                     \
+         "Include file check macros honor CMAKE_REQUIRED_LIBRARIES.", 3, 12,  \
+         0, cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY)                                         \
diff --git a/Tests/RunCMake/CheckModules/CMP0075-stderr.txt b/Tests/RunCMake/CheckModules/CMP0075-stderr.txt
new file mode 100644
index 0000000..960fe94
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CMP0075-stderr.txt
@@ -0,0 +1,50 @@
+^CMake Warning \(dev\) at [^
+]*/Modules/CheckIncludeFile.cmake:[0-9]+ \(message\):
+  Policy CMP0075 is not set: Include file check macros honor
+  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
+  details.  Use the cmake_policy command to set the policy and suppress this
+  warning.
+
+  CMAKE_REQUIRED_LIBRARIES is set to:
+
+    does_not_exist
+
+  For compatibility with CMake 3.11 and below this check is ignoring it.
+Call Stack \(most recent call first\):
+  CMP0075.cmake:11 \(check_include_file\)
+  CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at [^
+]*/Modules/CheckIncludeFileCXX.cmake:[0-9]+ \(message\):
+  Policy CMP0075 is not set: Include file check macros honor
+  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
+  details.  Use the cmake_policy command to set the policy and suppress this
+  warning.
+
+  CMAKE_REQUIRED_LIBRARIES is set to:
+
+    does_not_exist
+
+  For compatibility with CMake 3.11 and below this check is ignoring it.
+Call Stack \(most recent call first\):
+  CMP0075.cmake:26 \(check_include_file_cxx\)
+  CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at [^
+]*/Modules/CheckIncludeFiles.cmake:[0-9]+ \(message\):
+  Policy CMP0075 is not set: Include file check macros honor
+  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
+  details.  Use the cmake_policy command to set the policy and suppress this
+  warning.
+
+  CMAKE_REQUIRED_LIBRARIES is set to:
+
+    does_not_exist
+
+  For compatibility with CMake 3.11 and below this check is ignoring it.
+Call Stack \(most recent call first\):
+  CMP0075.cmake:41 \(check_include_files\)
+  CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CheckModules/CMP0075.cmake b/Tests/RunCMake/CheckModules/CMP0075.cmake
new file mode 100644
index 0000000..4a3b720
--- /dev/null
+++ b/Tests/RunCMake/CheckModules/CMP0075.cmake
@@ -0,0 +1,124 @@
+enable_language(C)
+enable_language(CXX)
+include(CheckIncludeFile)
+include(CheckIncludeFileCXX)
+include(CheckIncludeFiles)
+
+set(CMAKE_REQUIRED_LIBRARIES does_not_exist)
+
+#============================================================================
+
+check_include_file("stddef.h" HAVE_STDDEF_H_1)
+if(NOT HAVE_STDDEF_H_1)
+  message(SEND_ERROR "HAVE_STDDEF_H_1 failed but should have passed.")
+endif()
+if(NOT _CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDDEF_H_1 did not warn but should have")
+endif()
+check_include_file("stddef.h" HAVE_STDDEF_H_2) # second does not warn
+if(NOT HAVE_STDDEF_H_2)
+  message(SEND_ERROR "HAVE_STDDEF_H_2 failed but should have passed.")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#----------------------------------------------------------------------------
+
+check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_1)
+if(NOT HAVE_STDDEF_H_CXX_1)
+  message(SEND_ERROR "HAVE_STDDEF_H_CXX_1 failed but should have passed.")
+endif()
+if(NOT _CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDDEF_H_CXX_1 did not warn but should have")
+endif()
+check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_2) # second does not warn
+if(NOT HAVE_STDDEF_H_CXX_2)
+  message(SEND_ERROR "HAVE_STDDEF_H_CXX_2 failed but should have passed.")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#----------------------------------------------------------------------------
+
+check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_1)
+if(NOT HAVE_STDLIB_H_1)
+  message(SEND_ERROR "HAVE_STDLIB_H_1 failed but should have passed.")
+endif()
+if(NOT _CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDLIB_H_1 did not warn but should have")
+endif()
+check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_2) # second does not warn
+if(NOT HAVE_STDLIB_H_2)
+  message(SEND_ERROR "HAVE_STDLIB_H_2 failed but should have passed.")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#============================================================================
+cmake_policy(SET CMP0075 OLD)
+# These should not warn.
+# These should pass the checks due to ignoring 'does_not_exist'.
+
+check_include_file("stddef.h" HAVE_STDDEF_H_3)
+if(NOT HAVE_STDDEF_H_3)
+  message(SEND_ERROR "HAVE_STDDEF_H_3 failed but should have passed.")
+endif()
+if(_CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDDEF_H_3 warned but should not have")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#----------------------------------------------------------------------------
+
+check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_3)
+if(NOT HAVE_STDDEF_H_CXX_3)
+  message(SEND_ERROR "HAVE_STDDEF_H_CXX_3 failed but should have passed.")
+endif()
+if(_CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDDEF_H_CXX_3 warned but should not have")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#----------------------------------------------------------------------------
+
+check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_3)
+if(NOT HAVE_STDLIB_H_3)
+  message(SEND_ERROR "HAVE_STDLIB_H_3 failed but should have passed.")
+endif()
+if(_CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDLIB_H_3 warned but should not have")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#============================================================================
+cmake_policy(SET CMP0075 NEW)
+# These should not warn.
+# These should fail the checks due to requiring 'does_not_exist'.
+
+check_include_file("stddef.h" HAVE_STDDEF_H_4)
+if(HAVE_STDDEF_H_4)
+  message(SEND_ERROR "HAVE_STDDEF_H_4 passed but should have failed.")
+endif()
+if(_CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDDEF_H_4 warned but should not have")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#----------------------------------------------------------------------------
+
+check_include_file_cxx("stddef.h" HAVE_STDDEF_H_CXX_4)
+if(HAVE_STDDEF_H_CXX_4)
+  message(SEND_ERROR "HAVE_STDDEF_H_CXX_4 passed but should have failed.")
+endif()
+if(_CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDDEF_H_CXX_4 warned but should not have")
+endif()
+unset(_CIF_CMP0075_WARNED)
+
+#----------------------------------------------------------------------------
+
+check_include_files("stddef.h;stdlib.h" HAVE_STDLIB_H_4)
+if(HAVE_STDLIB_H_4)
+  message(SEND_ERROR "HAVE_STDLIB_H_4 passed but should have failed.")
+endif()
+if(_CIF_CMP0075_WARNED)
+  message(SEND_ERROR "HAVE_STDLIB_H_4 warned but should not have")
+endif()
+unset(_CIF_CMP0075_WARNED)
diff --git a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake
index c5aaa64..8a046e1 100644
--- a/Tests/RunCMake/CheckModules/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckModules/RunCMakeTest.cmake
@@ -1,5 +1,7 @@
 include(RunCMake)
 
+run_cmake(CMP0075)
+
 run_cmake(CheckStructHasMemberOk)
 run_cmake(CheckStructHasMemberUnknownLanguage)
 run_cmake(CheckStructHasMemberMissingLanguage)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=391a5837ee859c749c2a988eb873a2a9a2c58f91
commit 391a5837ee859c749c2a988eb873a2a9a2c58f91
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 17 11:43:56 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 08:09:56 2018 -0400

    cmake_policy: Add undocumented PARENT_SCOPE option to GET
    
    Policies affecting the behavior of CMake-provided macros and functions
    need to be able to get the policy setting as of the call site rather
    than the definition site.  Add an undocumented option to do this.

diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx
index 7ca1cbc..adf9ef8 100644
--- a/Source/cmCMakePolicyCommand.cxx
+++ b/Source/cmCMakePolicyCommand.cxx
@@ -95,7 +95,11 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args)
 
 bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
 {
-  if (args.size() != 3) {
+  bool parent_scope = false;
+  if (args.size() == 4 && args[3] == "PARENT_SCOPE") {
+    // Undocumented PARENT_SCOPE option for use within CMake.
+    parent_scope = true;
+  } else if (args.size() != 3) {
     this->SetError("GET must be given exactly 2 additional arguments.");
     return false;
   }
@@ -115,7 +119,8 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
   }
 
   // Lookup the policy setting.
-  cmPolicies::PolicyStatus status = this->Makefile->GetPolicyStatus(pid);
+  cmPolicies::PolicyStatus status =
+    this->Makefile->GetPolicyStatus(pid, parent_scope);
   switch (status) {
     case cmPolicies::OLD:
       // Report that the policy is set to OLD.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9aeeb5c..490d516 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4089,10 +4089,10 @@ const char* cmMakefile::GetDefineFlagsCMP0059() const
   return this->DefineFlagsOrig.c_str();
 }
 
-cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(
-  cmPolicies::PolicyID id) const
+cmPolicies::PolicyStatus cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id,
+                                                     bool parent_scope) const
 {
-  return this->StateSnapshot.GetPolicy(id);
+  return this->StateSnapshot.GetPolicy(id, parent_scope);
 }
 
 bool cmMakefile::PolicyOptionalWarningEnabled(std::string const& var)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d2626cd..8589deb 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -284,7 +284,8 @@ public:
      */
   bool SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
   bool SetPolicy(const char* id, cmPolicies::PolicyStatus status);
-  cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id) const;
+  cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id,
+                                           bool parent_scope = false) const;
   bool SetPolicyVersion(std::string const& version_min,
                         std::string const& version_max);
   void RecordPolicies(cmPolicies::PolicyMap& pm);
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index 0d97c33..0229a77 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -160,8 +160,8 @@ void cmStateSnapshot::SetPolicy(cmPolicies::PolicyID id,
   }
 }
 
-cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(
-  cmPolicies::PolicyID id) const
+cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(cmPolicies::PolicyID id,
+                                                    bool parent_scope) const
 {
   cmPolicies::PolicyStatus status = cmPolicies::GetPolicyStatus(id);
 
@@ -180,6 +180,10 @@ cmPolicies::PolicyStatus cmStateSnapshot::GetPolicy(
     cmLinkedTree<cmStateDetail::PolicyStackEntry>::iterator root =
       dir->DirectoryEnd->PolicyRoot;
     for (; leaf != root; ++leaf) {
+      if (parent_scope) {
+        parent_scope = false;
+        continue;
+      }
       if (leaf->IsDefined(id)) {
         status = leaf->Get(id);
         return status;
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index 94d6274..af5653b 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -43,7 +43,8 @@ public:
   cmStateEnums::SnapshotType GetType() const;
 
   void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
-  cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const;
+  cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id,
+                                     bool parent_scope = false) const;
   bool HasDefinedPolicyCMP0011();
   void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak);
   bool PopPolicy();
diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt
index 413195a..353842b 100644
--- a/Tests/PolicyScope/CMakeLists.txt
+++ b/Tests/PolicyScope/CMakeLists.txt
@@ -52,6 +52,10 @@ if(1)
     # CMP0002 should be changed when this function is invoked
     cmake_policy(GET CMP0002 cmp)
     check(CMP0002 "OLD" "${cmp}")
+
+    # The undocumented PARENT_SCOPE option sees the caller's setting.
+    cmake_policy(GET CMP0002 cmp PARENT_SCOPE)
+    check(CMP0002 "NEW" "${cmp}")
   endfunction()
 
   # Unset CMP0002
@@ -61,6 +65,10 @@ if(1)
     cmake_policy(GET CMP0002 cmp)
     check(CMP0002 "" "${cmp}")
 
+    # The undocumented PARENT_SCOPE option sees the caller's setting.
+    cmake_policy(GET CMP0002 cmp PARENT_SCOPE)
+    check(CMP0002 "NEW" "${cmp}")
+
     # Setting the policy should work here and also in the caller.
     cmake_policy(SET CMP0002 OLD)
     cmake_policy(GET CMP0002 cmp)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c47ac5b2571939f7d987d9f23a9969b1f67f46e
commit 3c47ac5b2571939f7d987d9f23a9969b1f67f46e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 18 08:04:55 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 08:09:56 2018 -0400

    OpenWatcom: Add workaround for lack of error on missing library
    
    The OpenWatcom tools do not fail to link when a library is missing if no
    symbols were needed from it.  This can break `try_compile` checks.
    Teach `cmGlobalGenerator::Build` to pretend that the build tool returned
    non-zero if the output contains the corresponding warning.

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f9eb90f..cf277d5 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1893,6 +1893,13 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
     retVal = 1;
   }
 
+  // The OpenWatcom tools do not return an error code when a link
+  // library is not found!
+  if (this->CMakeInstance->GetState()->UseWatcomWMake() && retVal == 0 &&
+      output.find("W1008: cannot open") != std::string::npos) {
+    retVal = 1;
+  }
+
   return retVal;
 }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=459739678443d2d2074d6e1475e4267c6c110e05
commit 459739678443d2d2074d6e1475e4267c6c110e05
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Sun Apr 15 21:47:10 2018 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 07:41:44 2018 -0400

    Apple: Use include_guard() within compiler config

diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake
index 70fc75e..0681bfb 100644
--- a/Modules/Platform/Apple-Clang.cmake
+++ b/Modules/Platform/Apple-Clang.cmake
@@ -3,10 +3,7 @@
 
 
 # This module is shared by multiple languages; use include blocker.
-if(__APPLE_COMPILER_CLANG)
-  return()
-endif()
-set(__APPLE_COMPILER_CLANG 1)
+include_guard()
 
 macro(__apple_compiler_clang lang)
   set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output
diff --git a/Modules/Platform/Apple-GNU.cmake b/Modules/Platform/Apple-GNU.cmake
index 9985ddd..0eb8168 100644
--- a/Modules/Platform/Apple-GNU.cmake
+++ b/Modules/Platform/Apple-GNU.cmake
@@ -3,10 +3,7 @@
 
 
 # This module is shared by multiple languages; use include blocker.
-if(__APPLE_COMPILER_GNU)
-  return()
-endif()
-set(__APPLE_COMPILER_GNU 1)
+include_guard()
 
 macro(__apple_compiler_gnu lang)
   set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output
diff --git a/Modules/Platform/Apple-Intel.cmake b/Modules/Platform/Apple-Intel.cmake
index 9f92d95..2d4f7e5 100644
--- a/Modules/Platform/Apple-Intel.cmake
+++ b/Modules/Platform/Apple-Intel.cmake
@@ -3,10 +3,7 @@
 
 
 # This module is shared by multiple languages; use include blocker.
-if(__APPLE_COMPILER_INTEL)
-  return()
-endif()
-set(__APPLE_COMPILER_INTEL 1)
+include_guard()
 
 macro(__apple_compiler_intel lang)
   set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output
diff --git a/Modules/Platform/Apple-PGI.cmake b/Modules/Platform/Apple-PGI.cmake
index a68c08d..8d343b7 100644
--- a/Modules/Platform/Apple-PGI.cmake
+++ b/Modules/Platform/Apple-PGI.cmake
@@ -2,10 +2,7 @@
 # file Copyright.txt or https://cmake.org/licensing for details.
 
 # This module is shared by multiple languages; use include blocker.
-if(__APPLE_COMPILER_PGI)
-  return()
-endif()
-set(__APPLE_COMPILER_PGI 1)
+include_guard()
 
 macro(__apple_compiler_pgi lang)
   set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version,")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e95b3fd9bbca94cb5f217847031c9c8f393aee78
commit e95b3fd9bbca94cb5f217847031c9c8f393aee78
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Sun Apr 1 22:49:59 2018 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 07:41:42 2018 -0400

    Apple: Use CMAKE_EFFECTIVE_SYSTEM_NAME to share compiler info
    
    Apple platforms macOS, iOS, tvOS, and watchOS can all share the same
    compiler information.  Rename `Darwin-*` modules to `Apple-*` and load
    them all through `CMAKE_EFFECTIVE_SYSTEM_NAME`.  This saves duplication
    of 4 * 21 compiler information modules.
    
    Issue: #17870

diff --git a/Modules/CMakeSystemSpecificInitialize.cmake b/Modules/CMakeSystemSpecificInitialize.cmake
index 629f226..de4d7f5 100644
--- a/Modules/CMakeSystemSpecificInitialize.cmake
+++ b/Modules/CMakeSystemSpecificInitialize.cmake
@@ -11,6 +11,11 @@
 #
 # It is useful to share the same aforementioned configuration files and
 # avoids duplicating them in case of tightly related platforms.
+#
+# An example are the platforms supported by Xcode (macOS, iOS, tvOS,
+# and watchOS). For all of those the CMAKE_EFFECTIVE_SYSTEM_NAME is
+# set to Apple which results in using
+# Platfom/Apple-AppleClang-CXX.cmake for the Apple C++ compiler.
 set(CMAKE_EFFECTIVE_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
 
 include(Platform/${CMAKE_SYSTEM_NAME}-Initialize OPTIONAL)
diff --git a/Modules/Platform/Darwin-Absoft-Fortran.cmake b/Modules/Platform/Apple-Absoft-Fortran.cmake
similarity index 100%
rename from Modules/Platform/Darwin-Absoft-Fortran.cmake
rename to Modules/Platform/Apple-Absoft-Fortran.cmake
diff --git a/Modules/Platform/Darwin-AppleClang-C.cmake b/Modules/Platform/Apple-AppleClang-C.cmake
similarity index 83%
rename from Modules/Platform/Darwin-AppleClang-C.cmake
rename to Modules/Platform/Apple-AppleClang-C.cmake
index 3216b29..f45ccf4 100644
--- a/Modules/Platform/Darwin-AppleClang-C.cmake
+++ b/Modules/Platform/Apple-AppleClang-C.cmake
@@ -1,4 +1,4 @@
-include(Platform/Darwin-Clang-C)
+include(Platform/Apple-Clang-C)
 if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.2)
   set(CMAKE_C_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ")
 else()
diff --git a/Modules/Platform/Darwin-AppleClang-CXX.cmake b/Modules/Platform/Apple-AppleClang-CXX.cmake
similarity index 83%
rename from Modules/Platform/Darwin-AppleClang-CXX.cmake
rename to Modules/Platform/Apple-AppleClang-CXX.cmake
index 3fedf8c..1128204 100644
--- a/Modules/Platform/Darwin-AppleClang-CXX.cmake
+++ b/Modules/Platform/Apple-AppleClang-CXX.cmake
@@ -1,4 +1,4 @@
-include(Platform/Darwin-Clang-CXX)
+include(Platform/Apple-Clang-CXX)
 if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2)
   set(CMAKE_CXX_SYSTEM_FRAMEWORK_SEARCH_FLAG "-iframework ")
 else()
diff --git a/Modules/Platform/Apple-Clang-C.cmake b/Modules/Platform/Apple-Clang-C.cmake
new file mode 100644
index 0000000..4d0dc82
--- /dev/null
+++ b/Modules/Platform/Apple-Clang-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-Clang)
+__apple_compiler_clang(C)
diff --git a/Modules/Platform/Apple-Clang-CXX.cmake b/Modules/Platform/Apple-Clang-CXX.cmake
new file mode 100644
index 0000000..6c1ddc1
--- /dev/null
+++ b/Modules/Platform/Apple-Clang-CXX.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-Clang)
+__apple_compiler_clang(CXX)
diff --git a/Modules/Platform/Darwin-Clang.cmake b/Modules/Platform/Apple-Clang.cmake
similarity index 94%
rename from Modules/Platform/Darwin-Clang.cmake
rename to Modules/Platform/Apple-Clang.cmake
index f8a07ec..70fc75e 100644
--- a/Modules/Platform/Darwin-Clang.cmake
+++ b/Modules/Platform/Apple-Clang.cmake
@@ -3,12 +3,12 @@
 
 
 # This module is shared by multiple languages; use include blocker.
-if(__DARWIN_COMPILER_CLANG)
+if(__APPLE_COMPILER_CLANG)
   return()
 endif()
-set(__DARWIN_COMPILER_CLANG 1)
+set(__APPLE_COMPILER_CLANG 1)
 
-macro(__darwin_compiler_clang lang)
+macro(__apple_compiler_clang lang)
   set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output
   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
   set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
diff --git a/Modules/Platform/Darwin-GNU-C.cmake b/Modules/Platform/Apple-GNU-C.cmake
similarity index 57%
rename from Modules/Platform/Darwin-GNU-C.cmake
rename to Modules/Platform/Apple-GNU-C.cmake
index efdfd00..5481c99 100644
--- a/Modules/Platform/Darwin-GNU-C.cmake
+++ b/Modules/Platform/Apple-GNU-C.cmake
@@ -1,4 +1,4 @@
-include(Platform/Darwin-GNU)
-__darwin_compiler_gnu(C)
+include(Platform/Apple-GNU)
+__apple_compiler_gnu(C)
 cmake_gnu_set_sysroot_flag(C)
 cmake_gnu_set_osx_deployment_target_flag(C)
diff --git a/Modules/Platform/Darwin-GNU-CXX.cmake b/Modules/Platform/Apple-GNU-CXX.cmake
similarity index 58%
rename from Modules/Platform/Darwin-GNU-CXX.cmake
rename to Modules/Platform/Apple-GNU-CXX.cmake
index e3c2ea7..727f726 100644
--- a/Modules/Platform/Darwin-GNU-CXX.cmake
+++ b/Modules/Platform/Apple-GNU-CXX.cmake
@@ -1,4 +1,4 @@
-include(Platform/Darwin-GNU)
-__darwin_compiler_gnu(CXX)
+include(Platform/Apple-GNU)
+__apple_compiler_gnu(CXX)
 cmake_gnu_set_sysroot_flag(CXX)
 cmake_gnu_set_osx_deployment_target_flag(CXX)
diff --git a/Modules/Platform/Darwin-GNU-Fortran.cmake b/Modules/Platform/Apple-GNU-Fortran.cmake
similarity index 86%
rename from Modules/Platform/Darwin-GNU-Fortran.cmake
rename to Modules/Platform/Apple-GNU-Fortran.cmake
index 568d79b..2f53603 100644
--- a/Modules/Platform/Darwin-GNU-Fortran.cmake
+++ b/Modules/Platform/Apple-GNU-Fortran.cmake
@@ -1,8 +1,8 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-include(Platform/Darwin-GNU)
-__darwin_compiler_gnu(Fortran)
+include(Platform/Apple-GNU)
+__apple_compiler_gnu(Fortran)
 cmake_gnu_set_sysroot_flag(Fortran)
 cmake_gnu_set_osx_deployment_target_flag(Fortran)
 
diff --git a/Modules/Platform/Darwin-GNU.cmake b/Modules/Platform/Apple-GNU.cmake
similarity index 96%
rename from Modules/Platform/Darwin-GNU.cmake
rename to Modules/Platform/Apple-GNU.cmake
index 9f9ef01..9985ddd 100644
--- a/Modules/Platform/Darwin-GNU.cmake
+++ b/Modules/Platform/Apple-GNU.cmake
@@ -3,12 +3,12 @@
 
 
 # This module is shared by multiple languages; use include blocker.
-if(__DARWIN_COMPILER_GNU)
+if(__APPLE_COMPILER_GNU)
   return()
 endif()
-set(__DARWIN_COMPILER_GNU 1)
+set(__APPLE_COMPILER_GNU 1)
 
-macro(__darwin_compiler_gnu lang)
+macro(__apple_compiler_gnu lang)
   set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output
   # GNU does not have -shared on OS X
   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
diff --git a/Modules/Platform/Apple-Intel-C.cmake b/Modules/Platform/Apple-Intel-C.cmake
new file mode 100644
index 0000000..95bb270
--- /dev/null
+++ b/Modules/Platform/Apple-Intel-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-Intel)
+__apple_compiler_intel(C)
diff --git a/Modules/Platform/Apple-Intel-CXX.cmake b/Modules/Platform/Apple-Intel-CXX.cmake
new file mode 100644
index 0000000..b87e512
--- /dev/null
+++ b/Modules/Platform/Apple-Intel-CXX.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-Intel)
+__apple_compiler_intel(CXX)
diff --git a/Modules/Platform/Darwin-Intel-Fortran.cmake b/Modules/Platform/Apple-Intel-Fortran.cmake
similarity index 81%
rename from Modules/Platform/Darwin-Intel-Fortran.cmake
rename to Modules/Platform/Apple-Intel-Fortran.cmake
index 2299da9..e54e237 100644
--- a/Modules/Platform/Darwin-Intel-Fortran.cmake
+++ b/Modules/Platform/Apple-Intel-Fortran.cmake
@@ -1,8 +1,8 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file Copyright.txt or https://cmake.org/licensing for details.
 
-include(Platform/Darwin-Intel)
-__darwin_compiler_intel(Fortran)
+include(Platform/Apple-Intel)
+__apple_compiler_intel(Fortran)
 
 set(CMAKE_Fortran_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
 set(CMAKE_Fortran_OSX_CURRENT_VERSION_FLAG "-current_version ")
diff --git a/Modules/Platform/Darwin-Intel.cmake b/Modules/Platform/Apple-Intel.cmake
similarity index 87%
rename from Modules/Platform/Darwin-Intel.cmake
rename to Modules/Platform/Apple-Intel.cmake
index dd33cec..9f92d95 100644
--- a/Modules/Platform/Darwin-Intel.cmake
+++ b/Modules/Platform/Apple-Intel.cmake
@@ -3,12 +3,12 @@
 
 
 # This module is shared by multiple languages; use include blocker.
-if(__DARWIN_COMPILER_INTEL)
+if(__APPLE_COMPILER_INTEL)
   return()
 endif()
-set(__DARWIN_COMPILER_INTEL 1)
+set(__APPLE_COMPILER_INTEL 1)
 
-macro(__darwin_compiler_intel lang)
+macro(__apple_compiler_intel lang)
   set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output
   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
   set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
diff --git a/Modules/Platform/Darwin-NAG-Fortran.cmake b/Modules/Platform/Apple-NAG-Fortran.cmake
similarity index 100%
rename from Modules/Platform/Darwin-NAG-Fortran.cmake
rename to Modules/Platform/Apple-NAG-Fortran.cmake
diff --git a/Modules/Platform/Darwin-NVIDIA-CUDA.cmake b/Modules/Platform/Apple-NVIDIA-CUDA.cmake
similarity index 100%
rename from Modules/Platform/Darwin-NVIDIA-CUDA.cmake
rename to Modules/Platform/Apple-NVIDIA-CUDA.cmake
diff --git a/Modules/Platform/Apple-PGI-C.cmake b/Modules/Platform/Apple-PGI-C.cmake
new file mode 100644
index 0000000..1e11724
--- /dev/null
+++ b/Modules/Platform/Apple-PGI-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-PGI)
+__apple_compiler_pgi(C)
diff --git a/Modules/Platform/Apple-PGI-CXX.cmake b/Modules/Platform/Apple-PGI-CXX.cmake
new file mode 100644
index 0000000..aa5daf7
--- /dev/null
+++ b/Modules/Platform/Apple-PGI-CXX.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-PGI)
+__apple_compiler_pgi(CXX)
diff --git a/Modules/Platform/Apple-PGI-Fortran.cmake b/Modules/Platform/Apple-PGI-Fortran.cmake
new file mode 100644
index 0000000..1e3e4b1
--- /dev/null
+++ b/Modules/Platform/Apple-PGI-Fortran.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-PGI)
+__apple_compiler_pgi(Fortran)
diff --git a/Modules/Platform/Darwin-PGI.cmake b/Modules/Platform/Apple-PGI.cmake
similarity index 83%
rename from Modules/Platform/Darwin-PGI.cmake
rename to Modules/Platform/Apple-PGI.cmake
index 04479a8..a68c08d 100644
--- a/Modules/Platform/Darwin-PGI.cmake
+++ b/Modules/Platform/Apple-PGI.cmake
@@ -2,12 +2,12 @@
 # file Copyright.txt or https://cmake.org/licensing for details.
 
 # This module is shared by multiple languages; use include blocker.
-if(__DARWIN_COMPILER_PGI)
+if(__APPLE_COMPILER_PGI)
   return()
 endif()
-set(__DARWIN_COMPILER_PGI 1)
+set(__APPLE_COMPILER_PGI 1)
 
-macro(__darwin_compiler_pgi lang)
+macro(__apple_compiler_pgi lang)
   set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version,")
   set(CMAKE_${lang}_OSX_CURRENT_VERSION_FLAG "-Wl,-current_version,")
   set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-install_name")
diff --git a/Modules/Platform/Apple-VisualAge-C.cmake b/Modules/Platform/Apple-VisualAge-C.cmake
new file mode 100644
index 0000000..7fa6032
--- /dev/null
+++ b/Modules/Platform/Apple-VisualAge-C.cmake
@@ -0,0 +1 @@
+include(Platform/Apple-XL-C)
diff --git a/Modules/Platform/Apple-VisualAge-CXX.cmake b/Modules/Platform/Apple-VisualAge-CXX.cmake
new file mode 100644
index 0000000..12dd347
--- /dev/null
+++ b/Modules/Platform/Apple-VisualAge-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Apple-XL-CXX)
diff --git a/Modules/Platform/Darwin-XL-C.cmake b/Modules/Platform/Apple-XL-C.cmake
similarity index 100%
rename from Modules/Platform/Darwin-XL-C.cmake
rename to Modules/Platform/Apple-XL-C.cmake
diff --git a/Modules/Platform/Darwin-XL-CXX.cmake b/Modules/Platform/Apple-XL-CXX.cmake
similarity index 100%
rename from Modules/Platform/Darwin-XL-CXX.cmake
rename to Modules/Platform/Apple-XL-CXX.cmake
diff --git a/Modules/Platform/Darwin-Clang-C.cmake b/Modules/Platform/Darwin-Clang-C.cmake
deleted file mode 100644
index 0a1502e..0000000
--- a/Modules/Platform/Darwin-Clang-C.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include(Platform/Darwin-Clang)
-__darwin_compiler_clang(C)
diff --git a/Modules/Platform/Darwin-Clang-CXX.cmake b/Modules/Platform/Darwin-Clang-CXX.cmake
deleted file mode 100644
index f8e8d88..0000000
--- a/Modules/Platform/Darwin-Clang-CXX.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include(Platform/Darwin-Clang)
-__darwin_compiler_clang(CXX)
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index b539e45..3db77aa 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -20,6 +20,10 @@ execute_process(COMMAND sw_vers -productVersion
 set(CMAKE_OSX_ARCHITECTURES "$ENV{CMAKE_OSX_ARCHITECTURES}" CACHE STRING
   "Build architectures for OSX")
 
+# macOS, iOS, tvOS, and watchOS should lookup compilers from
+# Platform/Apple-${CMAKE_CXX_COMPILER_ID}-<LANG>
+set(CMAKE_EFFECTIVE_SYSTEM_NAME "Apple")
+
 #----------------------------------------------------------------------------
 # _CURRENT_OSX_VERSION - as a two-component string: 10.5, 10.6, ...
 #
diff --git a/Modules/Platform/Darwin-Intel-C.cmake b/Modules/Platform/Darwin-Intel-C.cmake
deleted file mode 100644
index 81c630f..0000000
--- a/Modules/Platform/Darwin-Intel-C.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include(Platform/Darwin-Intel)
-__darwin_compiler_intel(C)
diff --git a/Modules/Platform/Darwin-Intel-CXX.cmake b/Modules/Platform/Darwin-Intel-CXX.cmake
deleted file mode 100644
index 90ae53b..0000000
--- a/Modules/Platform/Darwin-Intel-CXX.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include(Platform/Darwin-Intel)
-__darwin_compiler_intel(CXX)
diff --git a/Modules/Platform/Darwin-PGI-C.cmake b/Modules/Platform/Darwin-PGI-C.cmake
deleted file mode 100644
index 790919b..0000000
--- a/Modules/Platform/Darwin-PGI-C.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include(Platform/Darwin-PGI)
-__darwin_compiler_pgi(C)
diff --git a/Modules/Platform/Darwin-PGI-CXX.cmake b/Modules/Platform/Darwin-PGI-CXX.cmake
deleted file mode 100644
index ceaed71..0000000
--- a/Modules/Platform/Darwin-PGI-CXX.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include(Platform/Darwin-PGI)
-__darwin_compiler_pgi(CXX)
diff --git a/Modules/Platform/Darwin-PGI-Fortran.cmake b/Modules/Platform/Darwin-PGI-Fortran.cmake
deleted file mode 100644
index 146807b..0000000
--- a/Modules/Platform/Darwin-PGI-Fortran.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include(Platform/Darwin-PGI)
-__darwin_compiler_pgi(Fortran)
diff --git a/Modules/Platform/Darwin-VisualAge-C.cmake b/Modules/Platform/Darwin-VisualAge-C.cmake
deleted file mode 100644
index 859914f..0000000
--- a/Modules/Platform/Darwin-VisualAge-C.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include(Platform/Darwin-XL-C)
diff --git a/Modules/Platform/Darwin-VisualAge-CXX.cmake b/Modules/Platform/Darwin-VisualAge-CXX.cmake
deleted file mode 100644
index 46c1005..0000000
--- a/Modules/Platform/Darwin-VisualAge-CXX.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include(Platform/Darwin-XL-CXX)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=84f9f63fccdadb9b8a0bdb3260a0c7a3f71cb251
commit 84f9f63fccdadb9b8a0bdb3260a0c7a3f71cb251
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Sun Apr 1 22:49:59 2018 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 07:41:25 2018 -0400

    Modules: Introduce CMAKE_EFFECTIVE_SYSTEM_NAME to lookup compiler info
    
    Create a `CMAKE_EFFECTIVE_SYSTEM_NAME` variable to use for looking
    up compiler information modules instead of using `CMAKE_SYSTEM_NAME`
    directly.  This will allow multiple platforms to share the same set
    of compiler information modules without spelling out all of them.
    
    Issue: #17870

diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 125c4e3..6b73730 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -29,15 +29,15 @@ if(NOT _INCLUDED_FILE)
 endif()
 
 if(CMAKE_SYSTEM_PROCESSOR)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
   if(NOT _INCLUDED_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif()
 endif()
 
-include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
+include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
 if(NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
 endif()
 
 # This should be included before the _INIT variables are
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 1e46cac..df43559 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -35,21 +35,21 @@ endif()
 # load a hardware specific file, mostly useful for embedded compilers
 if(CMAKE_SYSTEM_PROCESSOR)
   if(CMAKE_C_COMPILER_ID)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
   endif()
   if (NOT _INCLUDED_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif ()
 endif()
 
 
 # load the system- and compiler specific files
 if(CMAKE_C_COMPILER_ID)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif()
 if (NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
     OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif ()
 
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 4788cbf..479493b 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -17,9 +17,9 @@ endif()
 if(CMAKE_CUDA_COMPILER_ID)
   # load a hardware specific file, mostly useful for embedded compilers
   if(CMAKE_SYSTEM_PROCESSOR)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif()
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
 endif()
 
 
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 9ac9560..2975874 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -36,19 +36,19 @@ endif()
 # load a hardware specific file, mostly useful for embedded compilers
 if(CMAKE_SYSTEM_PROCESSOR)
   if(CMAKE_CXX_COMPILER_ID)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
   endif()
   if (NOT _INCLUDED_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif ()
 endif()
 
 # load the system- and compiler specific files
 if(CMAKE_CXX_COMPILER_ID)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif()
 if (NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
 endif ()
 
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 5f028e4..cceac83 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -22,10 +22,10 @@ if(CMAKE_COMPILER_IS_GNUG77)
   set(CMAKE_BASE_NAME g77)
 endif()
 if(CMAKE_Fortran_COMPILER_ID)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
 endif()
 if (NOT _INCLUDED_FILE)
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
           RESULT_VARIABLE _INCLUDED_FILE)
 endif ()
 
diff --git a/Modules/CMakeLanguageInformation.cmake b/Modules/CMakeLanguageInformation.cmake
index 18c8624..674ab86 100644
--- a/Modules/CMakeLanguageInformation.cmake
+++ b/Modules/CMakeLanguageInformation.cmake
@@ -9,10 +9,10 @@
 macro(__cmake_include_compiler_wrapper lang)
   set(_INCLUDED_WRAPPER_FILE 0)
   if (CMAKE_${lang}_COMPILER_ID)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
   endif()
   if (NOT _INCLUDED_WRAPPER_FILE)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
   endif ()
 
   # No platform - wrapper - lang information so maybe there's just wrapper - lang information
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index d9b408d..07ba6d0 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -14,9 +14,9 @@ endif()
 if(CMAKE_Swift_COMPILER_ID)
   # load a hardware specific file, mostly useful for embedded compilers
   if(CMAKE_SYSTEM_PROCESSOR)
-    include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
   endif()
-  include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL)
+  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Swift_COMPILER_ID}-Swift OPTIONAL)
 endif()
 
 # for most systems a module is the same as a shared library
diff --git a/Modules/CMakeSystemSpecificInitialize.cmake b/Modules/CMakeSystemSpecificInitialize.cmake
index 6200e9c..629f226 100644
--- a/Modules/CMakeSystemSpecificInitialize.cmake
+++ b/Modules/CMakeSystemSpecificInitialize.cmake
@@ -5,6 +5,14 @@
 # This file is included by cmGlobalGenerator::EnableLanguage.
 # It is included before the compiler has been determined.
 
+# The CMAKE_EFFECTIVE_SYSTEM_NAME is used to load compiler and compiler
+# wrapper configuration files. By default it equals to CMAKE_SYSTEM_NAME
+# but could be overridden in the ${CMAKE_SYSTEM_NAME}-Initialize files.
+#
+# It is useful to share the same aforementioned configuration files and
+# avoids duplicating them in case of tightly related platforms.
+set(CMAKE_EFFECTIVE_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
+
 include(Platform/${CMAKE_SYSTEM_NAME}-Initialize OPTIONAL)
 
 set(CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED 1)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fa0f2eb5638b5863c573c0ef1922d4cb2c729d5
commit 9fa0f2eb5638b5863c573c0ef1922d4cb2c729d5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 18 07:28:47 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Apr 18 07:31:35 2018 -0400

    CMakeFindPackageMode: Perform platform-specific initialization
    
    Since commit v3.1.0-rc1~565^2~3 (Add platform-specific initialization
    step when enabling languages, 2014-04-29) the main enable-language logic
    includes the `CMakeSystemSpecificInitialize` module to perform
    platform-specific initialization based on `CMAKE_SYSTEM_NAME`.  This
    should be done during `cmake --find-package` mode too.

diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index 7c41d49..ec3652c 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -65,6 +65,8 @@ if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin  AND  "${COMPILER_ID}" MATCHES GNU)
   set(CMAKE_${LANGUAGE}_OSX_DEPLOYMENT_TARGET_FLAG "")
 endif()
 
+include(CMakeSystemSpecificInitialize)
+
 # Also load the system specific file, which sets up e.g. the search paths.
 # This makes the FIND_XXX() calls work much better
 include(CMakeSystemSpecificInformation)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d67962c55a4be2653d40b27c4f5fc38fc5c223b0
commit d67962c55a4be2653d40b27c4f5fc38fc5c223b0
Author:     Ephi Sinowitz <esinowitz at bloomberg.net>
AuthorDate: Thu Apr 12 15:44:42 2018 -0400
Commit:     Ephi Sinowitz <esinowitz at bloomberg.net>
CommitDate: Tue Apr 17 15:35:49 2018 -0400

    SunPro,XL: Add depfile flags to support Ninja generator
    
    Add CMAKE_DEPFILE_FLAGS_${lang} to SunPro and XL. These flags are used
    by the Ninja generator.

diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 29c2f22..8d0e6d6 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -18,6 +18,8 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
 string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
 string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
 
+set(CMAKE_DEPFILE_FLAGS_C "-xMD -xMF <DEPFILE>")
+
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 5cb7edc..14196b7 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -18,6 +18,8 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
 string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
 string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
 
+set(CMAKE_DEPFILE_FLAGS_CXX "-xMD -xMF <DEPFILE>")
+
 # Initialize C link type selection flags.  These flags are used when
 # building a shared library, shared module, or executable that links
 # to other libraries to select whether to use the static or shared
diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake
index e527a04..3361f8f 100644
--- a/Modules/Compiler/XL.cmake
+++ b/Modules/Compiler/XL.cmake
@@ -30,6 +30,8 @@ macro(__compiler_xl lang)
   set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
   set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE     "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
 
+  set(CMAKE_DEPFILE_FLAGS_${lang} "-MF <DEPFILE> -qmakedep=gcc")
+
   # CMAKE_XL_CreateExportList is part of the AIX XL compilers but not the linux ones.
   # If we found the tool, we'll use it to create exports, otherwise stick with the regular
   # create shared library compile line.

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

Summary of changes:
 Help/manual/ccmake.1.rst                           |    2 +-
 Help/manual/cmake-gui.1.rst                        |    2 +-
 Help/manual/cmake-policies.7.rst                   |    1 +
 Help/manual/cmake.1.rst                            |    4 +-
 Help/manual/ctest.1.rst                            |    2 +-
 Help/policy/CMP0075.rst                            |   26 ++++
 .../release/dev/CheckIncludeFile-required-libs.rst |   14 +++
 Modules/CMakeASMInformation.cmake                  |    8 +-
 Modules/CMakeCInformation.cmake                    |    8 +-
 Modules/CMakeCUDAInformation.cmake                 |    4 +-
 Modules/CMakeCXXInformation.cmake                  |    8 +-
 Modules/CMakeFindPackageMode.cmake                 |    2 +
 Modules/CMakeFortranInformation.cmake              |    4 +-
 Modules/CMakeLanguageInformation.cmake             |    4 +-
 Modules/CMakeSwiftInformation.cmake                |    4 +-
 Modules/CMakeSystemSpecificInitialize.cmake        |   13 ++
 Modules/CheckIncludeFile.cmake                     |   27 +++++
 Modules/CheckIncludeFileCXX.cmake                  |   27 +++++
 Modules/CheckIncludeFiles.cmake                    |   27 +++++
 Modules/Compiler/SunPro-C.cmake                    |    2 +
 Modules/Compiler/SunPro-CXX.cmake                  |    2 +
 Modules/Compiler/XL.cmake                          |    2 +
 Modules/InstallRequiredSystemLibraries.cmake       |    8 ++
 ...ft-Fortran.cmake => Apple-Absoft-Fortran.cmake} |    0
 ...AppleClang-C.cmake => Apple-AppleClang-C.cmake} |    2 +-
 ...eClang-CXX.cmake => Apple-AppleClang-CXX.cmake} |    2 +-
 Modules/Platform/Apple-Clang-C.cmake               |    2 +
 Modules/Platform/Apple-Clang-CXX.cmake             |    2 +
 .../{Darwin-Clang.cmake => Apple-Clang.cmake}      |    7 +-
 .../{Darwin-GNU-C.cmake => Apple-GNU-C.cmake}      |    4 +-
 .../{Darwin-GNU-CXX.cmake => Apple-GNU-CXX.cmake}  |    4 +-
 ...n-GNU-Fortran.cmake => Apple-GNU-Fortran.cmake} |    4 +-
 .../Platform/{Darwin-GNU.cmake => Apple-GNU.cmake} |    7 +-
 Modules/Platform/Apple-Intel-C.cmake               |    2 +
 Modules/Platform/Apple-Intel-CXX.cmake             |    2 +
 ...tel-Fortran.cmake => Apple-Intel-Fortran.cmake} |    4 +-
 .../{Darwin-Intel.cmake => Apple-Intel.cmake}      |    7 +-
 ...n-NAG-Fortran.cmake => Apple-NAG-Fortran.cmake} |    0
 ...n-NVIDIA-CUDA.cmake => Apple-NVIDIA-CUDA.cmake} |    0
 Modules/Platform/Apple-PGI-C.cmake                 |    2 +
 Modules/Platform/Apple-PGI-CXX.cmake               |    2 +
 Modules/Platform/Apple-PGI-Fortran.cmake           |    2 +
 .../Platform/{Darwin-PGI.cmake => Apple-PGI.cmake} |    7 +-
 Modules/Platform/Apple-VisualAge-C.cmake           |    1 +
 Modules/Platform/Apple-VisualAge-CXX.cmake         |    1 +
 .../{Darwin-XL-C.cmake => Apple-XL-C.cmake}        |    0
 .../{Darwin-XL-CXX.cmake => Apple-XL-CXX.cmake}    |    0
 Modules/Platform/Darwin-Clang-C.cmake              |    2 -
 Modules/Platform/Darwin-Clang-CXX.cmake            |    2 -
 Modules/Platform/Darwin-Initialize.cmake           |    4 +
 Modules/Platform/Darwin-Intel-C.cmake              |    2 -
 Modules/Platform/Darwin-Intel-CXX.cmake            |    2 -
 Modules/Platform/Darwin-PGI-C.cmake                |    2 -
 Modules/Platform/Darwin-PGI-CXX.cmake              |    2 -
 Modules/Platform/Darwin-PGI-Fortran.cmake          |    2 -
 Modules/Platform/Darwin-VisualAge-C.cmake          |    1 -
 Modules/Platform/Darwin-VisualAge-CXX.cmake        |    1 -
 Source/cmCMakePolicyCommand.cxx                    |    9 +-
 Source/cmGlobalGenerator.cxx                       |    7 ++
 Source/cmMakefile.cxx                              |    6 +-
 Source/cmMakefile.h                                |    3 +-
 Source/cmPolicies.h                                |    5 +-
 Source/cmStateSnapshot.cxx                         |    8 +-
 Source/cmStateSnapshot.h                           |    3 +-
 Tests/PolicyScope/CMakeLists.txt                   |    8 ++
 Tests/RunCMake/CheckModules/CMP0075-stderr.txt     |   50 ++++++++
 Tests/RunCMake/CheckModules/CMP0075.cmake          |  124 ++++++++++++++++++++
 Tests/RunCMake/CheckModules/RunCMakeTest.cmake     |    2 +
 68 files changed, 429 insertions(+), 81 deletions(-)
 create mode 100644 Help/policy/CMP0075.rst
 create mode 100644 Help/release/dev/CheckIncludeFile-required-libs.rst
 rename Modules/Platform/{Darwin-Absoft-Fortran.cmake => Apple-Absoft-Fortran.cmake} (100%)
 rename Modules/Platform/{Darwin-AppleClang-C.cmake => Apple-AppleClang-C.cmake} (83%)
 rename Modules/Platform/{Darwin-AppleClang-CXX.cmake => Apple-AppleClang-CXX.cmake} (83%)
 create mode 100644 Modules/Platform/Apple-Clang-C.cmake
 create mode 100644 Modules/Platform/Apple-Clang-CXX.cmake
 rename Modules/Platform/{Darwin-Clang.cmake => Apple-Clang.cmake} (93%)
 rename Modules/Platform/{Darwin-GNU-C.cmake => Apple-GNU-C.cmake} (57%)
 rename Modules/Platform/{Darwin-GNU-CXX.cmake => Apple-GNU-CXX.cmake} (58%)
 rename Modules/Platform/{Darwin-GNU-Fortran.cmake => Apple-GNU-Fortran.cmake} (86%)
 rename Modules/Platform/{Darwin-GNU.cmake => Apple-GNU.cmake} (95%)
 create mode 100644 Modules/Platform/Apple-Intel-C.cmake
 create mode 100644 Modules/Platform/Apple-Intel-CXX.cmake
 rename Modules/Platform/{Darwin-Intel-Fortran.cmake => Apple-Intel-Fortran.cmake} (81%)
 rename Modules/Platform/{Darwin-Intel.cmake => Apple-Intel.cmake} (84%)
 rename Modules/Platform/{Darwin-NAG-Fortran.cmake => Apple-NAG-Fortran.cmake} (100%)
 rename Modules/Platform/{Darwin-NVIDIA-CUDA.cmake => Apple-NVIDIA-CUDA.cmake} (100%)
 create mode 100644 Modules/Platform/Apple-PGI-C.cmake
 create mode 100644 Modules/Platform/Apple-PGI-CXX.cmake
 create mode 100644 Modules/Platform/Apple-PGI-Fortran.cmake
 rename Modules/Platform/{Darwin-PGI.cmake => Apple-PGI.cmake} (80%)
 create mode 100644 Modules/Platform/Apple-VisualAge-C.cmake
 create mode 100644 Modules/Platform/Apple-VisualAge-CXX.cmake
 rename Modules/Platform/{Darwin-XL-C.cmake => Apple-XL-C.cmake} (100%)
 rename Modules/Platform/{Darwin-XL-CXX.cmake => Apple-XL-CXX.cmake} (100%)
 delete mode 100644 Modules/Platform/Darwin-Clang-C.cmake
 delete mode 100644 Modules/Platform/Darwin-Clang-CXX.cmake
 delete mode 100644 Modules/Platform/Darwin-Intel-C.cmake
 delete mode 100644 Modules/Platform/Darwin-Intel-CXX.cmake
 delete mode 100644 Modules/Platform/Darwin-PGI-C.cmake
 delete mode 100644 Modules/Platform/Darwin-PGI-CXX.cmake
 delete mode 100644 Modules/Platform/Darwin-PGI-Fortran.cmake
 delete mode 100644 Modules/Platform/Darwin-VisualAge-C.cmake
 delete mode 100644 Modules/Platform/Darwin-VisualAge-CXX.cmake
 create mode 100644 Tests/RunCMake/CheckModules/CMP0075-stderr.txt
 create mode 100644 Tests/RunCMake/CheckModules/CMP0075.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list