From 3ec11e82acfb0ced1bd615e9cf85d852da799a47 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Thu, 29 Oct 2020 09:58:34 +0100
Subject: [PATCH] [CMake] Fixed XDMF ctest.

- add include paths for Xdmf and libxml2 from VTK
- disable xdmf test on Apple Clang

https://gitlab.kitware.com/vtk/vtk/-/issues/17353
---
 ProcessLib/LiquidFlow/Tests.cmake | 3 ++-
 scripts/cmake/Find.cmake          | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ProcessLib/LiquidFlow/Tests.cmake b/ProcessLib/LiquidFlow/Tests.cmake
index 0c57ee4d60a..c140ea7ae9a 100644
--- a/ProcessLib/LiquidFlow/Tests.cmake
+++ b/ProcessLib/LiquidFlow/Tests.cmake
@@ -437,7 +437,8 @@ AddTest(
     EXECUTABLE_ARGS FunctionParameterTest_XDMF.prj
     WRAPPER time
     TESTER xdmfdiff
-    REQUIREMENTS NOT OGS_USE_MPI
+    # See https://gitlab.opengeosys.org/ogs/ogs/-/merge_requests/3184#note_85104
+    REQUIREMENTS NOT OGS_USE_MPI AND NOT COMPILER_IS_APPLE_CLANG
     DIFF_DATA
     square_5x5_tris_32_right_boundary_ts_0_t_0.000000.xdmf square_5x5_tris_32_right_boundary_ts_0_t_0.000000.xdmf pressure pressure 1e-7 1e-13
     square_5x5_tris_32_right_boundary_ts_1_t_1.000000.xdmf square_5x5_tris_32_right_boundary_ts_1_t_1.000000.xdmf pressure pressure 1e-7 1e-13
diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake
index 9cf467f4626..e85d3a0ae51 100644
--- a/scripts/cmake/Find.cmake
+++ b/scripts/cmake/Find.cmake
@@ -80,6 +80,12 @@ else()
     find_package(VTK ${ogs.minimum_version.vtk} REQUIRED COMPONENTS ${VTK_COMPONENTS})
     include(${VTK_USE_FILE})
 endif()
+include_directories(SYSTEM
+    # Xdmf:
+    ${VTK_INSTALL_PREFIX}/include
+    # libxml:
+    ${VTK_INSTALL_PREFIX}/include/vtk-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}/vtklibxml2
+)
 
 find_package(Eigen3 ${ogs.minimum_version.eigen} REQUIRED)
 include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
-- 
GitLab