]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Also check for enabled zlib support in p4est 4193/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 6 Apr 2017 01:26:28 +0000 (20:26 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 6 Apr 2017 01:29:12 +0000 (20:29 -0500)
Even though we might not necessarily use zlib compression in p4est
output at all, p4est might silently fail if zlib support is disabled.

Work around this issue by always requiring a p4est installation with
enabled zlib support.

Closes #4151

cmake/configure/configure_p4est.cmake
cmake/modules/FindP4EST.cmake

index cfc0afcd3e408e5a9598e202f48c51dd5b4e67ff..fbcfc67d58d7460e139fc05ed54d8bfdc6362268 100644 (file)
@@ -55,6 +55,21 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
       SET(${var} FALSE)
     ENDIF()
 
+    #
+    # Check whether p4est is built against zlib:
+    #
+    IF(NOT P4EST_WITH_ZLIB)
+      MESSAGE(STATUS "Insufficient p4est installation found: "
+        "p4est has to be configured with enabled zlib support."
+        )
+      SET(P4EST_ADDITIONAL_ERROR_STRING
+        ${P4EST_ADDITIONAL_ERROR_STRING}
+        "Insufficient p4est installation found!\n"
+        "p4est has to be configured with enabled zlib support.\n"
+        )
+      SET(${var} FALSE)
+    ENDIF()
+
     CHECK_MPI_INTERFACE(P4EST ${var})
   ENDIF()
 ENDMACRO()
index 5fa45671117bd1219ce83a643723ae9badd48ad9..145aef70192758b483e434e7c269515bb4b5f461 100644 (file)
@@ -20,6 +20,7 @@
 #   P4EST_LIBRARIES
 #   P4EST_INCLUDE_DIRS
 #   P4EST_WITH_MPI
+#   P4EST_WITH_ZLIB
 #   P4EST_VERSION
 #   P4EST_VERSION_MAJOR
 #   P4EST_VERSION_MINOR
@@ -116,6 +117,17 @@ IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h)
     SET(P4EST_WITH_MPI TRUE)
   ENDIF()
 
+  #
+  # Is p4est built against zlib?
+  #
+  FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_ZLIB_STRING
+    REGEX "#define.*P4EST_HAVE_ZLIB 1")
+  IF("${P4EST_ZLIB_STRING}" STREQUAL "")
+    SET(P4EST_WITH_ZLIB FALSE)
+  ELSE()
+    SET(P4EST_WITH_ZLIB TRUE)
+  ENDIF()
+
   #
   # Extract version numbers:
   #

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.