summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Modules/FindMPI.cmake4
1 files changed, 1 insertions, 3 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 2ff6afeedd..a79758f854 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1147,9 +1147,7 @@ macro(_MPI_create_imported_target LANG)
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}")
if(MPI_${LANG}_LINK_FLAGS)
- separate_arguments(_MPI_${LANG}_LINK_FLAGS NATIVE_COMMAND "${MPI_${LANG}_LINK_FLAGS}")
- set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "${_MPI_${LANG}_LINK_FLAGS}")
- unset(_MPI_${LANG}_LINK_FLAGS)
+ set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "SHELL:${MPI_${LANG}_LINK_FLAGS}")
endif()
# If the compiler links MPI implicitly, no libraries will be found as they're contained within
# CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES already.