From 354cdd6730ac1cc19cbf99e663e7ca280a9b62dc Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 13 Feb 2022 19:03:49 -0600 Subject: [PATCH] CMake: Adjust MPI and ZLIB support query for p4est version 2.8 --- cmake/modules/FindP4EST.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindP4EST.cmake b/cmake/modules/FindP4EST.cmake index a91ef26876..d32cadf281 100644 --- a/cmake/modules/FindP4EST.cmake +++ b/cmake/modules/FindP4EST.cmake @@ -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() -- 2.39.5