]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Adjust MPI and ZLIB support query for p4est version 2.8 13374/head
authorMatthias Maier <tamiko@43-1.org>
Mon, 14 Feb 2022 01:03:49 +0000 (19:03 -0600)
committerMatthias Maier <tamiko@43-1.org>
Mon, 14 Feb 2022 01:03:49 +0000 (19:03 -0600)
cmake/modules/FindP4EST.cmake

index a91ef26876d180163a6a1ac201379103ac6fd669..d32cadf28155fd018f7e36564da0ba14a0d86d9a 100644 (file)
@@ -114,7 +114,13 @@ IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h)
   FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING
     REGEX "#define.*P4EST_MPI 1")
   IF("${P4EST_MPI_STRING}" STREQUAL "")
-    SET(P4EST_WITH_MPI FALSE)
+    FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING
+      REGEX "#define.*P4EST_ENABLE_MPI")
+    IF("${P4EST_MPI_STRING}" STREQUAL "")
+      SET(P4EST_WITH_MPI FALSE)
+    ELSE()
+      SET(P4EST_WITH_MPI TRUE)
+    ENDIF()
   ELSE()
     SET(P4EST_WITH_MPI TRUE)
   ENDIF()
@@ -123,7 +129,7 @@ IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h)
   # Is p4est built against zlib?
   #
   FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_ZLIB_STRING
-    REGEX "#define.*P4EST_HAVE_ZLIB 1")
+    REGEX "^#define.*P4EST_HAVE_ZLIB")
   IF("${P4EST_ZLIB_STRING}" STREQUAL "")
     SET(P4EST_WITH_ZLIB FALSE)
   ELSE()

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.