Fix/improve installation directory logic.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 4 Aug 2013 03:55:20 +0000 (06:55 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 15 Oct 2013 14:59:34 +0000 (16:59 +0200)
commit0b23449442ad0b0c1cc827bcb90d698f00292be3
tree388939bb5fd46c63fa13c32817fac5114e2d3b6f
parent8c5f92e92018e653c7747783e20c911d612e6e36
Fix/improve installation directory logic.

With the move to relative install paths (recommended by CMake), logic
that relied on the *_INSTALL_DIR variables for something else than
locations for the CMake install() command got broken.  Explicitly added
CMAKE_INSTALL_PREFIX there.

Also improve the approach for customizing the installation directories:
 - GMXLIB is now GMX_LIB_INSTALL_DIR, and a proper cache variable.
 - Added a GMX_DATA_INSTALL_DIR to customize the directory under which
   the data files get installed under share/.  Use this also in the code
   that searches for the data directory instead of hardcoding several
   guesses.

Related, moved the logic of falling back to a hard-coded library
directory into get_libdir(); it was duplicated in two places.

Resolves part of #1271: creating a binary package with CPack and
installing it somewhere else than in the CMAKE_INSTALL_PREFIX
used to create it still breaks all the logic touched here.  Also using
DESTDIR with 'make install' breaks it (but that has never worked).

Change-Id: I0271a8152f87dd59a229c9d0eca976404f974ea8
CMakeLists.txt
scripts/GMXRC.bash.cmakein
scripts/GMXRC.cmakein
scripts/GMXRC.csh.cmakein
scripts/GMXRC.zsh.cmakein
share/template/cmake/FindGROMACS.cmakein
src/config.h.cmakein
src/gromacs/gmxlib/futil.cpp
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/legacyheaders/futil.h
src/gromacs/libgromacs.pc.cmakein