[cmake-developers] Trouble with FindPNG module

Roger Leigh rleigh at codelibre.net
Mon Apr 24 14:58:52 EDT 2017


On 24/04/2017 19:30, Ben Boeckel wrote:
> On Mon, Apr 24, 2017 at 19:17:39 +0100, Roger Leigh wrote:
>> Sounds like that's exactly the problem.  You can only have one libpng
>> *development* package installed at once.  You probably want the regular
>> "libpng-dev" package installed if you want to build against the standard
>> libpng.
>
> Ah, this is before the multiarch split from Debian came into Ubuntu? I'm
> so used to Red Hat's lib64 split (multilib) (which, admittedly, has its
> drawbacks in light of multiarch).

Yes, this is exactly the case.  There are actually four development 
packages which could be installed:

libpng-dev:amd64
libpng-dev:i386
libpng12-dev:amd64
libpng12-dev:i386

And that's not counting the other architectures which could /also/ be 
installed as well, e.g. libpng-dev:powerpc, libpng12-dev:armel etc.

While you can install as many of the runtime packages as you like, the 
headers go into /usr/include and so they conflict with each other, 
limiting you to a single development package at one time (checked the 
behaviour to verify this, and installing one triggers removal of any 
existing variant).  Not itself a multiarch limitation--many packages now 
use /usr/include/<arch> for this reason--but certainly a limitation in 
the packaging of the current libpng, which for some reason hasn't yet 
started using arch-specific headers.

This is almost certainly why FindPNG fails.  The headers are found, but 
the library is missing since it's in the arch-specific lib path for the 
other architecture, and the compiler isn't using that path by default.


Regards,
Roger


More information about the cmake-developers mailing list