Cmake incorrect library selection for mingw64 (by the generator)
An error occurs when I try to compile pastix (https://github.com/Kabbone/PaStiX4CalculiX/tree/cudaless):
D:/a/_temp/msys/msys64/usr/lib/libm.a(t-d000248.o):fake:(.text+0x2): undefined reference to __imp_cabs
This is most likely due to the use of the wrong libm.a package, generator 'MSYS Makefiles' and/or 'Ninja' detects libm.a package from location: usr/lib D:/a/_temp/msys/msys64/usr/lib/libm.a;D:/a/_temp/msys/msys64/usr/lib/librt.a
but it should for used from /msys64/mingw64/lib
Various locations/types:
-- Found SCOTCH: D:/a/_temp/msys/msys64/mingw64/lib/libscotch.dll.a; D:/a/_temp/msys/msys64/mingw64/lib/libscotcherrexit.a; D:/a/_temp/msys/msys64/mingw64/lib/libz.dll.a; D:/a/_temp/msys/msys64/usr/lib/libm.a; D:/a/_temp/msys/msys64/usr/lib/librt.a
I attach the CMakeLists, see more: https://github.com/msys2/MINGW-packages/issues/6952