diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c2b0d86235e823cf9d7f692c1c2906e754ea4c4..0dc5c7270cb65f8e8ee87f1084b9c2803b30e070 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 665147b6f28e4708138897b4c8ef97ff408eab98..981648d76a1e9f8e8c97192c93a3268b32cc5a2f 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)