Itseez/opencv — pull request #3216 by xantares (2014-09-13 14:06:27+00:00)
Title: change libraries install layout on linux-mingw

Hello,

This patch changes the directories where binaries and libraries are installed when cross-compiling from linux with mingw for a windows target.

The condition is changed from if(WIN32) to if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows),
which sets windows-style binary suffix to /, (for example mingw/x64) only when the host is windows. Note that it only changes the current behavior when cross-compiling from linux, and unchanged when compiling for native windows or when compiling with mingw from windows.

Binaries are now installed to /bin (including dlls)
and libraries (import or static) to /lib

It is the standard layout on linux for mingw now, for example fedora, archlinux, ...
https://fedoraproject.org/wiki/Packaging:MinGW?rd=Packaging/MinGW#Filesystem_layout

For example for mingw64 the prefix is set to /usr/i686-w64-mingw32 or /usr/x86_64-w64-mingw32, then you have /usr/i686-w64-mingw32/bin/*.dll, /usr/i686-w64-mingw32/lib/*.dll.a, /usr/i686-w64-mingw32/lib/*.a, /usr/i686-w64-mingw32/include, etc