[Cmake-commits] CMake branch, master, updated. v3.10.0-622-ga363c93

Kitware Robot kwrobot at kitware.com
Wed Dec 13 07:55:21 EST 2017


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  a363c9356d60ea2cfdae7bd8a35b87cac463c4fc (commit)
       via  f0b3fab179d0ebad7e0bcc6e564d989f992bcb84 (commit)
       via  95e86eafd71928dbdcdcd135951a172891eb6189 (commit)
       via  3395aec7b8d8242d1eb6c18b57aa4cbab3e9c6bc (commit)
       via  372dc9b0879d36e4017122ab0e7c7fd63a0763d5 (commit)
       via  4dae55fb70de42c2b55676f78ea7f0c6c8ad51b4 (commit)
       via  d1d8719f623fe570142c67bf8d54c43f31355262 (commit)
       via  834d1878415fddb04b388b042dba7ce55a9a8a5d (commit)
       via  c6a83ecf1761eea8d0907ea9d8913fe56029a00d (commit)
       via  a6005371b05eff6104cd94848c610cd7af841ab6 (commit)
       via  362a1f336d29fb315db937dcce4dbd894bbffd2d (commit)
       via  c365a0787058e41f0e96f4dd2447cb71a17f7696 (commit)
       via  c62ffdcd4f6f638a7d57221528ffbe112887c1b4 (commit)
      from  c97734280f5e5f2eab588b7b9f177a8e7f19c042 (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=a363c9356d60ea2cfdae7bd8a35b87cac463c4fc
commit a363c9356d60ea2cfdae7bd8a35b87cac463c4fc
Merge: f0b3fab d1d8719
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Dec 13 12:51:34 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Dec 13 07:52:54 2017 -0500

    Merge topic 'findmpi-builtin-fix'
    
    d1d8719f FindMPI: Fix various legacy problems
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1569


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0b3fab179d0ebad7e0bcc6e564d989f992bcb84
commit f0b3fab179d0ebad7e0bcc6e564d989f992bcb84
Merge: 95e86ea 4dae55f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Dec 13 12:50:46 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Dec 13 07:50:52 2017 -0500

    Merge topic 'irsl-msvc-omp-fix'
    
    4dae55fb IRSL: Fix MSVC variable deferencing
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1588


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95e86eafd71928dbdcdcd135951a172891eb6189
commit 95e86eafd71928dbdcdcd135951a172891eb6189
Merge: 3395aec a600537
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Dec 13 12:49:46 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Dec 13 07:50:02 2017 -0500

    Merge topic 'FindPerlLibs-MacOS-failure'
    
    a6005371 FindPerlLibs: Add support for MSYS and CYGWIN
    362a1f33 FindPerlLibs: refactoring
    c365a078 FindPerlLibs: fix MacOS failure
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1586


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3395aec7b8d8242d1eb6c18b57aa4cbab3e9c6bc
commit 3395aec7b8d8242d1eb6c18b57aa4cbab3e9c6bc
Merge: 372dc9b c62ffdc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Dec 13 12:49:04 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Dec 13 07:49:18 2017 -0500

    Merge topic 'use-std-string'
    
    c62ffdcd cmIDEOptions: use std::string instead of const char*
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1580


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=372dc9b0879d36e4017122ab0e7c7fd63a0763d5
commit 372dc9b0879d36e4017122ab0e7c7fd63a0763d5
Merge: c977342 834d187
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Dec 13 12:48:13 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Dec 13 07:48:29 2017 -0500

    Merge topic 'update-kwsys'
    
    834d1878 Merge branch 'upstream-KWSys' into update-kwsys
    c6a83ecf KWSys 2017-12-12 (3ba214b7)
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1587


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4dae55fb70de42c2b55676f78ea7f0c6c8ad51b4
commit 4dae55fb70de42c2b55676f78ea7f0c6c8ad51b4
Author:     Christian Pfeiffer <cpfeiffer at live.de>
AuthorDate: Tue Dec 12 15:15:00 2017 +0100
Commit:     Christian Pfeiffer <cpfeiffer at live.de>
CommitDate: Tue Dec 12 15:16:38 2017 +0100

    IRSL: Fix MSVC variable deferencing
    
    Fixes: #17529

diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 1ba4877..f62bd09 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -56,10 +56,13 @@
 #   Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
 #   option.  If not specified, no such option will be used.
 
+cmake_policy(PUSH)
+cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
+
 set(_IRSL_HAVE_Intel FALSE)
 set(_IRSL_HAVE_MSVC FALSE)
 foreach(LANG IN ITEMS C CXX Fortran)
-  if(CMAKE_${LANG}_COMPILER_ID STREQUAL Intel)
+  if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel")
     if(NOT _IRSL_HAVE_Intel)
       get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
       if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -81,7 +84,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
       endif()
       set(_IRSL_HAVE_Intel TRUE)
     endif()
-  elseif(CMAKE_${LANG}_COMPILER_ID STREQUAL MSVC)
+  elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
     set(_IRSL_HAVE_MSVC TRUE)
   endif()
 endforeach()
@@ -740,3 +743,5 @@ if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
       )
   endif()
 endif()
+
+cmake_policy(POP)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1d8719f623fe570142c67bf8d54c43f31355262
commit d1d8719f623fe570142c67bf8d54c43f31355262
Author:     Christian Pfeiffer <cpfeiffer at live.de>
AuthorDate: Thu Dec 7 15:55:02 2017 +0100
Commit:     Christian Pfeiffer <cpfeiffer at live.de>
CommitDate: Tue Dec 12 14:20:02 2017 +0100

    FindMPI: Fix various legacy problems
    
    This MR fixes a number of bugs stemming from legacy variable handling,
    partially introduced by commit v3.10.0-rc1~103^2 (FindMPI: Add support
    for FreeBSD and SLES, 2017-08-09).
    
    * `MPI_COMPILE_OPTIONS` and `MPI_COMPILE_DEFINITIONS` legacy hints were not passed correctly.
    * Legacy variables could be parsed after they were set by `FindMPI` cause erroneous hinting on subsequent runs.
    * In the case of the compiler supporting MPI implicitly:
    	* not all consumption variables would be correctly reset.
    	* `MPI_<LANG>_HEADER_DIR` would be set unintentionally.
    	* `MPI_<LANG>_LIB_NAMES` appeared in cache despite being ignored.
    	* on subsequent passes, `MPI_<LANG>_COMPILER` could be corrupted.
    * the C-to-CXX copy logic would take place even if `MPI_SKIP_GUESSING` was turned on
    * if only some language compilers were given, inconsistent search behavior could be observed
    
    Issue: #17538

diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 0a011af..22493f6 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -602,9 +602,6 @@ function (_MPI_interrogate_compiler lang)
   if(MPI_DIRECT_LIB_NAMES_WORK)
     set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}")
   endif()
-  if(MPI_${LANG}_EXTRA_LIB_NAMES)
-    list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}")
-  endif()
 
   # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to
   # link it in that case. -lpthread is covered by the normal library treatment on the other hand.
@@ -617,6 +614,16 @@ function (_MPI_interrogate_compiler lang)
     endif()
   endif()
 
+  if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS)
+    list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}")
+  endif()
+  if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS)
+    list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}")
+  endif()
+  if(MPI_${LANG}_EXTRA_LIB_NAMES)
+    list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}")
+  endif()
+
   # If we found MPI, set up all of the appropriate cache entries
   if(NOT MPI_${LANG}_COMPILE_OPTIONS)
     set(MPI_${LANG}_COMPILE_OPTIONS          ${MPI_COMPILE_OPTIONS_WORK}     CACHE STRING "MPI ${LANG} compilation options"            FORCE)
@@ -825,33 +832,43 @@ endfunction()
 
 macro(_MPI_assemble_libraries LANG)
   set(MPI_${LANG}_LIBRARIES "")
-  foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES)
-    list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY})
-  endforeach()
+  # Only for libraries do we need to check whether the compiler's linking stage is separate.
+  if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT)
+    foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES)
+      list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY})
+    endforeach()
+  endif()
 endmacro()
 
 macro(_MPI_assemble_include_dirs LANG)
-  set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}")
-  if("${LANG}" MATCHES "(C|CXX)")
-    if(MPI_${LANG}_HEADER_DIR)
-      list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}")
-    endif()
-  else() # Fortran
-    if(MPI_${LANG}_F77_HEADER_DIR)
-      list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}")
+  if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+    set(MPI_${LANG}_INCLUDE_DIRS "")
+  else()
+    set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}")
+    if("${LANG}" MATCHES "(C|CXX)")
+      if(MPI_${LANG}_HEADER_DIR)
+        list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}")
+      endif()
+    else() # Fortran
+      if(MPI_${LANG}_F77_HEADER_DIR)
+        list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}")
+      endif()
+      if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS)
+        list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}")
+      endif()
     endif()
-    if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS)
-      list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}")
+    if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
+      foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
+        list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}")
+      endforeach()
     endif()
   endif()
-  if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
-    foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS)
-      list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}")
-    endforeach()
-  endif()
 endmacro()
 
 function(_MPI_split_include_dirs LANG)
+  if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+    return()
+  endif()
   # Backwards compatibility: Search INCLUDE_PATH if given.
   if(MPI_${LANG}_INCLUDE_PATH)
     list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}")
@@ -887,6 +904,13 @@ function(_MPI_split_include_dirs LANG)
     endif()
     mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR)
   endif()
+  # Remove duplicates and default system directories from the list.
+  if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)
+    list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)
+    foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES)
+      list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR})
+    endforeach()
+  endif()
   set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE)
 endfunction()
 
@@ -1016,7 +1040,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
 elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD")
   # FreeBSD ships mpich under the normal system paths - but available openmpi implementations
   # will be found in /usr/local/mpi/<name>
-  MPI_search_mpi_prefix_folder("/usr/local/mpi/")
+  MPI_search_mpi_prefix_folder("/usr/local/mpi")
 endif()
 
 # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for.
@@ -1052,51 +1076,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE
 #
 # Once we find the new variables, we translate them back into their old
 # equivalents below.
-foreach (LANG IN ITEMS C CXX)
-  # Old input variables.
-  set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
-
-  # Set new vars based on their old equivalents, if the new versions are not already set.
-  foreach (var ${_MPI_OLD_INPUT_VARS})
-    if (NOT MPI_${LANG}_${var} AND MPI_${var})
-      set(MPI_${LANG}_${var} "${MPI_${var}}")
-    endif()
-  endforeach()
-
-  # Chop the old compile flags into options and definitions
-  if(MPI_${LANG}_COMPILE_FLAGS)
-    unset(MPI_${LANG}_COMPILE_OPTIONS)
-    unset(MPI_${LANG}_COMPILE_DEFINITIONS)
-    separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}")
-    foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS)
-      if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)")
-        list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}")
-      else()
-        list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}")
+if(NOT MPI_IGNORE_LEGACY_VARIABLES)
+  foreach (LANG IN ITEMS C CXX)
+    # Old input variables.
+    set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
+
+    # Set new vars based on their old equivalents, if the new versions are not already set.
+    foreach (var ${_MPI_OLD_INPUT_VARS})
+      if (NOT MPI_${LANG}_${var} AND MPI_${var})
+        set(MPI_${LANG}_${var} "${MPI_${var}}")
       endif()
     endforeach()
-    unset(MPI_SEPARATE_FLAGS)
-  endif()
 
-  # If a list of libraries was given, we'll split it into new-style cache variables
-  unset(MPI_${LANG}_EXTRA_LIB_NAMES)
-  if(NOT MPI_${LANG}_LIB_NAMES)
-    foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY)
-      if(_MPI_LIB)
-        get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
-        get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
-        get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
-        list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}")
-        find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
-          NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
-          HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
-          DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
-        )
-        mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
-      endif()
-    endforeach()
-  endif()
-endforeach()
+    # Chop the old compile flags into options and definitions
+
+    unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS)
+    unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS)
+    if(MPI_${LANG}_COMPILE_FLAGS)
+      separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}")
+      foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS)
+        if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)")
+          list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}")
+        else()
+          list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}")
+        endif()
+      endforeach()
+      unset(MPI_SEPARATE_FLAGS)
+    endif()
+
+    # If a list of libraries was given, we'll split it into new-style cache variables
+    unset(MPI_${LANG}_EXTRA_LIB_NAMES)
+    if(NOT MPI_${LANG}_LIB_NAMES)
+      foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY)
+        if(_MPI_LIB)
+          get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
+          get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
+          get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
+          list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}")
+          find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
+            NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
+            HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
+            DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
+          )
+          mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
+        endif()
+      endforeach()
+    endif()
+  endforeach()
+endif()
 #=============================================================================
 
 unset(MPI_VERSION)
@@ -1105,6 +1132,11 @@ unset(MPI_VERSION_MINOR)
 
 unset(_MPI_MIN_VERSION)
 
+# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually.
+if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME)
+  set(MPI_SKIP_COMPILER_WRAPPER TRUE)
+endif()
+
 # This loop finds the compilers and sends them off for interrogation.
 foreach(LANG IN ITEMS C CXX Fortran)
   if(CMAKE_${LANG}_COMPILER_LOADED)
@@ -1126,6 +1158,8 @@ foreach(LANG IN ITEMS C CXX Fortran)
       mark_as_advanced(MPI_CXX_SKIP_MPICXX)
     endif()
     if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS)))
+      set(MPI_${LANG}_TRIED_IMPLICIT FALSE)
+      set(MPI_${LANG}_WORKS_IMPLICIT FALSE)
       if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI)
         # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g.
         # Cray PrgEnv.
@@ -1135,80 +1169,90 @@ foreach(LANG IN ITEMS C CXX Fortran)
         # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it.
         if(MPI_${LANG}_WORKS)
           set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE)
+          set(MPI_${LANG}_WORKS_IMPLICIT TRUE)
         endif()
+        set(MPI_${LANG}_TRIED_IMPLICIT TRUE)
       endif()
 
-      # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually.
-      if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME)
-        set(MPI_SKIP_COMPILER_WRAPPER TRUE)
-      endif()
-      if(NOT MPI_SKIP_COMPILER_WRAPPER)
-        if(MPI_${LANG}_COMPILER)
-          # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
-          if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}")
-            # Get rid of our default list of names and just search for the name the user wants.
-            set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}")
-            unset(MPI_${LANG}_COMPILER CACHE)
+      if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS)
+        set(MPI_${LANG}_WRAPPER_FOUND FALSE)
+        set(MPI_PINNED_COMPILER FALSE)
+
+        if(NOT MPI_SKIP_COMPILER_WRAPPER)
+          if(MPI_${LANG}_COMPILER)
+            # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
+            if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}")
+              # Get rid of our default list of names and just search for the name the user wants.
+              set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}")
+              unset(MPI_${LANG}_COMPILER CACHE)
+            endif()
+            # If the user specifies a compiler, we don't want to try to search libraries either.
+            set(MPI_PINNED_COMPILER TRUE)
+          endif()
+
+          # If we have an MPI base directory, we'll try all compiler names in that one first.
+          # This should prevent mixing different MPI environments
+          if(_MPI_BASE_DIR)
+            find_program(MPI_${LANG}_COMPILER
+              NAMES  ${_MPI_${LANG}_COMPILER_NAMES}
+              PATH_SUFFIXES bin sbin
+              HINTS  ${_MPI_BASE_DIR}
+              NO_DEFAULT_PATH
+              DOC    "MPI compiler for ${LANG}"
+            )
           endif()
-          # If the user specifies a compiler, we don't want to try to search libraries either.
-          set(MPI_PINNED_COMPILER TRUE)
-        else()
-          set(MPI_PINNED_COMPILER FALSE)
-        endif()
 
-        # If we have an MPI base directory, we'll try all compiler names in that one first.
-        # This should prevent mixing different MPI environments
-        if(_MPI_BASE_DIR)
+          # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers),
+          # we shall try searching in the default paths.
           find_program(MPI_${LANG}_COMPILER
             NAMES  ${_MPI_${LANG}_COMPILER_NAMES}
             PATH_SUFFIXES bin sbin
-            HINTS  ${_MPI_BASE_DIR}
-            NO_DEFAULT_PATH
             DOC    "MPI compiler for ${LANG}"
           )
-        endif()
 
-        # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers),
-        # we shall try searching in the default paths.
-        find_program(MPI_${LANG}_COMPILER
-          NAMES  ${_MPI_${LANG}_COMPILER_NAMES}
-          PATH_SUFFIXES bin sbin
-          DOC    "MPI compiler for ${LANG}"
-        )
-
-        if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
-          set(MPI_SKIP_GUESSING TRUE)
-        elseif(MPI_${LANG}_COMPILER)
-          _MPI_interrogate_compiler(${LANG})
-        else()
-          set(MPI_${LANG}_WRAPPER_FOUND FALSE)
+          if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}")
+            set(MPI_PINNED_COMPILER TRUE)
+
+            # If we haven't made the implicit compiler test yet, perform it now.
+            if(NOT MPI_${LANG}_TRIED_IMPLICIT)
+              _MPI_create_imported_target(${LANG})
+              _MPI_check_lang_works(${LANG})
+            endif()
+
+            # Should the MPI compiler not work implicitly for MPI, still interrogate it.
+            # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used
+            # directly during linkage instead of CMAKE_<LANG>_COMPILER will not work.
+            if(NOT MPI_${LANG}_WORKS)
+              set(MPI_${LANG}_WORKS_IMPLICIT FALSE)
+              _MPI_interrogate_compiler(${LANG})
+            else()
+              set(MPI_${LANG}_WORKS_IMPLICIT TRUE)
+            endif()
+          elseif(MPI_${LANG}_COMPILER)
+            _MPI_interrogate_compiler(${LANG})
+          endif()
         endif()
-      else()
-        set(MPI_${LANG}_WRAPPER_FOUND FALSE)
-        set(MPI_PINNED_COMPILER FALSE)
-      endif()
 
-      if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER)
-        # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the
-        # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI.
-        if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
-          set(MPI_${LANG}_COMPILE_OPTIONS          ${MPI_C_COMPILE_OPTIONS}     CACHE STRING "MPI ${LANG} compilation options"           )
-          set(MPI_${LANG}_COMPILE_DEFINITIONS      ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions"       )
-          set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS  ${MPI_C_INCLUDE_DIRS}        CACHE STRING "MPI ${LANG} additional include directories")
-          set(MPI_${LANG}_LINK_FLAGS               ${MPI_C_LINK_FLAGS}          CACHE STRING "MPI ${LANG} linker flags"                  )
-          set(MPI_${LANG}_LIB_NAMES                ${MPI_C_LIB_NAMES}           CACHE STRING "MPI ${LANG} libraries to link against"     )
-          set(MPI_${LANG}_WRAPPER_FOUND TRUE)
-        elseif(NOT MPI_SKIP_GUESSING)
-          _MPI_guess_settings(${LANG})
+        if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER)
+          # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the
+          # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI.
+          if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND)
+            set(MPI_${LANG}_COMPILE_OPTIONS          ${MPI_C_COMPILE_OPTIONS}     CACHE STRING "MPI ${LANG} compilation options"           )
+            set(MPI_${LANG}_COMPILE_DEFINITIONS      ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions"       )
+            set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS  ${MPI_C_INCLUDE_DIRS}        CACHE STRING "MPI ${LANG} additional include directories")
+            set(MPI_${LANG}_LINK_FLAGS               ${MPI_C_LINK_FLAGS}          CACHE STRING "MPI ${LANG} linker flags"                  )
+            set(MPI_${LANG}_LIB_NAMES                ${MPI_C_LIB_NAMES}           CACHE STRING "MPI ${LANG} libraries to link against"     )
+          else()
+            _MPI_guess_settings(${LANG})
+          endif()
         endif()
       endif()
     endif()
 
     _MPI_split_include_dirs(${LANG})
-    if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
-      _MPI_assemble_include_dirs(${LANG})
-      _MPI_assemble_libraries(${LANG})
-    endif()
+    _MPI_assemble_include_dirs(${LANG})
+    _MPI_assemble_libraries(${LANG})
+
     _MPI_adjust_compile_definitions(${LANG})
     # We always create imported targets even if they're empty
     _MPI_create_imported_target(${LANG})
@@ -1222,7 +1266,9 @@ foreach(LANG IN ITEMS C CXX Fortran)
     set(MPI_${LANG}_COMPILE_DEFINITIONS      "" CACHE STRING "MPI ${LANG} compilation definitions"       )
     set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS  "" CACHE STRING "MPI ${LANG} additional include directories")
     set(MPI_${LANG}_LINK_FLAGS               "" CACHE STRING "MPI ${LANG} linker flags"                  )
-    set(MPI_${LANG}_LIB_NAMES                "" CACHE STRING "MPI ${LANG} libraries to link against"     )
+    if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER)
+      set(MPI_${LANG}_LIB_NAMES                "" CACHE STRING "MPI ${LANG} libraries to link against"   )
+    endif()
     mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS
       MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER)
 
@@ -1453,6 +1499,7 @@ if (MPI_NUMLIBS GREATER 1)
 else()
   set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND")
 endif()
+set(MPI_IGNORE_LEGACY_VARIABLES TRUE)
 #=============================================================================
 
 # unset these vars to cleanup namespace

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=834d1878415fddb04b388b042dba7ce55a9a8a5d
commit 834d1878415fddb04b388b042dba7ce55a9a8a5d
Merge: 62d8bff c6a83ec
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 12 07:51:51 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Dec 12 07:51:51 2017 -0500

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2017-12-12 (3ba214b7)


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6a83ecf1761eea8d0907ea9d8913fe56029a00d
commit c6a83ecf1761eea8d0907ea9d8913fe56029a00d
Author:     KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Tue Dec 12 07:08:43 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Dec 12 07:51:50 2017 -0500

    KWSys 2017-12-12 (3ba214b7)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit 3ba214b7963fdd59f6f230c100550f9c5aa3deab (master).
    
    Upstream Shortlog
    -----------------
    
    Gregor Jasny (1):
          8e029751 SystemTools: Fix IsSubDirectory for subdirs of drive root

diff --git a/SystemTools.cxx b/SystemTools.cxx
index 50aa857..649f30b 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -4234,11 +4234,16 @@ bool SystemTools::IsSubDirectory(const std::string& cSubdir,
   std::string dir = cDir;
   SystemTools::ConvertToUnixSlashes(subdir);
   SystemTools::ConvertToUnixSlashes(dir);
-  if (subdir.size() > dir.size() && subdir[dir.size()] == '/') {
-    std::string s = subdir.substr(0, dir.size());
-    return SystemTools::ComparePath(s, dir);
+  if (subdir.size() <= dir.size() || dir.empty()) {
+    return false;
   }
-  return false;
+  bool isRootPath = *dir.rbegin() == '/'; // like "/" or "C:/"
+  size_t expectedSlashPosition = isRootPath ? dir.size() - 1u : dir.size();
+  if (subdir[expectedSlashPosition] != '/') {
+    return false;
+  }
+  std::string s = subdir.substr(0, dir.size());
+  return SystemTools::ComparePath(s, dir);
 }
 
 void SystemTools::Delay(unsigned int msec)
diff --git a/testSystemTools.cxx b/testSystemTools.cxx
index 3b694c9..a6af9cc 100644
--- a/testSystemTools.cxx
+++ b/testSystemTools.cxx
@@ -813,6 +813,39 @@ static bool CheckFind()
   return res;
 }
 
+static bool CheckIsSubDirectory()
+{
+  bool res = true;
+
+  if (kwsys::SystemTools::IsSubDirectory("/foo", "/") == false) {
+    std::cerr << "Problem with IsSubDirectory (root - unix): " << std::endl;
+    res = false;
+  }
+  if (kwsys::SystemTools::IsSubDirectory("c:/foo", "c:/") == false) {
+    std::cerr << "Problem with IsSubDirectory (root - dos): " << std::endl;
+    res = false;
+  }
+  if (kwsys::SystemTools::IsSubDirectory("/foo/bar", "/foo") == false) {
+    std::cerr << "Problem with IsSubDirectory (deep): " << std::endl;
+    res = false;
+  }
+  if (kwsys::SystemTools::IsSubDirectory("/foo", "/foo") == true) {
+    std::cerr << "Problem with IsSubDirectory (identity): " << std::endl;
+    res = false;
+  }
+  if (kwsys::SystemTools::IsSubDirectory("/fooo", "/foo") == true) {
+    std::cerr << "Problem with IsSubDirectory (substring): " << std::endl;
+    res = false;
+  }
+  if (kwsys::SystemTools::IsSubDirectory("/foo/", "/foo") == true) {
+    std::cerr << "Problem with IsSubDirectory (prepended slash): "
+              << std::endl;
+    res = false;
+  }
+
+  return res;
+}
+
 static bool CheckGetLineFromStream()
 {
   const std::string fileWithFiveCharsOnFirstLine(TEST_SYSTEMTOOLS_SOURCE_DIR
@@ -897,6 +930,8 @@ int testSystemTools(int, char* [])
 
   res &= CheckFind();
 
+  res &= CheckIsSubDirectory();
+
   res &= CheckGetLineFromStream();
 
   res &= CheckGetFilenameName();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6005371b05eff6104cd94848c610cd7af841ab6
commit a6005371b05eff6104cd94848c610cd7af841ab6
Author:     Marc Chevrier <marc.chevrier at sap.com>
AuthorDate: Tue Dec 12 11:42:28 2017 +0100
Commit:     Marc Chevrier <marc.chevrier at sap.com>
CommitDate: Tue Dec 12 11:42:28 2017 +0100

    FindPerlLibs: Add support for MSYS and CYGWIN

diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 86d5774..0b902e7 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -107,6 +107,11 @@ if (PERL_EXECUTABLE)
   if (NOT PERL_POSSIBLE_LIBRARY_NAMES)
     set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
   endif()
+  if (CMAKE_SYSTEM_NAME MATCHES "MSYS|CYGWIN")
+    # on MSYS and CYGWIN environments, current perl -V:libperl gives shared library name
+    # rather than the import library. So, extends possible library names
+    list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl)
+  endif()
 
   ### PERL_INCLUDE_PATH
   find_path(PERL_INCLUDE_PATH

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=362a1f336d29fb315db937dcce4dbd894bbffd2d
commit 362a1f336d29fb315db937dcce4dbd894bbffd2d
Author:     Marc Chevrier <marc.chevrier at sap.com>
AuthorDate: Tue Dec 12 09:41:16 2017 +0100
Commit:     Marc Chevrier <marc.chevrier at sap.com>
CommitDate: Tue Dec 12 09:41:16 2017 +0100

    FindPerlLibs: refactoring
    
    Use a dedicated function (perl_get_info) to retrieve various configuration information

diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 2767325..86d5774 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -33,6 +33,7 @@
 # ::
 #
 #   PERL_SITESEARCH     = path to the sitesearch install dir (-V:installsitesearch)
+#   PERL_SITEARCH       = path to the sitelib install directory (-V:installsitearch)
 #   PERL_SITELIB        = path to the sitelib install directory (-V:installsitelib)
 #   PERL_VENDORARCH     = path to the vendor arch install directory (-V:installvendorarch)
 #   PERL_VENDORLIB      = path to the vendor lib install directory (-V:installvendorlib)
@@ -46,182 +47,74 @@
 include(${CMAKE_CURRENT_LIST_DIR}/FindPerl.cmake)
 
 if (PERL_EXECUTABLE)
-  ### PERL_PREFIX
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:prefix
-      OUTPUT_VARIABLE
-        PERL_PREFIX_OUTPUT_VARIABLE
-      RESULT_VARIABLE
-        PERL_PREFIX_RESULT_VARIABLE
-  )
 
-  if (NOT PERL_PREFIX_RESULT_VARIABLE)
-    string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE})
-  endif ()
+  function (perl_get_info _pgi_info tag)
+    cmake_parse_arguments(_PGI "IS_PATH" "" "" ${ARGN})
 
-  ### PERL_ARCHNAME
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:archname
-      OUTPUT_VARIABLE
-        PERL_ARCHNAME_OUTPUT_VARIABLE
-      RESULT_VARIABLE
-        PERL_ARCHNAME_RESULT_VARIABLE
-  )
-  if (NOT PERL_ARCHNAME_RESULT_VARIABLE)
-    string(REGEX REPLACE "archname='([^']+)'.*" "\\1" PERL_ARCHNAME ${PERL_ARCHNAME_OUTPUT_VARIABLE})
-  endif ()
+    set (${_pgi_info} NOTFOUND PARENT_SCOPE)
 
+    execute_process(COMMAND "${PERL_EXECUTABLE}" -V:${tag}
+      OUTPUT_VARIABLE result
+      RESULT_VARIABLE status)
 
+    if (NOT status)
+      string(REGEX REPLACE "${tag}='([^']*)'.*" "\\1" result "${result}")
+      if (_PGI_IS_PATH)
+        file(TO_CMAKE_PATH "${result}" result)
+      endif()
+      set (${_pgi_info} "${result}" PARENT_SCOPE)
+    endif ()
+  endfunction()
+
+  ### PERL_PREFIX
+  perl_get_info(PERL_PREFIX prefix IS_PATH)
+
+  ### PERL_ARCHNAME
+  perl_get_info(PERL_ARCHNAME archname)
 
   ### PERL_EXTRA_C_FLAGS
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:cppflags
-    OUTPUT_VARIABLE
-      PERL_CPPFLAGS_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_CPPFLAGS_RESULT_VARIABLE
-    )
-  if (NOT PERL_CPPFLAGS_RESULT_VARIABLE)
-    string(REGEX REPLACE "cppflags='([^']+)'.*" "\\1" PERL_EXTRA_C_FLAGS ${PERL_CPPFLAGS_OUTPUT_VARIABLE})
-  endif ()
+  perl_get_info(PERL_EXTRA_C_FLAGS cppflags)
 
   ### PERL_SITESEARCH
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:installsitesearch
-    OUTPUT_VARIABLE
-      PERL_SITESEARCH_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_SITESEARCH_RESULT_VARIABLE
-  )
-  if (NOT PERL_SITESEARCH_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH)
-  endif ()
+  perl_get_info(PERL_SITESEARCH installsitesearch IS_PATH)
+
+  ### PERL_SITEARCH
+  perl_get_info(PERL_SITEARCH installsitearch IS_PATH)
 
   ### PERL_SITELIB
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:installsitelib
-    OUTPUT_VARIABLE
-      PERL_SITELIB_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_SITELIB_RESULT_VARIABLE
-  )
-  if (NOT PERL_SITELIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB)
-  endif ()
+  perl_get_info(PERL_SITELIB installsitelib IS_PATH)
 
   ### PERL_VENDORARCH
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:installvendorarch
-    OUTPUT_VARIABLE
-      PERL_VENDORARCH_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_VENDORARCH_RESULT_VARIABLE
-    )
-  if (NOT PERL_VENDORARCH_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH)
-  endif ()
+  perl_get_info(PERL_VENDORARCH installvendorarch IS_PATH)
 
   ### PERL_VENDORLIB
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:installvendorlib
-    OUTPUT_VARIABLE
-      PERL_VENDORLIB_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_VENDORLIB_RESULT_VARIABLE
-  )
-  if (NOT PERL_VENDORLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
-  endif ()
+  perl_get_info(PERL_VENDORLIB installvendorlib IS_PATH)
 
   ### PERL_ARCHLIB
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:archlib
-      OUTPUT_VARIABLE
-        PERL_ARCHLIB_OUTPUT_VARIABLE
-      RESULT_VARIABLE
-        PERL_ARCHLIB_RESULT_VARIABLE
-  )
-  if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "archlib='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
-  endif ()
+  perl_get_info(PERL_ARCHLIB archlib IS_PATH)
 
   ### PERL_PRIVLIB
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:privlib
-    OUTPUT_VARIABLE
-      PERL_PRIVLIB_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_PRIVLIB_RESULT_VARIABLE
-  )
-  if (NOT PERL_PRIVLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "privlib='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB)
-  endif ()
+  perl_get_info(PERL_PRIVLIB privlib IS_PATH)
 
   ### PERL_UPDATE_ARCHLIB
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:installarchlib
-      OUTPUT_VARIABLE
-        PERL_UPDATE_ARCHLIB_OUTPUT_VARIABLE
-      RESULT_VARIABLE
-        PERL_UPDATE_ARCHLIB_RESULT_VARIABLE
-  )
-  if (NOT PERL_UPDATE_ARCHLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_UPDATE_ARCHLIB ${PERL_UPDATE_ARCHLIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_UPDATE_ARCHLIB}" PERL_UPDATE_ARCHLIB)
-  endif ()
+  perl_get_info(PERL_UPDATE_ARCHLIB installarchlib IS_PATH)
 
   ### PERL_UPDATE_PRIVLIB
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:installprivlib
-    OUTPUT_VARIABLE
-      PERL_UPDATE_PRIVLIB_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_UPDATE_PRIVLIB_RESULT_VARIABLE
-  )
-  if (NOT PERL_UPDATE_PRIVLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_UPDATE_PRIVLIB ${PERL_UPDATE_PRIVLIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_UPDATE_PRIVLIB}" PERL_UPDATE_PRIVLIB)
-  endif ()
+  perl_get_info(PERL_UPDATE_PRIVLIB installprivlib IS_PATH)
 
   ### PERL_POSSIBLE_LIBRARY_NAMES
-  execute_process(
-    COMMAND
-      ${PERL_EXECUTABLE} -V:libperl
-    OUTPUT_VARIABLE
-      PERL_LIBRARY_OUTPUT_VARIABLE
-    RESULT_VARIABLE
-      PERL_LIBRARY_RESULT_VARIABLE
-  )
-  if (NOT PERL_LIBRARY_RESULT_VARIABLE)
-    string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE})
-  else ()
+  perl_get_info(PERL_POSSIBLE_LIBRARY_NAMES libperl)
+  if (NOT PERL_POSSIBLE_LIBRARY_NAMES)
     set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
-  endif ()
+  endif()
 
   ### PERL_INCLUDE_PATH
   find_path(PERL_INCLUDE_PATH
     NAMES
       perl.h
     PATHS
-      ${PERL_UPDATE_ARCHLIB}/CORE
-      ${PERL_ARCHLIB}/CORE
+      "${PERL_UPDATE_ARCHLIB}/CORE"
+      "${PERL_ARCHLIB}/CORE"
       /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
       /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
       /usr/lib/perl5/${PERL_VERSION_STRING}/CORE
@@ -233,8 +126,8 @@ if (PERL_EXECUTABLE)
     NAMES
       ${PERL_POSSIBLE_LIBRARY_NAMES}
     PATHS
-      ${PERL_UPDATE_ARCHLIB}/CORE
-      ${PERL_ARCHLIB}/CORE
+      "${PERL_UPDATE_ARCHLIB}/CORE"
+      "${PERL_ARCHLIB}/CORE"
       /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
       /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
       /usr/lib/perl5/${PERL_VERSION_STRING}/CORE

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c365a0787058e41f0e96f4dd2447cb71a17f7696
commit c365a0787058e41f0e96f4dd2447cb71a17f7696
Author:     Marc Chevrier <marc.chevrier at sap.com>
AuthorDate: Tue Dec 12 09:35:50 2017 +0100
Commit:     Marc Chevrier <marc.chevrier at sap.com>
CommitDate: Tue Dec 12 09:38:39 2017 +0100

    FindPerlLibs: fix MacOS failure
    
    Fix library paths computation on MacOS
    
    Fixes: #12544

diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index e01e75e..2767325 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -32,12 +32,14 @@
 #
 # ::
 #
-#   PERL_SITESEARCH    = path to the sitesearch install dir
-#   PERL_SITELIB       = path to the sitelib install directory
-#   PERL_VENDORARCH    = path to the vendor arch install directory
-#   PERL_VENDORLIB     = path to the vendor lib install directory
-#   PERL_ARCHLIB       = path to the arch lib install directory
-#   PERL_PRIVLIB       = path to the priv lib install directory
+#   PERL_SITESEARCH     = path to the sitesearch install dir (-V:installsitesearch)
+#   PERL_SITELIB        = path to the sitelib install directory (-V:installsitelib)
+#   PERL_VENDORARCH     = path to the vendor arch install directory (-V:installvendorarch)
+#   PERL_VENDORLIB      = path to the vendor lib install directory (-V:installvendorlib)
+#   PERL_ARCHLIB        = path to the core arch lib install directory (-V:archlib)
+#   PERL_PRIVLIB        = path to the core priv lib install directory (-V:privlib)
+#   PERL_UPDATE_ARCHLIB = path to the update arch lib install directory (-V:installarchlib)
+#   PERL_UPDATE_PRIVLIB = path to the update priv lib install directory (-V:installprivlib)
 #   PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
 
 # find the perl executable
@@ -142,62 +144,62 @@ if (PERL_EXECUTABLE)
     file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
   endif ()
 
-  macro(perl_adjust_darwin_lib_variable varname)
-    string( TOUPPER PERL_${varname} FINDPERL_VARNAME )
-    string( TOLOWER install${varname} PERL_VARNAME )
-
-    if (NOT PERL_MINUSV_OUTPUT_VARIABLE)
-      execute_process(
-        COMMAND
-        ${PERL_EXECUTABLE} -V
-        OUTPUT_VARIABLE
-        PERL_MINUSV_OUTPUT_VARIABLE
-        RESULT_VARIABLE
-        PERL_MINUSV_RESULT_VARIABLE
-        )
-    endif()
-
-    if (NOT PERL_MINUSV_RESULT_VARIABLE)
-      string(REGEX MATCH "(${PERL_VARNAME}.*points? to the Updates directory)"
-        PERL_NEEDS_ADJUSTMENT ${PERL_MINUSV_OUTPUT_VARIABLE})
-
-      if (PERL_NEEDS_ADJUSTMENT)
-        string(REGEX REPLACE "(.*)/Updates/" "/System/\\1/" ${FINDPERL_VARNAME} ${${FINDPERL_VARNAME}})
-      endif ()
-
-    endif ()
-  endmacro()
-
   ### PERL_ARCHLIB
   execute_process(
     COMMAND
-      ${PERL_EXECUTABLE} -V:installarchlib
+      ${PERL_EXECUTABLE} -V:archlib
       OUTPUT_VARIABLE
         PERL_ARCHLIB_OUTPUT_VARIABLE
       RESULT_VARIABLE
         PERL_ARCHLIB_RESULT_VARIABLE
   )
   if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
-    perl_adjust_darwin_lib_variable( ARCHLIB )
+    string(REGEX REPLACE "archlib='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
     file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
   endif ()
 
   ### PERL_PRIVLIB
   execute_process(
     COMMAND
-      ${PERL_EXECUTABLE} -V:installprivlib
+      ${PERL_EXECUTABLE} -V:privlib
     OUTPUT_VARIABLE
       PERL_PRIVLIB_OUTPUT_VARIABLE
     RESULT_VARIABLE
       PERL_PRIVLIB_RESULT_VARIABLE
   )
   if (NOT PERL_PRIVLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
-    perl_adjust_darwin_lib_variable( PRIVLIB )
+    string(REGEX REPLACE "privlib='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
     file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB)
   endif ()
 
+  ### PERL_UPDATE_ARCHLIB
+  execute_process(
+    COMMAND
+      ${PERL_EXECUTABLE} -V:installarchlib
+      OUTPUT_VARIABLE
+        PERL_UPDATE_ARCHLIB_OUTPUT_VARIABLE
+      RESULT_VARIABLE
+        PERL_UPDATE_ARCHLIB_RESULT_VARIABLE
+  )
+  if (NOT PERL_UPDATE_ARCHLIB_RESULT_VARIABLE)
+    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_UPDATE_ARCHLIB ${PERL_UPDATE_ARCHLIB_OUTPUT_VARIABLE})
+    file(TO_CMAKE_PATH "${PERL_UPDATE_ARCHLIB}" PERL_UPDATE_ARCHLIB)
+  endif ()
+
+  ### PERL_UPDATE_PRIVLIB
+  execute_process(
+    COMMAND
+      ${PERL_EXECUTABLE} -V:installprivlib
+    OUTPUT_VARIABLE
+      PERL_UPDATE_PRIVLIB_OUTPUT_VARIABLE
+    RESULT_VARIABLE
+      PERL_UPDATE_PRIVLIB_RESULT_VARIABLE
+  )
+  if (NOT PERL_UPDATE_PRIVLIB_RESULT_VARIABLE)
+    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_UPDATE_PRIVLIB ${PERL_UPDATE_PRIVLIB_OUTPUT_VARIABLE})
+    file(TO_CMAKE_PATH "${PERL_UPDATE_PRIVLIB}" PERL_UPDATE_PRIVLIB)
+  endif ()
+
   ### PERL_POSSIBLE_LIBRARY_NAMES
   execute_process(
     COMMAND
@@ -218,6 +220,7 @@ if (PERL_EXECUTABLE)
     NAMES
       perl.h
     PATHS
+      ${PERL_UPDATE_ARCHLIB}/CORE
       ${PERL_ARCHLIB}/CORE
       /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
       /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
@@ -230,6 +233,7 @@ if (PERL_EXECUTABLE)
     NAMES
       ${PERL_POSSIBLE_LIBRARY_NAMES}
     PATHS
+      ${PERL_UPDATE_ARCHLIB}/CORE
       ${PERL_ARCHLIB}/CORE
       /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
       /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c62ffdcd4f6f638a7d57221528ffbe112887c1b4
commit c62ffdcd4f6f638a7d57221528ffbe112887c1b4
Author:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
AuthorDate: Fri Dec 8 22:30:16 2017 -0500
Commit:     Vitaly Stakhovsky <vvs31415 at gitlab.org>
CommitDate: Fri Dec 8 22:30:16 2017 -0500

    cmIDEOptions: use std::string instead of const char*
    
    Revise method signatures to save a few c_str() conversions.

diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index 5e872d2..4b59f44 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -155,12 +155,12 @@ std::vector<std::string> const& cmIDEOptions::GetDefines() const
   return this->Defines;
 }
 
-void cmIDEOptions::AddFlag(const char* flag, const char* value)
+void cmIDEOptions::AddFlag(std::string const& flag, std::string const& value)
 {
   this->FlagMap[flag] = value;
 }
 
-void cmIDEOptions::AddFlag(const char* flag,
+void cmIDEOptions::AddFlag(std::string const& flag,
                            std::vector<std::string> const& value)
 {
   this->FlagMap[flag] = value;
@@ -185,7 +185,7 @@ void cmIDEOptions::AppendFlagString(std::string const& flag,
   this->FlagMap[flag].append_with_space(value);
 }
 
-void cmIDEOptions::RemoveFlag(const char* flag)
+void cmIDEOptions::RemoveFlag(std::string const& flag)
 {
   this->FlagMap.erase(flag);
 }
@@ -195,12 +195,13 @@ bool cmIDEOptions::HasFlag(std::string const& flag) const
   return this->FlagMap.find(flag) != this->FlagMap.end();
 }
 
-const char* cmIDEOptions::GetFlag(const char* flag)
+const char* cmIDEOptions::GetFlag(std::string const& flag) const
 {
   // This method works only for single-valued flags!
-  std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(flag);
-  if (i != this->FlagMap.end() && i->second.size() == 1) {
+  std::map<std::string, FlagValue>::const_iterator i =
+    this->FlagMap.find(flag);
+  if (i != this->FlagMap.cend() && i->second.size() == 1) {
     return i->second[0].c_str();
   }
-  return 0;
+  return nullptr;
 }
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index af03128..ded92ca 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -26,15 +26,15 @@ public:
   void AddDefines(const std::vector<std::string>& defines);
   std::vector<std::string> const& GetDefines() const;
 
-  void AddFlag(const char* flag, const char* value);
-  void AddFlag(const char* flag, std::vector<std::string> const& value);
+  void AddFlag(std::string const& flag, std::string const& value);
+  void AddFlag(std::string const& flag, std::vector<std::string> const& value);
   void AppendFlag(std::string const& flag, std::string const& value);
   void AppendFlag(std::string const& flag,
                   std::vector<std::string> const& value);
   void AppendFlagString(std::string const& flag, std::string const& value);
-  void RemoveFlag(const char* flag);
+  void RemoveFlag(std::string const& flag);
   bool HasFlag(std::string const& flag) const;
-  const char* GetFlag(const char* flag);
+  const char* GetFlag(std::string const& flag) const;
 
 protected:
   // create a map of xml tags to the values they should have in the output
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 53966cd..47e6d7d 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -701,7 +701,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
   Options targetOptions(this, t, table, gg->ExtraFlagTable);
   targetOptions.FixExceptionHandlingDefault();
   std::string asmLocation = configName + "/";
-  targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
+  targetOptions.AddFlag("AssemblerListingLocation", asmLocation);
   targetOptions.Parse(flags.c_str());
   targetOptions.Parse(defineFlags.c_str());
   targetOptions.ParseFinish();
@@ -1007,7 +1007,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
   if (mdi && !mdi->DefFile.empty()) {
     std::string defFile =
       this->ConvertToOutputFormat(mdi->DefFile, cmOutputConverter::SHELL);
-    linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str());
+    linkOptions.AddFlag("ModuleDefinitionFile", defFile);
   }
 
   switch (target->GetType()) {
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8589a96..fd2f899 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2448,7 +2448,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
       clOptions.FixExceptionHandlingDefault();
       clOptions.AddFlag("PrecompiledHeader", "NotUsing");
       std::string asmLocation = configName + "/";
-      clOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
+      clOptions.AddFlag("AssemblerListingLocation", asmLocation);
     }
   }
   clOptions.Parse(flags.c_str());
@@ -3315,8 +3315,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
     imLib += "/";
     imLib += targetNameImport;
 
-    linkOptions.AddFlag("ImportLibrary", imLib.c_str());
-    linkOptions.AddFlag("ProgramDataBaseFile", pdb.c_str());
+    linkOptions.AddFlag("ImportLibrary", imLib);
+    linkOptions.AddFlag("ProgramDataBaseFile", pdb);
 
     // A Windows Runtime component uses internal .NET metadata,
     // so does not have an import library.
@@ -3337,7 +3337,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
       linkOptions.AppendFlag("IgnoreSpecificDefaultLibraries", "ole32.lib");
     }
   } else if (this->NsightTegra) {
-    linkOptions.AddFlag("SoName", targetNameSO.c_str());
+    linkOptions.AddFlag("SoName", targetNameSO);
   }
 
   linkOptions.Parse(flags.c_str());
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index b1686be..4f3d737 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -258,7 +258,7 @@ void cmVisualStudioGeneratorOptions::FixCudaCodeGeneration()
 
 void cmVisualStudioGeneratorOptions::FixManifestUACFlags()
 {
-  static const char* ENABLE_UAC = "EnableUAC";
+  static std::string const ENABLE_UAC = "EnableUAC";
   if (!HasFlag(ENABLE_UAC)) {
     return;
   }
@@ -304,8 +304,7 @@ void cmVisualStudioGeneratorOptions::FixManifestUACFlags()
         continue;
       }
 
-      AddFlag(uacMap[keyValue[0]].c_str(),
-              uacExecuteLevelMap[keyValue[1]].c_str());
+      AddFlag(uacMap[keyValue[0]], uacExecuteLevelMap[keyValue[1]]);
       continue;
     }
 
@@ -314,7 +313,7 @@ void cmVisualStudioGeneratorOptions::FixManifestUACFlags()
         // unknown uiAccess value
         continue;
       }
-      AddFlag(uacMap[keyValue[0]].c_str(), keyValue[1].c_str());
+      AddFlag(uacMap[keyValue[0]], keyValue[1]);
       continue;
     }
 

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

Summary of changes:
 Modules/FindMPI.cmake                        |  289 +++++++++++++++-----------
 Modules/FindPerlLibs.cmake                   |  212 +++++--------------
 Modules/InstallRequiredSystemLibraries.cmake |    9 +-
 Source/cmIDEOptions.cxx                      |   15 +-
 Source/cmIDEOptions.h                        |    8 +-
 Source/cmLocalVisualStudio7Generator.cxx     |    4 +-
 Source/cmVisualStudio10TargetGenerator.cxx   |    8 +-
 Source/cmVisualStudioGeneratorOptions.cxx    |    7 +-
 Source/kwsys/SystemTools.cxx                 |   13 +-
 Source/kwsys/testSystemTools.cxx             |   35 ++++
 10 files changed, 297 insertions(+), 303 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list