From a0daa7d3b4e1ed8719e897a3519cde612e689919 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Tue, 26 Feb 2019 12:34:12 +0100
Subject: [PATCH] Add MFrontGenericInterfaceSupport submodule.

Release 1.0 version of MGIS, patched.

The MGIS is build with c++11 standard.
The tfel library is provided via conan too for convinience.
---
 .gitmodules                        | 3 +++
 ThirdParty/CMakeLists.txt          | 9 +++++++++
 ThirdParty/MGIS                    | 1 +
 scripts/cmake/ConanSetup.cmake     | 4 ++++
 scripts/cmake/SubmoduleSetup.cmake | 3 +++
 5 files changed, 20 insertions(+)
 create mode 160000 ThirdParty/MGIS

diff --git a/.gitmodules b/.gitmodules
index 36e7c5e246c..84dceb42bea 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -37,3 +37,6 @@
 [submodule "ThirdParty/iphreeqc/src"]
 	path = ThirdParty/iphreeqc/src
 	url = https://github.com/ufz/iphreeqc.git
+[submodule "ThirdParty/MGIS"]
+	path = ThirdParty/MGIS
+	url = https://github.com/ufz/MFrontGenericInterfaceSupport.git
diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt
index 5226f730199..665147b6f28 100644
--- a/ThirdParty/CMakeLists.txt
+++ b/ThirdParty/CMakeLists.txt
@@ -27,6 +27,15 @@ option(OGS_USE_OPTIONAL_SUBMODULES "Option for enabling optional submodules" OFF
 #iphreeqc
 add_subdirectory(iphreeqc)
 
+# MFrontGenericInterfaceSupport
+if (OGS_USE_MFRONT)
+    set(enable-doxygen-doc OFF CACHE INTERNAL "")
+    set(enable-fortran-bindings OFF CACHE INTERNAL "")
+    set(CMAKE_CXX_STANDARD 11)
+    add_subdirectory(MGIS)
+    set(CMAKE_CXX_STANDARD 17)
+endif()
+
 # VtkFbxConverter
 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VtkFbxConverter/CMakeLists.txt
     AND OGS_USE_OPTIONAL_SUBMODULES)
diff --git a/ThirdParty/MGIS b/ThirdParty/MGIS
new file mode 160000
index 00000000000..bdfcaa13f8a
--- /dev/null
+++ b/ThirdParty/MGIS
@@ -0,0 +1 @@
+Subproject commit bdfcaa13f8ad00a3ac27a264e8f6e1f7c535a5ee
diff --git a/scripts/cmake/ConanSetup.cmake b/scripts/cmake/ConanSetup.cmake
index 3235621be37..c5cae781a10 100644
--- a/scripts/cmake/ConanSetup.cmake
+++ b/scripts/cmake/ConanSetup.cmake
@@ -61,6 +61,10 @@ if(OGS_USE_CVODE)
     set(CONAN_REQUIRES ${CONAN_REQUIRES} cvode/2.8.2@bilke/stable)
 endif()
 
+if(OGS_USE_MFRONT)
+    set(CONAN_REQUIRES ${CONAN_REQUIRES} tfel/3.2.1@bilke/testing)
+endif()
+
 if(OGS_BUILD_GUI)
     set(CONAN_REQUIRES ${CONAN_REQUIRES}
         shapelib/1.3.0@bilke/stable
diff --git a/scripts/cmake/SubmoduleSetup.cmake b/scripts/cmake/SubmoduleSetup.cmake
index 25877cf25b8..cb64ecd4dcd 100644
--- a/scripts/cmake/SubmoduleSetup.cmake
+++ b/scripts/cmake/SubmoduleSetup.cmake
@@ -26,6 +26,9 @@ endif()
 if(OGS_USE_PYTHON)
     list(APPEND REQUIRED_SUBMODULES ThirdParty/pybind11)
 endif()
+if (OGS_USE_MFRONT)
+    list(APPEND REQUIRED_SUBMODULES ThirdParty/MGIS)
+endif()
 
 # Sync submodules, which is required when a submodule changed its URL
 if(OGS_SYNC_SUBMODULES)
-- 
GitLab