Skip to content

Commit 39c572c

Browse files
author
Robert Maynard
committed
FindMPI: Updated to use INTERFACE_LINK_OPTIONS
1 parent 5c78809 commit 39c572c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Modules/FindMPI.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,16 +1142,15 @@ macro(_MPI_create_imported_target LANG)
11421142

11431143
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_COMPILE_DEFINITIONS "${MPI_${LANG}_COMPILE_DEFINITIONS}")
11441144

1145-
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "")
11461145
if(MPI_${LANG}_LINK_FLAGS)
11471146
separate_arguments(_MPI_${LANG}_LINK_FLAGS NATIVE_COMMAND "${MPI_${LANG}_LINK_FLAGS}")
1148-
set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${_MPI_${LANG}_LINK_FLAGS}")
1147+
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "${_MPI_${LANG}_LINK_FLAGS}")
11491148
unset(_MPI_${LANG}_LINK_FLAGS)
11501149
endif()
11511150
# If the compiler links MPI implicitly, no libraries will be found as they're contained within
11521151
# CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES already.
11531152
if(MPI_${LANG}_LIBRARIES)
1154-
set_property(TARGET MPI::MPI_${LANG} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}")
1153+
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_${LANG}_LIBRARIES}")
11551154
endif()
11561155
# Given the new design of FindMPI, INCLUDE_DIRS will always be located, even under implicit linking.
11571156
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_${LANG}_INCLUDE_DIRS}")

0 commit comments

Comments
 (0)