summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 2779032..6b1da4b 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1391,6 +1391,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
else()
set(_MPI_FIND_${LANG} FALSE)
+ string(APPEND _MPI_FAIL_REASON "MPI component '${LANG}' was requested, but language ${LANG} is not enabled. ")
endif()
if(_MPI_FIND_${LANG})
if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )
@@ -1688,6 +1689,7 @@ endif()
find_package_handle_standard_args(MPI
REQUIRED_VARS ${_MPI_REQ_VARS}
VERSION_VAR ${_MPI_MIN_VERSION}
+ REASON_FAILURE_MESSAGE "${_MPI_FAIL_REASON}"
HANDLE_COMPONENTS)
#=============================================================================