[Cmake-commits] CMake branch, master, updated. v3.11.1-518-g9260ded

Kitware Robot kwrobot at kitware.com
Wed Apr 18 07:35:05 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  9260dedfd2ab473d87679e215ea10cd572765766 (commit)
       via  bab4bc5f32e14eabcb82e50e48f9109066a50e0a (commit)
      from  4591cdd72c83cbb458659d731b87e6b842fae956 (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=9260dedfd2ab473d87679e215ea10cd572765766
commit 9260dedfd2ab473d87679e215ea10cd572765766
Merge: 4591cdd bab4bc5
Author:     Christian Pfeiffer <cpfeiffer at live.de>
AuthorDate: Wed Apr 18 11:32:45 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Apr 18 07:33:07 2018 -0400

    Merge topic 'fix-findmpi-lib-regex'
    
    bab4bc5f32 FindMPI: Fix libname regex to not match the compiler executable
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1952


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bab4bc5f32e14eabcb82e50e48f9109066a50e0a
commit bab4bc5f32e14eabcb82e50e48f9109066a50e0a
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Wed Apr 11 16:51:11 2018 -0400
Commit:     Chuck Atkins <chuck.atkins at kitware.com>
CommitDate: Thu Apr 12 15:07:16 2018 -0400

    FindMPI: Fix libname regex to not match the compiler executable
    
    When trying to match full path libraries on the mpicc link line, the
    current regex is not strict enough and improperly matches a partial path
    to the Xcode compiler path with homebrew mpich.  This adjusts the regex
    to look for a space preceeding the library name to prevent the first
    argument, i.e. the compiler invocation, from being matched, and require
    either a space or end-pattern after the library to prevent mismatches with
    arguments that contain the library suffix but don't actually end with it.

diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 4bfbf03..75c4441 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -352,6 +352,9 @@ function (_MPI_check_compiler LANG QUERY_FLAG OUTPUT_VARIABLE RESULT_VARIABLE)
   # Ensure that no error output might be passed upwards.
   if(NOT WRAPPER_RETURN EQUAL 0)
     unset(WRAPPER_OUTPUT)
+  else()
+    # Strip leading whitespace
+    string(REGEX REPLACE "^ +" "" WRAPPER_OUTPUT "${WRAPPER_OUTPUT}")
   endif()
   set(${OUTPUT_VARIABLE} "${WRAPPER_OUTPUT}" PARENT_SCOPE)
   set(${RESULT_VARIABLE} "${WRAPPER_RETURN}" PARENT_SCOPE)
@@ -715,20 +718,20 @@ function (_MPI_interrogate_compiler LANG)
   # or shared libraries if there aren't any import libraries in use on the system.
   # Note that we do not consider CMAKE_<TYPE>_LIBRARY_PREFIX intentionally here: The linker will for a given file
   # decide how to link it based on file type, not based on a prefix like 'lib'.
-  set(_MPI_LIB_NAME_REGEX "[^\" ]+${CMAKE_STATIC_LIBRARY_SUFFIX}|\"[^\"]+${CMAKE_STATIC_LIBRARY_SUFFIX}\"")
+  set(_MPI_LIB_SUFFIX_REGEX "${CMAKE_STATIC_LIBRARY_SUFFIX}")
   if(DEFINED CMAKE_IMPORT_LIBRARY_SUFFIX)
     if(NOT ("${CMAKE_IMPORT_LIBRARY_SUFFIX}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}"))
-      string(APPEND _MPI_LIB_NAME_REGEX "[^\" ]+${CMAKE_IMPORT_LIBRARY_SUFFIX}|\"[^\"]+${CMAKE_IMPORT_LIBRARY_SUFFIX}\"")
+      string(APPEND _MPI_SUFFIX_REGEX "|${CMAKE_IMPORT_LIBRARY_SUFFIX}")
     endif()
   else()
-    string(APPEND _MPI_LIB_NAME_REGEX "[^\" ]+${CMAKE_SHARED_LIBRARY_SUFFIX}|\"[^\"]+${CMAKE_SHARED_LIBRARY_SUFFIX}\"")
+    string(APPEND _MPI_LIB_SUFFIX_REGEX "|${CMAKE_SHARED_LIBRARY_SUFFIX}")
   endif()
+  set(_MPI_LIB_NAME_REGEX "(([^\" ]+(${_MPI_LIB_SUFFIX_REGEX}))|(\"[^\"]+(${_MPI_LIB_SUFFIX_REGEX})\"))( +|$)")
   string(REPLACE "." "\\." _MPI_LIB_NAME_REGEX "${_MPI_LIB_NAME_REGEX}")
 
-  string(REGEX MATCHALL "(^| )(${_MPI_LIB_NAME_REGEX})" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
+  string(REGEX MATCHALL "${_MPI_LIB_NAME_REGEX}" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
   foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES)
-    string(REGEX REPLACE "^ " "" _MPI_LIB_NAME "${_MPI_LIB_NAME}")
-    string(REPLACE "\"" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}")
+    string(REGEX REPLACE "^ +\"?|\"? +$" "" _MPI_LIB_NAME "${_MPI_LIB_NAME}")
     get_filename_component(_MPI_LIB_PATH "${_MPI_LIB_NAME}" DIRECTORY)
     if(NOT "${_MPI_LIB_PATH}" STREQUAL "")
       list(APPEND MPI_LIB_FULLPATHS_WORK "${_MPI_LIB_NAME}")

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

Summary of changes:
 Modules/FindMPI.cmake |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list