diff options
author | Brian Carlson <bcarlson@paradigm4.com> | 2019-06-28 20:11:51 (GMT) |
---|---|---|
committer | Brian Carlson <bcarlson@paradigm4.com> | 2019-06-29 17:35:01 (GMT) |
commit | 5affe415a3ca6852c1c43bc439129db56b63649f (patch) | |
tree | 3d409a005df3f3761bce49acb95d69a729043d2f | |
parent | 2b1d9e51c2e47a3b8c193770eb222c0713f8a5e6 (diff) | |
download | CMake-5affe415a3ca6852c1c43bc439129db56b63649f.zip CMake-5affe415a3ca6852c1c43bc439129db56b63649f.tar.gz CMake-5affe415a3ca6852c1c43bc439129db56b63649f.tar.bz2 |
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.
-rw-r--r-- | Modules/FindMPI.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index fc9810c..2ff6afe 100644 --- a/Modules/FindMPI.cmake +++ b/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() |