From 956aed934f93d3c49fca6f04ff2c2fcb40779688 Mon Sep 17 00:00:00 2001
From: Florent Leclercq <florent.leclercq@polytechnique.org>
Date: Thu, 6 Jul 2023 20:26:17 +0200
Subject: [PATCH] added MesonToolchain in recipe

---
 README.md    | 6 ++----
 conanfile.py | 8 ++++++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index c131f79..00ad892 100644
--- a/README.md
+++ b/README.md
@@ -21,13 +21,11 @@ conan profile detect --force
     ```
     * Build with meson
     ```
-    cd build-realease
-    conan build ..
+    cd build-release ; conan build .. ; cd ..
     ```
     or for the debug version:
     ```
-    cd build-debug
-    conan build .. --profile=debug
+    cd build-debug ; conan build .. --profile=debug ; cd ..
     ```
 * To create the package (i.e. build and install it in the conan cache ``~/.conan2``):
     ```
diff --git a/conanfile.py b/conanfile.py
index 6bc5a27..756195c 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -1,6 +1,6 @@
 import os.path
 from conan import ConanFile
-from conan.tools.meson import Meson
+from conan.tools.meson import Meson, MesonToolchain
 from conan.tools.layout import basic_layout
 
 class ElemmireRecipe(ConanFile):
@@ -15,7 +15,7 @@ class ElemmireRecipe(ConanFile):
     topics = ("cosmology", "data analysis")
 
     # Binary configuration
-    generators = "PkgConfigDeps", "MesonToolchain"
+    generators = "PkgConfigDeps"
     settings = "os", "compiler", "build_type", "arch"
     options = {"shared": [True, False], "fPIC": [True, False]}
     default_options = {"shared": False, "fPIC": True}
@@ -33,6 +33,10 @@ class ElemmireRecipe(ConanFile):
         basic_layout(self)
         self.folders.build = os.path.join(self.folders.build, "meson")
 
+    def generate(self):
+        tc = MesonToolchain(self)
+        tc.generate()
+
     def build(self):
         meson = Meson(self)
         meson.configure()