]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Support a FindMPI.cmake of CMake version 3.10 and later
authorMatthias Maier <tamiko@43-1.org>
Fri, 12 Jan 2018 21:31:14 +0000 (15:31 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 12 Jan 2018 21:36:59 +0000 (15:36 -0600)
This change should also be backward compatible to older CMake versions.
(Fingers crossed.)

cmake/macros/macro_deal_ii_package_handle.cmake
cmake/modules/FindMPI.cmake

index bedef00f0d81705b5f23d31a37ad4879e45ed57c..be6ff875f3243d937a93aaadd35e96eb36596157 100644 (file)
@@ -51,7 +51,14 @@ MACRO(DEAL_II_PACKAGE_HANDLE _feature _var)
     MESSAGE(STATUS "  ${_feature}_VERSION: ${${_feature}_VERSION}")
   ENDIF()
 
-  SET(${_feature}_FOUND TRUE)
+  #
+  # Respect a possible ${_feature}_FOUND variable that is set to a truth
+  # value. We need this for modern™ MPI detection where CMake's
+  # FindMPI.cmake might only set MPI_FOUND to true and nothing else.
+  #
+  IF(NOT DEFINED ${_feature}_FOUND)
+    SET(${_feature}_FOUND TRUE)
+  ENDIF()
 
   SET(_variable ${_var})
   SET(${_feature}_${_variable} "")
index 863dc66a4a12e08a46121726a45c0fdd9818e5e7..ec229c1f48f71c69b06208b65cda73c5f463be19 100644 (file)
@@ -130,14 +130,11 @@ ENDIF()
 
 DEAL_II_PACKAGE_HANDLE(MPI
   LIBRARIES
-    REQUIRED MPI_CXX_LIBRARIES
-    OPTIONAL MPI_Fortran_LIBRARIES MPI_C_LIBRARIES
+    OPTIONAL MPI_CXX_LIBRARIES MPI_Fortran_LIBRARIES MPI_C_LIBRARIES
   INCLUDE_DIRS
-    REQUIRED MPI_CXX_INCLUDE_PATH
-    OPTIONAL MPI_C_INCLUDE_PATH
+    OPTIONAL MPI_CXX_INCLUDE_PATH MPI_C_INCLUDE_PATH
   USER_INCLUDE_DIRS
-    REQUIRED MPI_CXX_INCLUDE_PATH
-    OPTIONAL MPI_C_INCLUDE_PATH
+    OPTIONAL MPI_CXX_INCLUDE_PATH MPI_C_INCLUDE_PATH
   CXX_FLAGS OPTIONAL MPI_CXX_COMPILE_FLAGS
   LINKER_FLAGS OPTIONAL MPI_CXX_LINK_FLAGS
   CLEAR

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.