cmake: generate and install pkgconfig file

This installs the x265.pc into /usr/local/lib/pkgconfig/ with these contents:

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

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

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?
Q2: Should x265.pc have a version number like x265-0.4.1.pc?

--HG--
branch : stable
CSV log: Enable frame-by-frame CSV logging

--HG--
branch : stable
api: large reorg of logging and statistics

* move all CSV logging into the encoder so API users can take advantage of it
* remove hacky global PSNR return value from x265_encoder_close
* add time and bitrate values to x265_stats_t
* remove some dead HM code
* use x265_log in the CLI

--HG--
branch : stable
api: white-space cleanups in x265.h

--HG--
branch : stable
api: drop _t suffix from public data types, for POSIX compatibility

x265_t was changed to x265_encoder, since x265 is too short and would collide
with our namespace.

--HG--
branch : stable
extra : amend_source : 0b5ed45990de2efbd9a31d6c5da138b2a7988f94
Merge with stable
reference: cache MotionReference instances in each FrameEncoder

This prevents these structures from being allocated over and over for each frame
The source files were moved into the encoder folder where they've belonged but
couldn't live in the past because TComPicYuv needed to know their contents.

--HG--
rename : source/common/reference.cpp => source/encoder/reference.cpp
rename : source/common/reference.h => source/encoder/reference.h
TComSlice: remove unused TComRefPicListModification
TComSlice: remove unused m_bEqualRef and helper functions
TComSlice: remove unused copySliceInfo
asm: instantiate some sad_x3 and sad_x4 functions for HEVC partitions
fix commit typo
Displaying the number of weighted P frames used in console log

--HG--
branch : stable
encoder: fix bitrate statistic (accBits is a bit count, not byte count)

--HG--
branch : stable
output: use 64bit file offsets to prevent overflow with 4k video

--HG--
branch : stable
improvement TComTrQuant::getSigCtxInc by lookup table for 'cnt'
input: If Any error in reading frame from file, deactivate the thread and exit encoder gracefully

--HG--
branch : stable
lookahead: fix reference initialization for intra prediction

buffer size of pAbove/pLeft is height+1+width = 2*cusize+1

--HG--
branch : stable
improvement TComTrQuant::calcPatternSigCtx

1. replace width/height by size, since there are only NxN
2. use mask operatior to avoid condition and branch
improvement getSigCoeffGroupCtxInc by merge pointer calculate