cmake: pkg-config for win32/mingw
Migrated from: [SAVANNAH-57188]
avih reported:
pkg-config is typically used with mingw setups in general, but `freetype2.pc` is not created with the cmake freetype2 build for win32.
My solution so far has been to also define UNIX, which worked well enough and did create the .pc file.
However, the recent commit "3aaae716 CMakeLists.txt: minor doc additions, compile builds/unix/ftsystem.c on UNIX" broke this approach because now it tries to compile unix/ftsystem.c which is not good for win32.
My workaround was to change `IF (UNIX)` to `IF (UNIX AND NOT WIN32)` where `ftsystem.c` is chosen, however, this is clearly an ugly hack, because I only define UNIX to enable the pkg-file.
I'd appreciate some help on this with a better solution. I don't understand exactly the pkg-config cmake code, but it seems largely exclusively related to UNIX setup - IMO incorrectly.
I think it should either use pkg-config automatically (for both detection - if applicable, and creating a .pc file) regardless if it's WIN32 or UNIX, and/or add some config to control it explicitly?
Thanks in advance
Avi