From 9a84fe4f797b015270aa3c23c5ca884d4ad7082a Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Thu, 21 Nov 2019 11:46:23 +0100
Subject: [PATCH] [cmake] Compile ChemistryLib only if there are mass transport
 related processes

---
 CMakeLists.txt            | 9 ++++++++-
 ThirdParty/CMakeLists.txt | 7 ++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c2b0d86235..0dc5c7270cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -349,7 +349,14 @@ add_subdirectory(MathLib)
 add_subdirectory(MeshLib)
 add_subdirectory(MeshGeoToolsLib)
 add_subdirectory(NumLib)
-add_subdirectory(ChemistryLib)
+
+if (OGS_BUILD_PROCESS_ComponentTransport
+    OR OGS_BUILD_PROCESS_RichardsComponentTransport
+    OR OGS_BUILD_PROCESS_RichardsComponentTransport
+    OR OGS_BUILD_PROCESS_HeatTransportBHE)
+    add_subdirectory(ChemistryLib)
+endif()
+
 if(OGS_BUILD_CLI OR OGS_BUILD_UTILS OR BUILD_TESTING)
     add_subdirectory(ParameterLib)
     add_subdirectory(MaterialLib)
diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt
index 665147b6f28..981648d76a1 100644
--- a/ThirdParty/CMakeLists.txt
+++ b/ThirdParty/CMakeLists.txt
@@ -25,7 +25,12 @@ add_subdirectory(googletest)
 option(OGS_USE_OPTIONAL_SUBMODULES "Option for enabling optional submodules" OFF)
 
 #iphreeqc
-add_subdirectory(iphreeqc)
+if (OGS_BUILD_PROCESS_ComponentTransport
+    OR OGS_BUILD_PROCESS_RichardsComponentTransport
+    OR OGS_BUILD_PROCESS_RichardsComponentTransport
+    OR OGS_BUILD_PROCESS_HeatTransportBHE)
+    add_subdirectory(iphreeqc)
+endif()
 
 # MFrontGenericInterfaceSupport
 if (OGS_USE_MFRONT)
-- 
GitLab