msys2: `find_libraray` not finding libraries in compiler default search path
cmake_minimum_required(VERSION 3.15)
project(uuid_test)
find_library(uuid_PATH uuid)
message("foo ${uuid_PATH}")
results in
foo uuid_PATH-NOTFOUND
although
g++ main.cpp -luuid -Wl,--verbose | grep uuid
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libuuid.dll.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/uuid.dll.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libuuid.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/uuid.lib failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libuuid.lib failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libuuid.dll failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/uuid.dll failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0\libuuid.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/libuuid.dll.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/uuid.dll.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/libuuid.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/uuid.lib failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/libuuid.lib failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/libuuid.dll failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/uuid.dll failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc\libuuid.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libuuid.dll.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/uuid.dll.a failed
attempt to open D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libuuid.a succeeded
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libuuid.a
Is this intended behavior?