FindMPI: Add MPI_EXECUTABLE_SUFFIX to every item in lists

Add the `${MPI_EXECUTABLE_SUFFIX}` to each of the items in the
`_MPI_${id}_${LANG}_COMPILER_NAMES` and `_MPI_${LANG}_GENERIC_COMPILER_NAMES` rather
than just adding the suffix to the last item in each list.
This commit is contained in:
Brian Carlson
2019-06-28 16:11:51 -04:00
parent 2b1d9e51c2
commit 5affe415a3

View File

@@ -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()