Repository: mesonbuild/meson

Issue:
Meson can't find glbinding via CMake in MSYS2
**Describe the bug**
Meson can't find glbinding via CMake in MSYS2.

**To Reproduce**
This `meson.build` can't find glbinding:
```
project('test', 'cpp')
glbinding_dep = dependency('glbinding')
```

But this `CMakeLists.txt` can:
```
project("test")
find_package(glbinding REQUIRED)
```

**Expected behavior**
Meson should find glbinding.

**System parameters**
* This is a simple native build via MSYS2 on Windows 10.
* Meson is 0.56.0.
* Python is 3.8.6.
* CMake is 3.19.1.
* Ninja is 1.10.2.
* glbinding is 3.1.0.

Note that in my actual `meson.build`, I'm using a number of other libraries, some of them which seem to be found via CMake, like Boost and GLFW.

Everything is installed via `mingw-w64-x86_64_*` packages.


Discussion:
Well, as a workaround, I created a CMake subproject. Works like a charm.

In `subprojects/glbinding/CMakeLists.txt`:
```
cmake_minimum_required(VERSION 3.19)
project("glbinding")

find_package(glbinding REQUIRED)
add_library(glbinding INTERFACE)
target_link_libraries(glbinding INTERFACE "glbinding::glbinding" "glbinding::glbinding-aux")

```

In your `meson.build`:
```
glbinding_dep = dependency('glbinding', version : '>=3.1.0', required : false)

if not glbinding_dep.found()
    cmake = import('cmake')
    glbinding_subproj = cmake.subproject('glbinding')
    glbinding_dep = glbinding_subproj.dependency('glbinding')
endif
```

Not sure if there's a way too fallback to a CMake subproject, to avoid the cruft above.
Also, I don't see a way to pass variables to a CMake subproject. It would be useful to pass the required glbinding version to the subproject.
Spoke too soon.

So the final thing would be:

`subprojects/glbinding/CMakeLists.txt`:
```
cmake_minimum_required(VERSION 3.19)
project("glbinding")

find_package(glbinding REQUIRED ${VERSION})
add_library(glbinding INTERFACE)
target_link_libraries(glbinding INTERFACE "glbinding::glbinding" "glbinding::glbinding-aux")
```

`meson.build`:
```
glbinding_version = '3.1.0'
glbinding_dep = dependency('glbinding', version: '>=' + glbinding_version, required: false)

if not glbinding_dep.found()
    cmake = import('cmake')
    glbinding_subproj_opts = cmake.subproject_options()
    glbinding_subproj_opts.add_cmake_defines({'VERSION': glbinding_version})
    glbinding_subproj = cmake.subproject('glbinding', options: glbinding_subproj_opts)
    glbinding_dep = glbinding_subproj.dependency('glbinding')
endif
```
Could you please post your `meson-log.txt` for the `dependency('glbinding')` call?
Sure. This is the full `meson-log.txt` when running the minimum viable example:

```
Build started at 2020-12-27T14:50:03.680496
Main binary: C:/msys64/mingw64/bin/python.exe
Build Options: 
Python system: Windows
The Meson build system
Version: 0.56.0
Source dir: D:/Razvijanje/kaobitanga/a
Build dir: D:/Razvijanje/kaobitanga/a/build
Build type: native build
Project name: test
Project version: undefined
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the build machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the build machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Pkg-config binary for MachineChoice.HOST is not cached.
None of 'PKG_CONFIG' are defined in the environment, not changing global flags.
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: C:\msys64\mingw64\bin/pkg-config.EXE (1.7.3)
Determining dependency 'glbinding' with pkg-config executable 'C:\\msys64\\mingw64\\bin/pkg-config.EXE'
PKG_CONFIG_PATH: C:\msys64\mingw64\lib\pkgconfig;C:\msys64\mingw64\share\pkgconfig
Called `C:\msys64\mingw64\bin/pkg-config.EXE --modversion glbinding` -> 1

CMake binary for MachineChoice.BUILD is not cached
None of 'CMAKE' are defined in the environment, not changing global flags.
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: C:\msys64\mingw64\bin/cmake.EXE (3.19.1)
None of 'CMAKE_PREFIX_PATH' are defined in the environment, not changing global flags.
Extracting basic cmake information
Try CMake generator: auto
Calling CMake (['C:\\msys64\\mingw64\\bin/cmake.EXE']) in D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding with:
  - "--trace-expand"
  - "--trace-format=json-v1"
  - "--no-warn-unused-cli"
  - "--trace-redirect=cmake_trace.txt"
  - "-DCMAKE_TOOLCHAIN_FILE=D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding/CMakeMesonToolchainFile.cmake"
  - "."
  -- Module search paths:    []
  -- CMake root:             C:/msys64/mingw64/share/cmake-3.19
  -- CMake architectures:    []
  -- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share']
Preliminary CMake check failed. Aborting.
Run-time dependency glbinding found: NO (tried pkgconfig and cmake)

meson.build:2:0: ERROR: Dependency "glbinding" not found, tried pkgconfig and cmake
```

I took a look at `meson-private/cmake-glbinding/CMakeFiles/CMakeOutput.log` as well:
```
The system is: Windows - 10.0.18363 - AMD64
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: C:/msys64/mingw64/bin/c++.EXE 
Build flags: 
Id flags:  

The output was:
0
Microsoft (R) Build Engine version 16.8.1+bd2ea1e3c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 27.12.2020. 14:57:23.
Project "D:\Razvijanje\kaobitanga\a\build\meson-private\cmake_glbinding\CMakeFiles\3.19.1\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
  Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc142.pdb" /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp
  CMakeCXXCompilerId.cpp
Link:
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
  CompilerIdCXX.vcxproj -> D:\Razvijanje\kaobitanga\a\build\meson-private\cmake_glbinding\CMakeFiles\3.19.1\CompilerIdCXX\CompilerIdCXX.exe
PostBuildEvent:
  for %%i in (cl.exe) do @echo CMAKE_CXX_COMPILER=%%~$PATH:i
  :VCEnd
  CMAKE_CXX_COMPILER=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\cl.exe
FinalizeBuildStatus:
  Deleting file "Debug\CompilerIdCXX.tlog\unsuccessfulbuild".
  Touching "Debug\CompilerIdCXX.tlog\CompilerIdCXX.lastbuildstate".
Done Building Project "D:\Razvijanje\kaobitanga\a\build\meson-private\cmake_glbinding\CMakeFiles\3.19.1\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.66


Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CompilerIdCXX.exe"

Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CompilerIdCXX.vcxproj"

The CXX compiler identification is MSVC, found in "D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding/CMakeFiles/3.19.1/CompilerIdCXX/CompilerIdCXX.exe"
```

It looks like gcc is still correctly detected as the default compiler, but CMake is using the default generator, Visual Studio, which is set even for CMake in MSYS2 if it's installed (which it is on my system). Setting [CMAKE_GENERATOR](https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR.html) to Ninja through the shell or through Windows did nothing.

The glbinding subproject is correctly using Ninja, so this seems to be the root issue. Or maybe not, I'm not really familiar with Meson's internals. 😄 
> Preliminary CMake check failed. Aborting.

This is the issue. We manually look for the relevant CMake files first to speed up the dependency detection (no need to run CMake when the we "can know" that the dependency isn't installed). Apparently there is an issue in our code and meson is unable to detect the config files.

Could you please post the path were `glbinding` is installed on your system (specifically where the `glbindingConfig.cmake` is located)?
```
$ pacboy -Ql glbinding:x | grep cmake
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/glbinding-aux/
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/glbinding-aux/glbinding-aux-export-release.cmake
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/glbinding-aux/glbinding-aux-export.cmake
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/glbinding-config.cmake
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/glbinding/
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/glbinding/glbinding-export-release.cmake
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/glbinding/glbinding-export.cmake
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/KHRplatform/
mingw-w64-x86_64-glbinding /mingw64/lib/cmake/glbinding/KHRplatform/KHRplatform-export.cmake
```

The config file is named `glbinding-config.cmake`. Its naming convention is supported by [find_package()](https://cmake.org/cmake/help/latest/command/find_package.html):
> The command searches for a file called `<PackageName>`Config.cmake or `<lower-case-package-name>`-config.cmake for each name specified.
OK, I have looked through our logic and it should work with our code. Do you have any special environment variables set (`<PackageName>_DIR`, `<PackageName>_ROOT`)?

Could you please try printing `CMAKE_MODULE_PATH` to `/mingw64/lib/cmake/glbinding` (either as an environment or as a meson option `cmake_prefix_path`)?

This is, unfortunately, a bit of an edge case and I can't debug this locally since I don't have your setup :(
> OK, I have looked through our logic and it should work with our code. Do you have any special environment variables set (`<PackageName>_DIR`, `<PackageName>_ROOT`)?

Nope. No variables of that sort.

```
$ ( set -o posix ; set ) | grep _DIR
DXSDK_DIR='C:\Program Files (x86)\Microsoft DirectX SDK (March 2009)\'
NVM_DIR=/c/Users/hauzer/.nvm
```

```
$ ( set -o posix ; set ) | grep _ROOT
WIN_ROOT=/c/Windows
```

> Could you please try printing `CMAKE_MODULE_PATH` to `/mingw64/lib/cmake/glbinding` (either as an environment or as a meson option `cmake_prefix_path`)?

Do you mean set the `CMAKE_MODULE_PATH` variable to `/mingw64/lib/cmake/glbinding`? I've done both now, as you instructed, but nothing seems to change.

`meson.build` is:
```
project('test', 'cpp', default_options: ['cmake_prefix_path=/mingw64/lib/cmake/glbinding'])
glbinding_dep = dependency('glbinding')
```
I've set both `CMAKE_MODULE_PATH` and `CMAKE_PREFIX_PATH` to `/mingw64/lib/cmake/glbinding`. Then I ran a clean `meson build`. Same results.

Here's the new `meson-log.txt`, maybe something changed:

```
Build started at 2020-12-27T18:15:14.514028
Main binary: C:/msys64/mingw64/bin/python.exe
Build Options: 
Python system: Windows
The Meson build system
Version: 0.56.0
Source dir: D:/Razvijanje/kaobitanga/a
Build dir: D:/Razvijanje/kaobitanga/a/build
Build type: native build
Project name: test
Project version: undefined
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the build machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the build machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Pkg-config binary for MachineChoice.HOST is not cached.
None of 'PKG_CONFIG' are defined in the environment, not changing global flags.
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: C:\msys64\mingw64\bin/pkg-config.EXE (1.7.3)
Determining dependency 'glbinding' with pkg-config executable 'C:\\msys64\\mingw64\\bin/pkg-config.EXE'
PKG_CONFIG_PATH: C:\msys64\mingw64\lib\pkgconfig;C:\msys64\mingw64\share\pkgconfig
Called `C:\msys64\mingw64\bin/pkg-config.EXE --modversion glbinding` -> 1

CMake binary for MachineChoice.BUILD is not cached
None of 'CMAKE' are defined in the environment, not changing global flags.
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: C:\msys64\mingw64\bin/cmake.EXE (3.19.1)
None of 'CMAKE_PREFIX_PATH' are defined in the environment, not changing global flags.
Extracting basic cmake information
Try CMake generator: auto
Calling CMake (['C:\\msys64\\mingw64\\bin/cmake.EXE']) in D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding with:
  - "--trace-expand"
  - "--trace-format=json-v1"
  - "--no-warn-unused-cli"
  - "--trace-redirect=cmake_trace.txt"
  - "-DCMAKE_TOOLCHAIN_FILE=D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding/CMakeMesonToolchainFile.cmake"
  - "."
  - "-DCMAKE_PREFIX_PATH=/mingw64/lib/cmake/glbinding"
  -- Module search paths:    []
  -- CMake root:             C:/msys64/mingw64/share/cmake-3.19
  -- CMake architectures:    []
  -- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share']
Preliminary CMake check failed. Aborting.
Run-time dependency glbinding found: NO (tried pkgconfig and cmake)

meson.build:2:0: ERROR: Dependency "glbinding" not found, tried pkgconfig and cmake
```

> This is, unfortunately, a bit of an edge case and I can't debug this locally since I don't have your setup :(

No problem. 😄 I've already posted the workaround, so it's nothing critical. It would be neat to understand the underlying problem, though. Might be something with MSYS2 not being standard as well. Not sure.
> Do you mean set the CMAKE_MODULE_PATH variable to /mingw64/lib/cmake/glbinding? I've done both now, as you instructed, but nothing seems to change.

Sorry I was a bit unclear. I have meant to ask that you use the complete Windows path (so something like `C:/foo/bar/mingw64/lib/cmake/glbinding`).

Also, could you try setting adding `set(CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY OFF)` to your CMake subproject (or passing it with `-D` from the commandline)? This should (hopefully) cause the `find_package()` call to fail.

If both of this fails could you please try to apply this patch to the meson master and post the log again?

```patch
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 6f568d37e..6b1099766 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1242,6 +1242,7 @@ class CMakeDependency(ExternalDependency):
 
         # Checks <path>, <path>/cmake, <path>/CMake
         def find_module(path: str) -> bool:
+            mlog.debug(f'S:  find_module({path}):')
             for i in [path, os.path.join(path, 'cmake'), os.path.join(path, 'CMake')]:
                 if not self._cached_isdir(i):
                     continue
@@ -1250,12 +1251,15 @@ class CMakeDependency(ExternalDependency):
                 content = self._cached_listdir(i)
                 candidates = ['Find{}.cmake', '{}Config.cmake', '{}-config.cmake']
                 candidates = [x.format(name).lower() for x in candidates]
+                mlog.debug(f'X:   -- candidates = {candidates}:')
                 if any([x[1] in candidates for x in content]):
                     return True
+            mlog.debug(f'E:  find_module({path}):')
             return False
 
         # Search in <path>/(lib/<arch>|lib*|share) for cmake files
         def search_lib_dirs(path: str) -> bool:
+            mlog.debug(f'S: search_lib_dirs({path}):')
             for i in [os.path.join(path, x) for x in self.cmakeinfo['common_paths']]:
                 if not self._cached_isdir(i):
                     continue
@@ -1277,6 +1281,7 @@ class CMakeDependency(ExternalDependency):
                     if find_module(os.path.join(i, k[0])):
                         return True
 
+            mlog.debug(f'E: search_lib_dirs({path}):')
             return False
 
         # Check the user provided and system module paths
```

EDIT: you may want to check if glbinding has a registry entry in `HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<PackageName>`
> Sorry I was a bit unclear. I have meant to ask that you use the complete Windows path (so something like `C:/foo/bar/mingw64/lib/cmake/glbinding`).

I've tried using:

* `/c/msys64/mingw64/lib/cmake/glbinding`
* `C:/msys64/mingw64/lib/cmake/glbinding`
* `C:\\msys64\\mingw64\\lib\\cmake\\glbinding`

for

* `cmake_prefix_path` Meson option
* `CMAKE_PREFIX_PATH` envvar
* `CMAKE_MODULE_PATH` ennvar

Same results.

> Also, could you try setting adding `set(CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY OFF)` to your CMake subproject (or passing it with `-D` from the commandline)? This should (hopefully) cause the `find_package()` call to fail.

The `glbinding` CMake subproject with this `CMakeLists.txt`:
```
cmake_minimum_required(VERSION 3.19)
set(CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY OFF)
project("glbinding")

find_package(glbinding REQUIRED ${VERSION})
add_library(glbinding INTERFACE)
target_link_libraries(glbinding INTERFACE "glbinding::glbinding" "glbinding::glbinding-aux")
```
behaves the same, i.e. succeeds (tested on a clean build, of course).

> If both of this fails could you please try to apply this patch to the meson master and post the log again?
> 
> ```diff
> diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
> index 6f568d37e..6b1099766 100644
> --- a/mesonbuild/dependencies/base.py
> +++ b/mesonbuild/dependencies/base.py
> @@ -1242,6 +1242,7 @@ class CMakeDependency(ExternalDependency):
>  
>          # Checks <path>, <path>/cmake, <path>/CMake
>          def find_module(path: str) -> bool:
> +            mlog.debug(f'S:  find_module({path}):')
>              for i in [path, os.path.join(path, 'cmake'), os.path.join(path, 'CMake')]:
>                  if not self._cached_isdir(i):
>                      continue
> @@ -1250,12 +1251,15 @@ class CMakeDependency(ExternalDependency):
>                  content = self._cached_listdir(i)
>                  candidates = ['Find{}.cmake', '{}Config.cmake', '{}-config.cmake']
>                  candidates = [x.format(name).lower() for x in candidates]
> +                mlog.debug(f'X:   -- candidates = {candidates}:')
>                  if any([x[1] in candidates for x in content]):
>                      return True
> +            mlog.debug(f'E:  find_module({path}):')
>              return False
>  
>          # Search in <path>/(lib/<arch>|lib*|share) for cmake files
>          def search_lib_dirs(path: str) -> bool:
> +            mlog.debug(f'S: search_lib_dirs({path}):')
>              for i in [os.path.join(path, x) for x in self.cmakeinfo['common_paths']]:
>                  if not self._cached_isdir(i):
>                      continue
> @@ -1277,6 +1281,7 @@ class CMakeDependency(ExternalDependency):
>                      if find_module(os.path.join(i, k[0])):
>                          return True
>  
> +            mlog.debug(f'E: search_lib_dirs({path}):')
>              return False
>  
>          # Check the user provided and system module paths
> ```

I'll try this tomorrow and post the results.

> EDIT: you may want to check if glbinding has a registry entry in `HKEY_LOCAL_MACHINE\Software\Kitware\CMake\Packages\<PackageName>`

I don't have even have the `Kitware` entry in the registry.
Okay, finally gotten around to testing with the patch. Here's the `meson-log.txt`:

```
Build started at 2020-12-28T13:48:53.240895
Main binary: C:/msys64/mingw64/bin/python.exe
Build Options: 
Python system: Windows
The Meson build system
Version: 0.56.99
Source dir: D:/Razvijanje/kaobitanga/a
Build dir: D:/Razvijanje/kaobitanga/a/build
Build type: native build
Project name: test
Project version: undefined
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the build machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the build machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Pkg-config binary for MachineChoice.HOST is not cached.
None of 'PKG_CONFIG' are defined in the environment, not changing global flags.
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: C:\msys64\mingw64\bin/pkg-config.EXE (1.7.3)
Determining dependency 'glbinding' with pkg-config executable 'C:\\msys64\\mingw64\\bin/pkg-config.EXE'
PKG_CONFIG_PATH: C:\msys64\mingw64\lib\pkgconfig;C:\msys64\mingw64\share\pkgconfig
Called `C:\msys64\mingw64\bin/pkg-config.EXE --modversion glbinding` -> 1

CMake binary for MachineChoice.HOST is not cached
None of 'CMAKE' are defined in the environment, not changing global flags.
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: C:\msys64\mingw64\bin/cmake.EXE (3.19.1)
None of 'CMAKE_PREFIX_PATH' are defined in the environment, not changing global flags.
Extracting basic cmake information
Try CMake generator: auto
Calling CMake (['C:\\msys64\\mingw64\\bin/cmake.EXE']) in D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding with:
  - "--trace-expand"
  - "--trace-format=json-v1"
  - "--no-warn-unused-cli"
  - "--trace-redirect=cmake_trace.txt"
  - "-DCMAKE_TOOLCHAIN_FILE=D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding/CMakeMesonToolchainFile.cmake"
  - "."
  -- Module search paths:    []
  -- CMake root:             C:/msys64/mingw64/share/cmake-3.19
  -- CMake architectures:    []
  -- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share']
S:  find_module(C:/msys64/mingw64/share/cmake-3.19/Modules):
X:   -- candidates = ['findglbinding.cmake', 'glbindingconfig.cmake', 'glbinding-config.cmake']:
E:  find_module(C:/msys64/mingw64/share/cmake-3.19/Modules):
Preliminary CMake check failed. Aborting.
Run-time dependency glbinding found: NO (tried pkgconfig and cmake)

meson.build:2:0: ERROR: Dependency "glbinding" not found, tried pkgconfig and cmake
```

And with the path vars set:
```
Build started at 2020-12-28T13:51:19.239990
Main binary: C:/msys64/mingw64/bin/python.exe
Build Options: 
Python system: Windows
The Meson build system
Version: 0.56.99
Source dir: D:/Razvijanje/kaobitanga/a
Build dir: D:/Razvijanje/kaobitanga/a/build
Build type: native build
Project name: test
Project version: undefined
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity testing C++ compiler: c++
Is cross compiler: False.
None of 'CXX_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: c++ D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.cc -o D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: D:/Razvijanje/kaobitanga/a/build/meson-private/sanitycheckcpp.exe
C++ compiler for the build machine: c++ (gcc 10.2.0 "c++ (Rev6, Built by MSYS2 project) 10.2.0")
C++ linker for the build machine: c++ ld.bfd 2.35.1
None of 'AR' are defined in the environment, not changing global flags.
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Pkg-config binary for MachineChoice.HOST is not cached.
None of 'PKG_CONFIG' are defined in the environment, not changing global flags.
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: C:\msys64\mingw64\bin/pkg-config.EXE (1.7.3)
Determining dependency 'glbinding' with pkg-config executable 'C:\\msys64\\mingw64\\bin/pkg-config.EXE'
PKG_CONFIG_PATH: C:\msys64\mingw64\lib\pkgconfig;C:\msys64\mingw64\share\pkgconfig
Called `C:\msys64\mingw64\bin/pkg-config.EXE --modversion glbinding` -> 1

CMake binary for MachineChoice.HOST is not cached
None of 'CMAKE' are defined in the environment, not changing global flags.
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: C:\msys64\mingw64\bin/cmake.EXE (3.19.1)
None of 'CMAKE_PREFIX_PATH' are defined in the environment, not changing global flags.
Extracting basic cmake information
Try CMake generator: auto
Calling CMake (['C:\\msys64\\mingw64\\bin/cmake.EXE']) in D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding with:
  - "--trace-expand"
  - "--trace-format=json-v1"
  - "--no-warn-unused-cli"
  - "--trace-redirect=cmake_trace.txt"
  - "-DCMAKE_TOOLCHAIN_FILE=D:/Razvijanje/kaobitanga/a/build/meson-private/cmake_glbinding/CMakeMesonToolchainFile.cmake"
  - "."
  - "-DCMAKE_PREFIX_PATH=/c/msys64/mingw64/lib/cmake/glbinding"
  -- Module search paths:    []
  -- CMake root:             C:/msys64/mingw64/share/cmake-3.19
  -- CMake architectures:    []
  -- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share']
S:  find_module(C:/msys64/mingw64/share/cmake-3.19/Modules):
X:   -- candidates = ['findglbinding.cmake', 'glbindingconfig.cmake', 'glbinding-config.cmake']:
E:  find_module(C:/msys64/mingw64/share/cmake-3.19/Modules):
S: search_lib_dirs(/c/msys64/mingw64/lib/cmake/glbinding):
E: search_lib_dirs(/c/msys64/mingw64/lib/cmake/glbinding):
Preliminary CMake check failed. Aborting.
Run-time dependency glbinding found: NO (tried pkgconfig and cmake)

meson.build:2:0: ERROR: Dependency "glbinding" not found, tried pkgconfig and cmake
```

I can test whichever patch you'd like now, since I've set up everything for easy testing.
OK, a slightly different approach: Could you please post the output of `cmake --debug-find ..` when configuring this project:

```cmake
cmake_minimum_required(VERSION ${CMAKE_VERSION})

project(TEST)

find_package(glbinding REQUIRED)
```
```
$ cmake -G Ninja --debug-find ..
Running with debug output on for the `find` commands.
CMake Debug Log at CMakeLists.txt:4 (find_package):
  find_package considered the following paths for glbinding.cmake

    C:/msys64/mingw64/share/cmake-3.19/Modules/Findglbinding.cmake

  The file was not found.

    C:/msys64/mingw64/lib/cmake/glbinding/glbindingConfig.cmake
    C:/msys64/mingw64/lib/cmake/glbinding/glbinding-config.cmake



CMake Debug Log at CMakeLists.txt:4 (find_package):


-- Configuring done
-- Generating done
-- Build files have been written to: D:/Razvijanje/kaobitanga/subprojects/glbinding/build
```
Could you please try the command again with a fresh build dir? It looks like your CMake cache is working :)
Whoops!

```
$ cmake -G Ninja --debug-find ..
Running with debug output on for the `find` commands.
CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeNinjaFindMake.cmake:5 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_MAKE_PROGRAM
    NAMES: "ninja-build"
           "ninja"
           "samu"
    Documentation: Program used to build from build.ninja files.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/ninja-build.com
    C:/msys64/mingw64/bin/ninja-build.exe
    C:/msys64/mingw64/bin/ninja-build
    C:/msys64/mingw64/bin/ninja.com

  The item was found at

    C:/msys64/mingw64/bin/ninja.exe

Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompiler.cmake:60 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_C_COMPILER
    NAMES: "cc"
           "gcc"
           "cl"
           "bcc"
           "xlc"
           "clang"
    Documentation: C compiler
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 0
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 0
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 0

  find_program considered the following locations:

    C:/msys64/mingw64/bin/cc.com

  The item was found at

    C:/msys64/mingw64/bin/cc.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:65 (_cmake_find_compiler)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:236 (find_file):
  find_file called with the following settings:

    VAR: src_in
    NAMES: "CMakeCCompilerId.c.in"
    Documentation: Path to a file.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    NO_DEFAULT_PATH Enabled

  find_file considered the following locations:

  The item was found at

    C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeCCompilerId.c.in

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:258 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:34 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:118 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:2 (project)


-- The C compiler identification is GNU 10.2.0
CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:124 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_AR
    NAMES: "ar"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/ar.com

  The item was found at

    C:/msys64/mingw64/bin/ar.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:126 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_RANLIB
    NAMES: "ranlib"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/ranlib.com

  The item was found at

    C:/msys64/mingw64/bin/ranlib.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:132 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_STRIP
    NAMES: "strip"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/strip.com

  The item was found at

    C:/msys64/mingw64/bin/strip.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:133 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_LINKER
    NAMES: "ld"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/ld.com

  The item was found at

    C:/msys64/mingw64/bin/ld.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:134 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_NM
    NAMES: "nm"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/nm.com

  The item was found at

    C:/msys64/mingw64/bin/nm.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:135 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_OBJDUMP
    NAMES: "objdump"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/objdump.com

  The item was found at

    C:/msys64/mingw64/bin/objdump.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:136 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_OBJCOPY
    NAMES: "objcopy"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/objcopy.com

  The item was found at

    C:/msys64/mingw64/bin/objcopy.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:137 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_READELF
    NAMES: "readelf"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/readelf.com

  The item was found at

    C:/msys64/mingw64/bin/readelf.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:138 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_DLLTOOL
    NAMES: "dlltool"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/dlltool.com

  The item was found at

    C:/msys64/mingw64/bin/dlltool.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake:139 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_ADDR2LINE
    NAMES: "addr2line"
    Documentation: Path to a program.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/addr2line.com

  The item was found at

    C:/msys64/mingw64/bin/addr2line.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:194 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/Compiler/GNU-FindBinUtils.cmake:18 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_C_COMPILER_AR
    NAMES: "gcc-ar-10.2"
           "gcc-ar-10"
           "gcc-ar"
    Documentation: A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/gcc-ar-10.2.com
    C:/msys64/mingw64/bin/gcc-ar-10.2.exe
    C:/msys64/mingw64/bin/gcc-ar-10.2
    C:/msys64/usr/local/bin/gcc-ar-10.2.com
    C:/msys64/usr/local/bin/gcc-ar-10.2.exe
    C:/msys64/usr/local/bin/gcc-ar-10.2
    C:/msys64/usr/bin/gcc-ar-10.2.com
    C:/msys64/usr/bin/gcc-ar-10.2.exe
    C:/msys64/usr/bin/gcc-ar-10.2
    C:/Windows/System32/gcc-ar-10.2.com
    C:/Windows/System32/gcc-ar-10.2.exe
    C:/Windows/System32/gcc-ar-10.2
    C:/Windows/gcc-ar-10.2.com
    C:/Windows/gcc-ar-10.2.exe
    C:/Windows/gcc-ar-10.2
    C:/Windows/System32/wbem/gcc-ar-10.2.com
    C:/Windows/System32/wbem/gcc-ar-10.2.exe
    C:/Windows/System32/wbem/gcc-ar-10.2
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.2.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.2.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.2
    C:/msys64/usr/bin/site_perl/gcc-ar-10.2.com
    C:/msys64/usr/bin/site_perl/gcc-ar-10.2.exe
    C:/msys64/usr/bin/site_perl/gcc-ar-10.2
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.2.com
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.2.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.2
    C:/msys64/usr/bin/core_perl/gcc-ar-10.2.com
    C:/msys64/usr/bin/core_perl/gcc-ar-10.2.exe
    C:/msys64/usr/bin/core_perl/gcc-ar-10.2
    C:/msys64/mingw64/bin/gcc-ar-10.com
    C:/msys64/mingw64/bin/gcc-ar-10.exe
    C:/msys64/mingw64/bin/gcc-ar-10
    C:/msys64/usr/local/bin/gcc-ar-10.com
    C:/msys64/usr/local/bin/gcc-ar-10.exe
    C:/msys64/usr/local/bin/gcc-ar-10
    C:/msys64/usr/bin/gcc-ar-10.com
    C:/msys64/usr/bin/gcc-ar-10.exe
    C:/msys64/usr/bin/gcc-ar-10
    C:/Windows/System32/gcc-ar-10.com
    C:/Windows/System32/gcc-ar-10.exe
    C:/Windows/System32/gcc-ar-10
    C:/Windows/gcc-ar-10.com
    C:/Windows/gcc-ar-10.exe
    C:/Windows/gcc-ar-10
    C:/Windows/System32/wbem/gcc-ar-10.com
    C:/Windows/System32/wbem/gcc-ar-10.exe
    C:/Windows/System32/wbem/gcc-ar-10
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10
    C:/msys64/usr/bin/site_perl/gcc-ar-10.com
    C:/msys64/usr/bin/site_perl/gcc-ar-10.exe
    C:/msys64/usr/bin/site_perl/gcc-ar-10
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.com
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10
    C:/msys64/usr/bin/core_perl/gcc-ar-10.com
    C:/msys64/usr/bin/core_perl/gcc-ar-10.exe
    C:/msys64/usr/bin/core_perl/gcc-ar-10
    C:/msys64/mingw64/bin/gcc-ar.com

  The item was found at

    C:/msys64/mingw64/bin/gcc-ar.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:195 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/Compiler/GNU-FindBinUtils.cmake:28 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_C_COMPILER_RANLIB
    NAMES: "gcc-ranlib-10.2"
           "gcc-ranlib-10"
           "gcc-ranlib"
    Documentation: A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/gcc-ranlib-10.2.com
    C:/msys64/mingw64/bin/gcc-ranlib-10.2.exe
    C:/msys64/mingw64/bin/gcc-ranlib-10.2
    C:/msys64/usr/local/bin/gcc-ranlib-10.2.com
    C:/msys64/usr/local/bin/gcc-ranlib-10.2.exe
    C:/msys64/usr/local/bin/gcc-ranlib-10.2
    C:/msys64/usr/bin/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/gcc-ranlib-10.2
    C:/Windows/System32/gcc-ranlib-10.2.com
    C:/Windows/System32/gcc-ranlib-10.2.exe
    C:/Windows/System32/gcc-ranlib-10.2
    C:/Windows/gcc-ranlib-10.2.com
    C:/Windows/gcc-ranlib-10.2.exe
    C:/Windows/gcc-ranlib-10.2
    C:/Windows/System32/wbem/gcc-ranlib-10.2.com
    C:/Windows/System32/wbem/gcc-ranlib-10.2.exe
    C:/Windows/System32/wbem/gcc-ranlib-10.2
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.2.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.2.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.2
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.2
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.2
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.2
    C:/msys64/mingw64/bin/gcc-ranlib-10.com
    C:/msys64/mingw64/bin/gcc-ranlib-10.exe
    C:/msys64/mingw64/bin/gcc-ranlib-10
    C:/msys64/usr/local/bin/gcc-ranlib-10.com
    C:/msys64/usr/local/bin/gcc-ranlib-10.exe
    C:/msys64/usr/local/bin/gcc-ranlib-10
    C:/msys64/usr/bin/gcc-ranlib-10.com
    C:/msys64/usr/bin/gcc-ranlib-10.exe
    C:/msys64/usr/bin/gcc-ranlib-10
    C:/Windows/System32/gcc-ranlib-10.com
    C:/Windows/System32/gcc-ranlib-10.exe
    C:/Windows/System32/gcc-ranlib-10
    C:/Windows/gcc-ranlib-10.com
    C:/Windows/gcc-ranlib-10.exe
    C:/Windows/gcc-ranlib-10
    C:/Windows/System32/wbem/gcc-ranlib-10.com
    C:/Windows/System32/wbem/gcc-ranlib-10.exe
    C:/Windows/System32/wbem/gcc-ranlib-10
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.com
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.exe
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.com
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.com
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.exe
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10
    C:/msys64/mingw64/bin/gcc-ranlib.com

  The item was found at

    C:/msys64/mingw64/bin/gcc-ranlib.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCCompiler.cmake:195 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompiler.cmake:50 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_CXX_COMPILER
    NAMES: "c++"
           "g++"
           "cl"
           "bcc"
           "clang++"
    Documentation: CXX compiler
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    NO_DEFAULT_PATH Enabled

  find_program considered the following locations:

    C:/msys64/mingw64/bin/c++.com

  The item was found at

    C:/msys64/mingw64/bin/c++.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCXXCompiler.cmake:64 (_cmake_find_compiler)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:236 (find_file):
  find_file called with the following settings:

    VAR: src_in
    NAMES: "CMakeCXXCompilerId.cpp.in"
    Documentation: Path to a file.
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    NO_DEFAULT_PATH Enabled

  find_file considered the following locations:

  The item was found at

    C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeCXXCompilerId.cpp.in

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:258 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake:34 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCXXCompiler.cmake:115 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:2 (project)


-- The CXX compiler identification is GNU 10.2.0
CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/Compiler/GNU-FindBinUtils.cmake:18 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_CXX_COMPILER_AR
    NAMES: "gcc-ar-10.2"
           "gcc-ar-10"
           "gcc-ar"
    Documentation: A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/gcc-ar-10.2.com
    C:/msys64/mingw64/bin/gcc-ar-10.2.exe
    C:/msys64/mingw64/bin/gcc-ar-10.2
    C:/msys64/usr/local/bin/gcc-ar-10.2.com
    C:/msys64/usr/local/bin/gcc-ar-10.2.exe
    C:/msys64/usr/local/bin/gcc-ar-10.2
    C:/msys64/usr/bin/gcc-ar-10.2.com
    C:/msys64/usr/bin/gcc-ar-10.2.exe
    C:/msys64/usr/bin/gcc-ar-10.2
    C:/Windows/System32/gcc-ar-10.2.com
    C:/Windows/System32/gcc-ar-10.2.exe
    C:/Windows/System32/gcc-ar-10.2
    C:/Windows/gcc-ar-10.2.com
    C:/Windows/gcc-ar-10.2.exe
    C:/Windows/gcc-ar-10.2
    C:/Windows/System32/wbem/gcc-ar-10.2.com
    C:/Windows/System32/wbem/gcc-ar-10.2.exe
    C:/Windows/System32/wbem/gcc-ar-10.2
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.2.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.2.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.2
    C:/msys64/usr/bin/site_perl/gcc-ar-10.2.com
    C:/msys64/usr/bin/site_perl/gcc-ar-10.2.exe
    C:/msys64/usr/bin/site_perl/gcc-ar-10.2
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.2.com
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.2.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.2
    C:/msys64/usr/bin/core_perl/gcc-ar-10.2.com
    C:/msys64/usr/bin/core_perl/gcc-ar-10.2.exe
    C:/msys64/usr/bin/core_perl/gcc-ar-10.2
    C:/msys64/mingw64/bin/gcc-ar-10.com
    C:/msys64/mingw64/bin/gcc-ar-10.exe
    C:/msys64/mingw64/bin/gcc-ar-10
    C:/msys64/usr/local/bin/gcc-ar-10.com
    C:/msys64/usr/local/bin/gcc-ar-10.exe
    C:/msys64/usr/local/bin/gcc-ar-10
    C:/msys64/usr/bin/gcc-ar-10.com
    C:/msys64/usr/bin/gcc-ar-10.exe
    C:/msys64/usr/bin/gcc-ar-10
    C:/Windows/System32/gcc-ar-10.com
    C:/Windows/System32/gcc-ar-10.exe
    C:/Windows/System32/gcc-ar-10
    C:/Windows/gcc-ar-10.com
    C:/Windows/gcc-ar-10.exe
    C:/Windows/gcc-ar-10
    C:/Windows/System32/wbem/gcc-ar-10.com
    C:/Windows/System32/wbem/gcc-ar-10.exe
    C:/Windows/System32/wbem/gcc-ar-10
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ar-10
    C:/msys64/usr/bin/site_perl/gcc-ar-10.com
    C:/msys64/usr/bin/site_perl/gcc-ar-10.exe
    C:/msys64/usr/bin/site_perl/gcc-ar-10
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.com
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ar-10
    C:/msys64/usr/bin/core_perl/gcc-ar-10.com
    C:/msys64/usr/bin/core_perl/gcc-ar-10.exe
    C:/msys64/usr/bin/core_perl/gcc-ar-10
    C:/msys64/mingw64/bin/gcc-ar.com

  The item was found at

    C:/msys64/mingw64/bin/gcc-ar.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCXXCompiler.cmake:195 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/Compiler/GNU-FindBinUtils.cmake:28 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_CXX_COMPILER_RANLIB
    NAMES: "gcc-ranlib-10.2"
           "gcc-ranlib-10"
           "gcc-ranlib"
    Documentation: A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/gcc-ranlib-10.2.com
    C:/msys64/mingw64/bin/gcc-ranlib-10.2.exe
    C:/msys64/mingw64/bin/gcc-ranlib-10.2
    C:/msys64/usr/local/bin/gcc-ranlib-10.2.com
    C:/msys64/usr/local/bin/gcc-ranlib-10.2.exe
    C:/msys64/usr/local/bin/gcc-ranlib-10.2
    C:/msys64/usr/bin/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/gcc-ranlib-10.2
    C:/Windows/System32/gcc-ranlib-10.2.com
    C:/Windows/System32/gcc-ranlib-10.2.exe
    C:/Windows/System32/gcc-ranlib-10.2
    C:/Windows/gcc-ranlib-10.2.com
    C:/Windows/gcc-ranlib-10.2.exe
    C:/Windows/gcc-ranlib-10.2
    C:/Windows/System32/wbem/gcc-ranlib-10.2.com
    C:/Windows/System32/wbem/gcc-ranlib-10.2.exe
    C:/Windows/System32/wbem/gcc-ranlib-10.2
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.2.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.2.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.2
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.2
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.2
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.2.com
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.2.exe
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.2
    C:/msys64/mingw64/bin/gcc-ranlib-10.com
    C:/msys64/mingw64/bin/gcc-ranlib-10.exe
    C:/msys64/mingw64/bin/gcc-ranlib-10
    C:/msys64/usr/local/bin/gcc-ranlib-10.com
    C:/msys64/usr/local/bin/gcc-ranlib-10.exe
    C:/msys64/usr/local/bin/gcc-ranlib-10
    C:/msys64/usr/bin/gcc-ranlib-10.com
    C:/msys64/usr/bin/gcc-ranlib-10.exe
    C:/msys64/usr/bin/gcc-ranlib-10
    C:/Windows/System32/gcc-ranlib-10.com
    C:/Windows/System32/gcc-ranlib-10.exe
    C:/Windows/System32/gcc-ranlib-10
    C:/Windows/gcc-ranlib-10.com
    C:/Windows/gcc-ranlib-10.exe
    C:/Windows/gcc-ranlib-10
    C:/Windows/System32/wbem/gcc-ranlib-10.com
    C:/Windows/System32/wbem/gcc-ranlib-10.exe
    C:/Windows/System32/wbem/gcc-ranlib-10
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.com
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10.exe
    C:/Windows/System32/WindowsPowerShell/v1.0/gcc-ranlib-10
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.com
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10.exe
    C:/msys64/usr/bin/site_perl/gcc-ranlib-10
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.com
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10.exe
    C:/msys64/usr/bin/vendor_perl/gcc-ranlib-10
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.com
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10.exe
    C:/msys64/usr/bin/core_perl/gcc-ranlib-10
    C:/msys64/mingw64/bin/gcc-ranlib.com

  The item was found at

    C:/msys64/mingw64/bin/gcc-ranlib.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineCXXCompiler.cmake:195 (include)
  CMakeLists.txt:2 (project)


CMake Debug Log at C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeDetermineRCCompiler.cmake:39 (find_program):
  find_program called with the following settings:

    VAR: CMAKE_RC_COMPILER
    NAMES: "windres"
    Documentation: RC compiler
    Framework
      Only Search Frameworks: 0
      Search Frameworks Last: 0
      Search Frameworks First: 0
    AppBundle
      Only Search AppBundle: 0
      Search AppBundle Last: 0
      Search AppBundle First: 0
    CMAKE_FIND_USE_CMAKE_PATH: 1
    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1

  find_program considered the following locations:

    C:/msys64/mingw64/bin/windres.com

  The item was found at

    C:/msys64/mingw64/bin/windres.exe

Call Stack (most recent call first):
  C:/msys64/mingw64/share/cmake-3.19/Modules/Platform/Windows-GNU.cmake:136 (enable_language)
  C:/msys64/mingw64/share/cmake-3.19/Modules/Platform/Windows-GNU-C.cmake:2 (__windows_compiler_gnu)
  C:/msys64/mingw64/share/cmake-3.19/Modules/CMakeCInformation.cmake:48 (include)
  CMakeLists.txt:2 (project)


-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Debug Log at CMakeLists.txt:4 (find_package):
  find_package considered the following paths for glbinding.cmake

    C:/msys64/mingw64/share/cmake-3.19/Modules/Findglbinding.cmake

  The file was not found.

  <PackageName>_ROOT CMake variable [CMAKE_FIND_USE_PACKAGE_ROOT_PATH].

    none

  CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables
  [CMAKE_FIND_USE_CMAKE_PATH].

    none

  Env variable glbinding_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables
  [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].

    none

  Paths specified by the find_package HINTS option.

    none

  Standard system environment variables
  [CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].

    C:/msys64/mingw64
    C:/msys64/usr/local
    C:/msys64/usr
    C:/Windows/System32
    C:/Windows
    C:/Windows/System32/wbem
    C:/Windows/System32/WindowsPowerShell/v1.0
    C:/msys64/usr/bin/site_perl
    C:/msys64/usr/bin/vendor_perl
    C:/msys64/usr/bin/core_perl



  CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY].

    none

  CMake variables defined in the Platform file
  [CMAKE_FIND_USE_CMAKE_SYSTEM_PATH].

    C:/Program Files
    C:/Program Files (x86)
    C:/Program Files (x86)/glbinding



  CMake System Package Registry
  [CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY].

    none

  Paths specified by the find_package PATHS option.

    none

  find_package considered the following locations for the Config module:

    C:/msys64/mingw64/glbindingConfig.cmake
    C:/msys64/mingw64/glbinding-config.cmake
    C:/msys64/mingw64/lib/cmake/glbinding/glbindingConfig.cmake
    C:/msys64/mingw64/lib/cmake/glbinding/glbinding-config.cmake

  The file was found at

    C:/msys64/mingw64/lib/cmake/glbinding/glbinding-config.cmake



CMake Debug Log at CMakeLists.txt:4 (find_package):


-- Configuring done
-- Generating done
-- Build files have been written to: D:/Razvijanje/kaobitanga/subprojects/glbinding/build
```

Resolving patch:
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1185,7 +1185,12 @@ def _get_cmake_info(self, cm_args):
             return None
 
         def process_paths(l: T.List[str]) -> T.Set[str]:
-            l = [x.split(':') for x in l]
+            if mesonlib.is_windows():
+                # Cannot split on ':' on Windows because its in the drive letter
+                l = [x.split(os.pathsep) for x in l]
+            else:
+                # https://github.com/mesonbuild/meson/issues/7294
+                l = [re.split(r':|;', x) for x in l]
             l = [x for sublist in l for x in sublist]
             return set(l)
 
@@ -1289,8 +1294,17 @@ def search_lib_dirs(path: str) -> bool:
             if search_lib_dirs(i):
                 return True
 
+        # Check PATH
+        system_env = []  # type: T.List[str]
+        for i in os.environ.get('PATH', '').split(os.pathsep):
+            if i.endswith('/bin') or i.endswith('\\bin'):
+                i = i[:-4]
+            if i.endswith('/sbin') or i.endswith('\\sbin'):
+                i = i[:-5]
+            system_env += [i]
+
         # Check the system paths
-        for i in self.cmakeinfo['module_paths']:
+        for i in self.cmakeinfo['module_paths'] + system_env:
             if find_module(i):
                 return True
 


Test patch:
diff --git a/run_project_tests.py b/run_project_tests.py
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -653,6 +653,7 @@ def gather_tests(testdir: Path, stdout_mandatory: bool) -> T.List[TestDef]:
             env = test_def['env']
             for key, val in env.items():
                 val = val.replace('@ROOT@', t.path.resolve().as_posix())
+                val = val.replace('@PATH@', t.env.get('PATH', ''))
                 env[key] = val
 
         # Handle installed files
diff --git a/test cases/linuxlike/13 cmake dependency/cmake_fake3/bin/.gitkeep b/test cases/linuxlike/13 cmake dependency/cmake_fake3/bin/.gitkeep
new file mode 100644
diff --git a/test cases/linuxlike/13 cmake dependency/cmake_fake3/lib/cmake/cmMesonTestF3/cmMesonTestF3Config.cmake b/test cases/linuxlike/13 cmake dependency/cmake_fake3/lib/cmake/cmMesonTestF3/cmMesonTestF3Config.cmake
new file mode 100644
--- /dev/null
+++ b/test cases/linuxlike/13 cmake dependency/cmake_fake3/lib/cmake/cmMesonTestF3/cmMesonTestF3Config.cmake	
@@ -0,0 +1,9 @@
+find_package(ZLIB)
+
+if(ZLIB_FOUND OR ZLIB_Found)
+  set(cmMesonTestF3_FOUND        ON)
+  set(cmMesonTestF3_LIBRARIES    ${ZLIB_LIBRARY})
+  set(cmMesonTestF3_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
+else()
+  set(cmMesonTestF3_FOUND       OFF)
+endif()
diff --git a/test cases/linuxlike/13 cmake dependency/meson.build b/test cases/linuxlike/13 cmake dependency/meson.build
--- a/test cases/linuxlike/13 cmake dependency/meson.build	
+++ b/test cases/linuxlike/13 cmake dependency/meson.build	
@@ -46,6 +46,7 @@ assert(depf2.found() == false, 'Invalid CMake targets should fail')
 depPrefEnv = dependency('cmMesonTestDep', required : true, method : 'cmake')
 depPrefEnv1 = dependency('cmMesonTestF1', required : true, method : 'cmake')
 depPrefEnv2 = dependency('cmMesonTestF2', required : true, method : 'cmake')
+depPrefEnv3 = dependency('cmMesonTestF3', required : true, method : 'cmake')
 
 # Try to find a dependency with a custom CMake module
 
diff --git a/test cases/linuxlike/13 cmake dependency/test.json b/test cases/linuxlike/13 cmake dependency/test.json
--- a/test cases/linuxlike/13 cmake dependency/test.json	
+++ b/test cases/linuxlike/13 cmake dependency/test.json	
@@ -1,5 +1,6 @@
 {
   "env": {
-    "CMAKE_PREFIX_PATH": "@ROOT@/cmake_fake1;@ROOT@/cmake_fake2:@ROOT@/cmake_pref_env"
+    "CMAKE_PREFIX_PATH": "@ROOT@/cmake_fake1;@ROOT@/cmake_fake2:@ROOT@/cmake_pref_env",
+    "PATH": "@ROOT@/cmake_fake3/bin:@PATH@"
   }
 }