Repository: conan-io/conan

Issue:
[bug] Meson cross-file is not looked up in the conan install-folder
### Environment Details (include every applicable attribute)
  * Operating System+version: Linux Ubuntu 20.04.2 LTS
  * Compiler+version: x86_64-w64-mingw32 9.3
  * Conan version: 1.36.0
  * Python version: 3.8.5

### Steps to reproduce (Include if Applicable)
  - create a profile for cross compilation Linux to Windows (as from the documentation)
  - create a cross-compiled meson project (generator pkg_config and generate MesonToolchain)
  - `conan install . -if install` (conan_meson_cross.ini is generated inside the install directory)
  - `conan build . -if install` (conan is not found in current directory)

### Logs (Executed commands with output) (Include/Attach if Applicable)
```
vscode ➜ /workspaces/tennisAnalysis (main ✗) $ conan install . -if install
Configuration:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=9.3
os=Windows
os_build=Linux
[options]
[build_requires]
[env]
AR=x86_64-w64-mingw32-ar
AS=x86_64-w64-mingw32-as
CC=x86_64-w64-mingw32-gcc-posix
CHOST=x86_64-w64-mingw32
CONAN_CMAKE_FIND_ROOT_PATH=/usr/bin/x86_64-w64-mingw32 # Adjust this path  # Optional, for CMake to find things in that folder
CONAN_CMAKE_SYSROOT=/usr/bin/x86_64-w64-mingw32 # Adjust this path  # Optional, if we want to define sysroot
CXX=x86_64-w64-mingw32-g++-posix
PKG_CONFIG=pkg-config
RANLIB=x86_64-w64-mingw32-ranlib
RC=x86_64-w64-mingw32-windres
STRIP=x86_64-w64-mingw32-strip
WARN: libtiff/4.2.0: requirement libwebp/1.1.0 overridden by opencv/4.5.2 to libwebp/1.2.0 
conanfile.py: Installing package
Requirements
    eigen/3.3.9 from 'conan-center' - Cache
    jasper/2.0.32 from 'conan-center' - Cache
    jbig/20160605 from 'conan-center' - Cache
    libdeflate/1.7 from 'conan-center' - Cache
    libjpeg/9d from 'conan-center' - Cache
    libpng/1.6.37 from 'conan-center' - Cache
    libtiff/4.2.0 from 'conan-center' - Cache
    libwebp/1.2.0 from 'conan-center' - Cache
    opencv/4.5.2 from 'conan-center' - Cache
    quirc/1.1 from 'conan-center' - Cache
    xz_utils/5.2.5 from 'conan-center' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
    zstd/1.4.8 from 'conan-center' - Cache
Packages
    eigen/3.3.9:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    jasper/2.0.32:0b2b79209cb5a733c6f60939a011a2d5b9baba3e - Cache
    jbig/20160605:eb359adcb4224cf32a880f4840496998b718e67a - Cache
    libdeflate/1.7:344886eda55829e935447d0708e3b993938b32c8 - Cache
    libjpeg/9d:344886eda55829e935447d0708e3b993938b32c8 - Cache
    libpng/1.6.37:0ff33ddf098055bd06ad25e84c8ac73a7d386ae6 - Cache
    libtiff/4.2.0:9a66f421b7e2c46cae4d0544a209f0a41fce4717 - Cache
    libwebp/1.2.0:743b5bdc8f8a9eb56cece0880367af1603426c77 - Cache
    opencv/4.5.2:3c85fd5b9706d74ca80c0013b88789f0a882a76e - Cache
    quirc/1.1:923b659fe22255fc3db85bbda05de841448c924b - Cache
    xz_utils/5.2.5:344886eda55829e935447d0708e3b993938b32c8 - Cache
    zlib/1.2.11:344886eda55829e935447d0708e3b993938b32c8 - Cache
    zstd/1.4.8:344886eda55829e935447d0708e3b993938b32c8 - Cache

Cross-build from 'Linux:x86_64' to 'Windows:x86_64'
Installing (downloading, building) binaries...
eigen/3.3.9: Already installed!
jbig/20160605: Already installed!
jbig/20160605: Appending PATH environment variable: /home/vscode/.conan/data/jbig/20160605/_/_/package/eb359adcb4224cf32a880f4840496998b718e67a/bin
libdeflate/1.7: Already installed!
libjpeg/9d: Already installed!
libwebp/1.2.0: Already installed!
quirc/1.1: Already installed!
xz_utils/5.2.5: Already installed!
zlib/1.2.11: Already installed!
zstd/1.4.8: Already installed!
jasper/2.0.32: Already installed!
libpng/1.6.37: Already installed!
libtiff/4.2.0: Already installed!
opencv/4.5.2: Already installed!
conanfile.py: Generator pkg_config created opencv_core.pc
conanfile.py: Generator pkg_config created opencv_imgproc.pc
conanfile.py: Generator pkg_config created opencv_flann.pc
conanfile.py: Generator pkg_config created opencv_features2d.pc
conanfile.py: Generator pkg_config created opencv_calib3d.pc
conanfile.py: Generator pkg_config created opencv_video.pc
conanfile.py: Generator pkg_config created opencv_video_alias.pc
conanfile.py: Generator pkg_config created opencv_stitching.pc
conanfile.py: Generator pkg_config created opencv_stitching_alias.pc
conanfile.py: Generator pkg_config created opencv_objdetect.pc
conanfile.py: Generator pkg_config created opencv_objdetect_alias.pc
conanfile.py: Generator pkg_config created opencv_imgcodecs.pc
conanfile.py: Generator pkg_config created opencv_videoio.pc
conanfile.py: Generator pkg_config created opencv_highgui.pc
conanfile.py: Generator pkg_config created opencv_highgui_alias.pc
conanfile.py: Generator pkg_config created opencv_calib3d_alias.pc
conanfile.py: Generator pkg_config created opencv_videoio_alias.pc
conanfile.py: Generator pkg_config created opencv_imgcodecs_alias.pc
conanfile.py: Generator pkg_config created opencv_features2d_alias.pc
conanfile.py: Generator pkg_config created opencv_photo.pc
conanfile.py: Generator pkg_config created opencv_photo_alias.pc
conanfile.py: Generator pkg_config created opencv_ml.pc
conanfile.py: Generator pkg_config created opencv_ml_alias.pc
conanfile.py: Generator pkg_config created opencv_imgproc_alias.pc
conanfile.py: Generator pkg_config created opencv_flann_alias.pc
conanfile.py: Generator pkg_config created opencv_core_alias.pc
conanfile.py: Generator pkg_config created opencv.pc
conanfile.py: Generator pkg_config created jasper.pc
conanfile.py: Generator pkg_config created libpng.pc
conanfile.py: Generator pkg_config created libtiff-4.pc
conanfile.py: Generator pkg_config created eigen3.pc
conanfile.py: Generator pkg_config created quirc.pc
conanfile.py: Generator pkg_config created zlib.pc
conanfile.py: Generator pkg_config created libjpeg.pc
conanfile.py: Generator pkg_config created libdeflate.pc
conanfile.py: Generator pkg_config created liblzma.pc
conanfile.py: Generator pkg_config created jbig.pc
conanfile.py: Generator pkg_config created libzstd.pc
conanfile.py: Generator pkg_config created zstd.pc
conanfile.py: Generator pkg_config created libwebp.pc
conanfile.py: Generator pkg_config created libwebpmux.pc
conanfile.py: Generator pkg_config created libwebpdemux.pc
conanfile.py: Generator pkg_config created libwebpdecoder.pc
conanfile.py: Generator txt created conanbuildinfo.txt
conanfile.py: Calling generate()
conanfile.py: Generated conaninfo.txt
conanfile.py: Generated graphinfo
vscode ➜ /workspaces/tennisAnalysis (main ✗) $ conan build . -if install
Using lockfile: '/workspaces/tennisAnalysis/install/conan.lock'
Using cached profile from lockfile
conanfile.py: Calling build()
Could not find any valid candidate for cross files: conan_meson_cross.ini

ERROR: Cannot find specified cross file: conan_meson_cross.ini
ERROR: conanfile.py: Error in build() method, line 42
        meson.configure(source_folder="src")
        ConanException: Error 1 while executing meson setup --cross-file "conan_meson_cross.ini" "/workspaces/tennisAnalysis/build" "/workspaces/tennisAnalysis/src" -Dprefix="/workspaces/tennisAnalysis/package"
```



Discussion:

Resolving patch:
diff --git a/conan/tools/meson/meson.py b/conan/tools/meson/meson.py
--- a/conan/tools/meson/meson.py
+++ b/conan/tools/meson/meson.py
@@ -3,7 +3,6 @@
 from conan.tools.build import build_jobs
 from conan.tools.meson import MesonToolchain
 
-
 class Meson(object):
     def __init__(self, conanfile):
         self._conanfile = conanfile


Test patch:
diff --git a/conans/test/functional/toolchains/meson/test_meson.py b/conans/test/functional/toolchains/meson/test_meson.py
--- a/conans/test/functional/toolchains/meson/test_meson.py
+++ b/conans/test/functional/toolchains/meson/test_meson.py
@@ -21,6 +21,7 @@ def config_options(self):
                 del self.options.fPIC
 
         def layout(self):
+            self.folders.generators = 'build/gen_folder'
             self.folders.build = "build"
 
         def generate(self):
@@ -71,7 +72,7 @@ def test_build(self):
 
         self.t.run("install . %s" % self._settings_str)
 
-        content = self.t.load("conan_meson_native.ini")
+        content = self.t.load(os.path.join("build", "gen_folder", "conan_meson_native.ini"))
 
         self.assertIn("[project options]", content)
         self.assertIn("STRING_DEFINITION = 'Text'", content)