DESTDIR parameter on install breaks ExternalProject_Add
When running make DESTDIR=$SOMEDIR install
for a CMake project that uses ExternalProject_Add()
the external project files are installed to $SOMEDIR
(during the install step of the external project that is run at build time).
If for example the CMAKE_INSTALL_PREFIX
is set to <INSTALL_DIR>
(for the external project) then the files aren't installed to <INSTALL_DIR>
but to $SOMEDIR/<INSTALL_DIR>
.
That's unwanted. The external project should ignore DESTDIR
.
I want to package a project for Arch Linux using make DESTDIR=$SOMEDIR install
. But because of the problem a home
directory ends up in the package.
The same is true for DESTDIR=$SOMEDIR ninja install
.
$ cmake --version
cmake version 3.11.4