gz-cmake icon indicating copy to clipboard operation
gz-cmake copied to clipboard

Problems with `DESTDIR=/path/to/install make install`

Open osrf-migration opened this issue 6 years ago • 1 comments

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Initially noted in pull request #61:

  • https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-cmake/pull-requests/61/install-cmake-files-to-share-instead-of/diff#comment-61329769

From @_jrivero_: I've notice that when installing the files using DESTDIR (i.e. DESTDIR=/tmp/foo make install) there are some $HOME paths that end up being installed there, but the problem is also present in default

Reply from @mxgrey:

To elaborate on Jose's comment, it seems that trying to use make DESTDIR=/dest/dir install has some rather problematic behavior. Apparently DESTDIR=/dest/dir will prefix the install paths (including CMAKE_INSTALL_PREFIX) with /dest/dir. So if CMAKE_INSTALL_PREFIX was /usr/local, then make DESTDIR=/dest/dir install will have the installed files go to /dest/dir/usr/local.

This is problematic because the example projects (which are set to be installed to /path/to/build/folder/install) will inadvertently get installed to /dest/dir/path/to/build/folder/install, which is outside of the build directory.

We need a way of removing the build and installation of the example projects from the build and installation of all (preferably by tying those to make test instead), or else we won't be able to correctly support make DESTDIR=<path> install.

osrf-migration avatar Apr 13 '18 21:04 osrf-migration