From dba50215c1f5a53a5b1b68573cf32450128d1615 Mon Sep 17 00:00:00 2001 From: "Toby D. Young" Date: Thu, 14 Nov 2013 14:16:32 +0000 Subject: [PATCH] Add a harmless macro PETSC_WITH_COMPLEX. git-svn-id: https://svn.dealii.org/trunk@31653 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/modules/FindPETSC.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/deal.II/cmake/modules/FindPETSC.cmake b/deal.II/cmake/modules/FindPETSC.cmake index 3bd673927c..1a4f3122c4 100644 --- a/deal.II/cmake/modules/FindPETSC.cmake +++ b/deal.II/cmake/modules/FindPETSC.cmake @@ -29,6 +29,7 @@ # PETSC_VERSION_PATCH # PETSC_WITH_MPIUNI # PETSC_WITH_64BIT_INDICES +# PETSC_WITH_COMPLEX # INCLUDE(FindPackageHandleStandardArgs) @@ -207,6 +208,17 @@ IF(PETSC_FOUND) SET(PETSC_WITH_64BIT_INDICES TRUE) ENDIF() + # + # Is petsc compiled with support for COMPLEX numbers? + # + FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_COMPLEX_STRING + REGEX "#define.*PETSC_USE_COMPLEX 1") + IF("${PETSC_COMPLEX_STRING}" STREQUAL "") + SET(PETSC_WITH_COMPLEX FALSE) + ELSE() + SET(PETSC_WITH_COMPLEX TRUE) + ENDIF() + FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING REGEX "#define.*PETSC_VERSION_MAJOR") STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1" -- 2.39.5