Reland "Use custom command and target to install libc++ headers"

Using file(COPY FILE...) has several downsides. Since the file command
is only executed at configuration time, any changes to headers made
after the initial CMake execution are ignored. This can lead to subtle
errors since the just built Clang will be using stale libc++ headers.
Furthermore, since the headers are copied prior to executing the build
system, this may hide missing dependencies on libc++ from other LLVM
components.

This changes replaces the use of file(COPY FILE...) command with a
custom command and target which addresses all aforementioned issues and
matches the implementation already used by other LLVM components that
also install headers like Clang builtin headers.

Differential Revision: https://reviews.llvm.org/D44773

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334468 91177308-0d34-0410-b5e6-96231b3b80d8
4 files changed