diff options
author | Brad King <brad.king@kitware.com> | 2015-07-31 13:42:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-31 13:50:31 (GMT) |
commit | 1c46b6aed0db88c97189713f291164f98df780a9 (patch) | |
tree | a2aea506df418b8b1a21ce812e7c485c7708855f /Modules | |
parent | a8c3698526cfa11c61d9dfd8c0f9fa8d2c7ff10a (diff) | |
download | CMake-1c46b6aed0db88c97189713f291164f98df780a9.zip CMake-1c46b6aed0db88c97189713f291164f98df780a9.tar.gz CMake-1c46b6aed0db88c97189713f291164f98df780a9.tar.bz2 |
FindMPI: Drop unnecessary and incorrect use of GetPrerequisites
Since commit v2.8.5~121^2~2 (FindMPI: Handle multiple languages,
2010-12-29) we called the GetPrerequisites is_file_executable function
but passed the name of a CMake variable instead of its value. Therefore
the function has always failed and caused the search for the compiler
name to run even with an absolute path. Switch to using if(IS_ABSOLUTE)
instead and drop use of GetPrerequisites.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindMPI.cmake | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 06ecfaa..48adf3c 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -102,7 +102,6 @@ # include this to handle the QUIETLY and REQUIRED arguments include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake) # # This part detects MPI compilers, attempting to wade through the mess of compiler names in @@ -578,14 +577,13 @@ foreach (lang C CXX Fortran) if (CMAKE_${lang}_COMPILER_WORKS) # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. if (MPI_${lang}_COMPILER) - is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE) - if (NOT MPI_COMPILER_IS_EXECUTABLE) + if (NOT IS_ABSOLUTE "${MPI_${lang}_COMPILER}") # Get rid of our default list of names and just search for the name the user wants. set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER}) set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - # If the user specifies a compiler, we don't want to try to search libraries either. - set(try_libs FALSE) endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(try_libs FALSE) else() set(try_libs TRUE) endif() |