summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-12-06 13:00:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-12-06 13:00:46 (GMT)
commit22f440ae6930c8ef9eccfa65530c6b59949657ef (patch)
tree744eaa88b0efbba1eabafe445200852a574d31d6 /Modules/FindMPI.cmake
parentb6dd3969e819a7a2508c8f705ef7e13fb7e11dff (diff)
parentbde7513d2fcd7a366eb4dd93fc1f061334743bb7 (diff)
downloadCMake-22f440ae6930c8ef9eccfa65530c6b59949657ef.zip
CMake-22f440ae6930c8ef9eccfa65530c6b59949657ef.tar.gz
CMake-22f440ae6930c8ef9eccfa65530c6b59949657ef.tar.bz2
Merge topic 'findmpi-notfound-spam'
bde7513d FindMPI: Correct legacy variable handling Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1557
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake26
1 files changed, 16 insertions, 10 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 94e07e7..4d9444a 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -602,6 +602,9 @@ function (_MPI_interrogate_compiler lang)
if(MPI_DIRECT_LIB_NAMES_WORK)
set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}")
endif()
+ if(MPI_${LANG}_EXTRA_LIB_NAMES)
+ list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}")
+ endif()
# MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to
# link it in that case. -lpthread is covered by the normal library treatment on the other hand.
@@ -1076,18 +1079,21 @@ foreach (LANG IN ITEMS C CXX)
endif()
# If a list of libraries was given, we'll split it into new-style cache variables
+ unset(MPI_${LANG}_EXTRA_LIB_NAMES)
if(NOT MPI_${LANG}_LIB_NAMES)
foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY)
- get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
- get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
- get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
- list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${_MPI_PLAIN_LIB_NAME}")
- find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
- NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
- HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
- DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
- )
- mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
+ if(_MPI_LIB)
+ get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE)
+ get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME)
+ get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY)
+ list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}")
+ find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY
+ NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}"
+ HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB}
+ DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI"
+ )
+ mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY)
+ endif()
endforeach()
endif()
endforeach()