bugThe FreeType Project - Bugs: bug #57188, cmake: pkg-config for win32/mingw

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #57188: cmake: pkg-config for win32/mingw

Submitter:  avih <avih>
Submitted:  Fri 08 Nov 2019 06:15:26 AM UTC
   
 
Severity:  3 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  morksig Open/Closed:  Open
Planned Release:  None

Tue 12 Nov 2019 07:22:26 PM UTC, comment #4: 

So, the thing is, the CMake file is unofficial and not supported by Werner, the maintainer. It is more or less a DIY file; if it can be bent to your wishes, great, if not, oh well.

Judging from https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/How-To-Write-Platform-Checks#platform-variables, your hack might actually be a good idea... MingW is sort of UNIX but then isn't, and compiling the UNIX ftsystem.c should only happen on an actual UNIX as a target platform I assume? Also, the pkg-config files are only useful on UNIX? So I guess we can actually go UNIX AND NOT MINGW AND NOT MSYS AND NOT CYGWIN?

Nikolaus Waxweiler <morksig>
Group Member
Sat 09 Nov 2019 06:02:29 PM UTC, comment #3: 


> Are there any other files any platform needs?


Don't know in general, but the current FT2 installation (with the .pc file) is good enough for my needs - a cross platform script to build mpv with some deps (FT2 is one such dep).

> Maybe the pkg-config file should be gated not by UNIX but by some build time configuration?


That's what I had in mind too: automatic usage, which allows explicit override to enable/disable.

avih <avih>
Sat 09 Nov 2019 05:50:35 PM UTC, comment #2: 


> Is there a reason why you forgo the default build system?


I think I had a reason, but I don't recall what it was. Maybe it was easier to setup equally in all environments I support (linux native, mingw cross compile from linux or cygwin, mingw native, OSX), and cmake worked well enough - when defining UNIX.

Is the cmake build considered lesser in some way?

What's the reason that the .pc file is only created for UNIX?

avih <avih>
Sat 09 Nov 2019 05:39:54 PM UTC, comment #1: 

Curious. Just the other day I was wondering if CMake should install the .m4 thing as well. Maybe the pkg-config file should be gated not by UNIX but by some build time configuration? Are there any other files any platform needs?

As far as I know, the only output required to make CMake work with a CMake-installed FreeType is CMake's autogenerated config files. Is there a reason why you forgo the default build system?

Nikolaus Waxweiler <morksig>
Group Member
Fri 08 Nov 2019 06:15:26 AM UTC, original submission:  

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 "3aaae716b 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

avih <avih>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by morksig (Posted a comment)
  • -email is unavailable- added by podtelez (Updated the item)
  • -email is unavailable- added by podtelez
  • -email is unavailable- added by avih (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-09 podtelez Assigned toNone morksig
        Carbon-Copy- Added morksig

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code