diff --git a/conan/tools/meson/meson.py b/conan/tools/meson/meson.py index ae4e5200e8d..caceda23add 100644 --- a/conan/tools/meson/meson.py +++ b/conan/tools/meson/meson.py @@ -2,7 +2,6 @@ from conan.tools.meson import MesonToolchain from conan.tools.microsoft.visual import vcvars_command, vcvars_arch -from conans.client.tools.env import environment_append from conans.client.tools.oss import cross_building @@ -36,6 +35,8 @@ def configure(self, source_folder=None): else: cmd += ' --native-file "{}"'. format(MesonToolchain.native_filename) cmd += ' "{}" "{}"'.format(self._build_dir, source) + if self._conanfile.package_folder: + cmd += ' -Dprefix="{}"'.format(self._conanfile.package_folder) self._run(cmd) def build(self): @@ -44,8 +45,7 @@ def build(self): def install(self): cmd = 'meson install -C "{}"'.format(self._build_dir) - with environment_append({"DESTDIR": self._conanfile.package_folder}): - self._run(cmd) + self._run(cmd) def test(self): cmd = 'meson test -v -C "{}"'.format(self._build_dir)