facebook/hhvm — pull request #2777 by paravoid (2014-05-27 15:42:23+00:00)
Title: CMake: install headers under DESTDIR

The relatively new HHVM_INSTALL_HEADERS function has some special code
to recursively copy files to the target, using file(COPY ). However,
file(COPY) does not by default prefix with DESTDIR and would install the
headers into the system paths, instead of under the supplied destination
directory.

Change the function to prefix the target with $ENV{DESTDIR} to fix this.

This matters especially for downstream packagers, as packages usually
build by running "make install" using a DESTDIR, then packaging that
directory up. Without this, compilation would fail, as the build system
would attempt to install in a privileged system directory.