[x265] [PATCH] cmake: generate and install pkgconfig file

Derek Buitenhuis derek.buitenhuis at gmail.com
Wed Oct 23 12:03:24 CEST 2013


On 10/23/2013 6:16 AM, Steve Borho wrote:
> # HG changeset patch
> # User Steve Borho <steve at borho.org>
> # Date 1382480398 18000
> #      Tue Oct 22 17:19:58 2013 -0500
> # Node ID a8d4928926e82026ed71ca0af210a5f4f16d405d
> # Parent  6d96d64c4e9a2c526b57274760a7147241328cb3
> cmake: generate and install pkgconfig file
> 
> This installs the x265.pc into /usr/local/lib/pkgconfig/ with these contents:

s#/usr/local/lib/#/specificed/prefix/#g in the commit message...

> Name: x265
> Description: H.265/HEVC video encoder
> Version: 0.4.1
> Libs: -L${libdir} -lx265
> Libs.private:  -lstdc++ -lm -lc -lpthread -lrt

This is not portable between systems, which may not use GNU's
libsdtc++. OS X, can for example, use libc++. Don't get me started
on Libav's MSVC stuff... ;)

Also, I thought you're not supposed to specify -lpthread explicitly --
that is, use -pthread when compiling/linking instead.

-lc should not be added.

Not all systems use librt, and it is also not portable. I think MinGW might not.

All of these things should be set properly based on configure checks.

> The pkg-config file is only generated and installed if CMake finds pkg-config
> 
> Q1: it seems unwise to hard-code "/lib" in a few places, what if lib64 is
> used or something else?

Autotools can set --libdir IIRC, which works around it as such:

${prefix}/${libdir}

Or at least, it has *something* like this, which I cannot recall the name
of off the top of my head.

> Q2: Should x265.pc have a version number like x265-0.4.1.pc?

No. This demeans the entire point of pkg-config. The version is set
in the .pc file, and it is what should be checked by end users, via
pkg-config.

- Derek


More information about the x265-devel mailing list