*NIX installation configuration (was [CMake] Cmake and Win32 plugin linking issues.)

Alan W. Irwin irwin at beluga.phys.uvic.ca
Thu Aug 24 02:32:53 EDT 2006


> Am I correct in understanding that *NIX packagers will need to patch my
> upstream CMakeLists.txt to adjust install location to fit with their
> distribution policies ?

No.  You can set things up to give users the complete freedom to determine
path variables.  To give this discussion some perspective, here is what is
typically available from autotools (taken from ./configure --help):

Fine tuning of the installation directories:
   --bindir=DIR           user executables [EPREFIX/bin]
   --sbindir=DIR          system admin executables [EPREFIX/sbin]
   --libexecdir=DIR       program executables [EPREFIX/libexec]
   --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
   --infodir=DIR          info documentation [PREFIX/info]
   --mandir=DIR           man documentation [PREFIX/man]

It's possible to set all these paths up with CMake, but that is probably
overkill, and you will probably only want to remind your users to use
CMAKE_INSTALL_PREFIX rather than PREFIX, and set up a small subset of the
above based on that prefix.  For example,

set(infodir
${CMAKE_INSTALL_PREFIX}/share/info
CACHE
PATH
"install location for info files"
)

gives a good (LFHS rather than autotools) default install location for info
files which the user has the option to override using ccmake or
-Dinfodir=/path/to/info/files, and which you consistently use as the
DESTINATION when you install info files using CMake. You could similarly set
up any of the other autotools install paths mentioned above using CMake.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list