[x265] [PATCH] cmake: generate and install pkgconfig file
Steve Borho
steve at borho.org
Wed Oct 23 19:59:18 CEST 2013
On Wed, Oct 23, 2013 at 5:03 AM, Derek Buitenhuis <
derek.buitenhuis at gmail.com> wrote:
> 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... ;)
>
>
-lstdc++ -lm -lc are coming from CMAKE_CXX_IMPLICIT_LIBRARIES. ie these are
libraries detected by CMake that all C++ apps need to link with. It should
do the right thing if your compiler / operating system require different
libraries, though testing on those platforms would be quite helpful.
> Also, I thought you're not supposed to specify -lpthread explicitly --
> that is, use -pthread when compiling/linking instead.
>
I didn't know about -pthread. If that is going to prevent this from
working I can add a special case for it in the loop that builds the
PRIVATE_LIBS string
-lc should not be added.
>
Will it break things or is it just unnecessary (is it worth the trouble of
filtering it out)?
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.
they are, -lrt is only added on UNIX
> > 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.
ok
> > 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.
good
--
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131023/49eb45ff/attachment.html>
More information about the x265-devel
mailing list