瀏覽代碼

FindMPI: Failure is not an error if not REQUIRED

Brad King 15 年之前
父節點
當前提交
8460059a72
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Modules/FindMPI.cmake

+ 3 - 3
Modules/FindMPI.cmake

@@ -274,9 +274,9 @@ elseif (MPI_COMPILE_CMDLINE)
     find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH})
     if (MPI_LIB)
       list(APPEND MPI_LIBRARIES ${MPI_LIB})
-    else (MPI_LIB)
-      message(SEND_ERROR "Unable to find MPI library ${LIB}")
-    endif (MPI_LIB)
+    elseif (NOT MPI_FIND_QUIETLY)
+      message(WARNING "Unable to find MPI library ${LIB}")
+    endif ()
   endforeach(LIB)
   set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE)