summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-15 14:22:15 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-04-15 14:22:15 (GMT)
commit353367091fa62d8c1ffe2b73f2f3d4c16ea3cf18 (patch)
tree471780e5fccdfa1a43163ffc2a9eef3951e7b592
parentdd3a80b718ec4d501660b86a4f4710391087c0a7 (diff)
parent856bfe238c8efa7f9cd4e07b883f1571e7d01277 (diff)
downloadCMake-353367091fa62d8c1ffe2b73f2f3d4c16ea3cf18.zip
CMake-353367091fa62d8c1ffe2b73f2f3d4c16ea3cf18.tar.gz
CMake-353367091fa62d8c1ffe2b73f2f3d4c16ea3cf18.tar.bz2
Merge topic 'FindMPI-lang-implicit-dirs'
856bfe23 FindMPI: Use compiler implicit link dirs for matching language (#14870)
-rw-r--r--Modules/FindMPI.cmake13
1 files changed, 4 insertions, 9 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index c8d46ba..aa2dcee 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -378,19 +378,14 @@ function (interrogate_mpi_compiler lang try_libs)
# Extract the set of libraries to link against from the link command
# line
string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
+
# add the compiler implicit directories because some compilers
# such as the intel compiler have libraries that show up
# in the showme list that can only be found in the implicit
- # link directories of the compiler. Do this for C++ and C
- # compilers if the implicit link directories are defined.
- if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES)
- set(MPI_LINK_PATH
- "${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}")
- endif ()
-
- if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES)
+ # link directories of the compiler.
+ if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES)
set(MPI_LINK_PATH
- "${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
+ "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
endif ()
# Determine full path names for all of the libraries that one needs