Browse Source

Merge topic 'FindMPI-AddSuffixes'

5affe415a3 FindMPI: Add MPI_EXECUTABLE_SUFFIX to every item in lists

Acked-by: Kitware Robot <[email protected]>
Merge-request: !3496
Marc Chevrier 6 years ago
parent
commit
554c2ed743
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Modules/FindMPI.cmake

+ 6 - 2
Modules/FindMPI.cmake

@@ -310,11 +310,15 @@ foreach (LANG IN ITEMS C CXX Fortran)
   set(_MPI_${LANG}_COMPILER_NAMES "")
   foreach (id IN ITEMS GNU Intel MSVC PGI XL)
     if (NOT CMAKE_${LANG}_COMPILER_ID OR CMAKE_${LANG}_COMPILER_ID STREQUAL id)
-      list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${id}_${LANG}_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX})
+      foreach(_COMPILER_NAME IN LISTS _MPI_${id}_${LANG}_COMPILER_NAMES)
+        list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_COMPILER_NAME}${MPI_EXECUTABLE_SUFFIX})
+      endforeach()
     endif()
     unset(_MPI_${id}_${LANG}_COMPILER_NAMES)
   endforeach()
-  list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_MPI_${LANG}_GENERIC_COMPILER_NAMES}${MPI_EXECUTABLE_SUFFIX})
+  foreach(_COMPILER_NAME IN LISTS _MPI_${LANG}_GENERIC_COMPILER_NAMES)
+    list(APPEND _MPI_${LANG}_COMPILER_NAMES ${_COMPILER_NAME}${MPI_EXECUTABLE_SUFFIX})
+  endforeach()
   unset(_MPI_${LANG}_GENERIC_COMPILER_NAMES)
 endforeach()