diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2019-06-14 20:24:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-19 11:25:05 (GMT) |
commit | f7eaa342de316707d99e6ae29c693a480861560d (patch) | |
tree | 3e3a26ae5a8cecabc49097563f9ae12a80959dc4 /Modules | |
parent | a4231943117f5ba3dd0fdc6c8b1824334162b69f (diff) | |
download | CMake-f7eaa342de316707d99e6ae29c693a480861560d.zip CMake-f7eaa342de316707d99e6ae29c693a480861560d.tar.gz CMake-f7eaa342de316707d99e6ae29c693a480861560d.tar.bz2 |
FindMPI: Store imported target link flags as a list instead of a string
We already use the `separate_arguments` `NATIVE_COMMAND` mode to parse
command-line strings into lists in several other places.
Fixes: #18897
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindMPI.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index fe09764..a80f799 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1144,7 +1144,9 @@ macro(_MPI_create_imported_target LANG) set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "") if(MPI_${LANG}_LINK_FLAGS) - set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LINK_FLAGS}") + separate_arguments(_MPI_${LANG}_LINK_FLAGS NATIVE_COMMAND "${MPI_${LANG}_LINK_FLAGS}") + set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${_MPI_${LANG}_LINK_FLAGS}") + unset(_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. |