[Cmake] CMaking Unix Makefiles... install target

William A. Hoffman bill.hoffman at kitware.com
Sun Dec 9 14:45:54 EST 2001


The way to change the install directory with cmake is to change the prefix.
This can be done in two ways:

1. when bootstrapping cmake:
configure --prefix=/your/directory

2. if building cmake with cmake, then change the INSTALL_PREFIX in the 
CMakeCache.txt file.

-Bill


At 11:25 PM 12/8/2001 -0500, Maitland Bottoms wrote:
>While building Debian packages for cmake, I had a few troubles...
>
>-------- This is what got placed in the Makefile:
>
>INSTALL = /home/maitland/stage/cmake-cvs/Templates/install-sh -c
>INSTALL_PROGRAM = $(INSTALL)
>INSTALL_DATA =    $(INSTALL) -m 644
>install: $(SUBDIR_INSTALL)
>         @echo "Installing ..."
>         @if [ ! -d /usr/bin ] ; then \
>            echo "Making directory /usr/bin "; \
>            mkdir -p /usr/bin; \
>            chmod 755 /usr/bin; \
>         else true; \
>         fi
>         $(INSTALL_PROGRAM) /home/maitland/stage/cmake-cvs/Source/cmake 
> /usr/bin
>
>-------- This is what I would like to see in the Makefile:
>
>INSTALL = /usr/bin/install -c
>INSTALL_PROGRAM = $(INSTALL)
>INSTALL_DATA =    $(INSTALL) -m 644
>install: $(SUBDIR_INSTALL)
>         @echo "Installing ..."
>         $(INSTALL_PROGRAM) /home/maitland/stage/cmake-cvs/Source/cmake 
> $(DESTDIR)/usr/bin
>
>
>Explanation:
>
>In creating packages, I would like to invoke the install target in the
>following manner:
>
>     make install DESTDIR=path/to/package/staging/area/
>
>Also, how widespread is the -p flag to mkdir? Isn't that flag
>indicative of a full-featured GNU mkdir? How many vendor mkdir
>programs support -p? Maybe path creation can be handed off to the
>install-sh support script?
>
>My Debian system has the GNU fileutils package installed which gives
>me a mkdir with the -p flag. It also gives me an install program with
>all the features of the install-sh in Templates/install-sh.
>
>I suspect some cmake guru can muck about in
>cmUnixMakefileGenerator.cxx and make this work for me. Or at least
>I'll have to muck about and keep those changes in a debian-specific
>patch. In any case, I've brought this issue up on the list. Interested
>parties can follow up with discussion... warnings? .....patches?
>
>-Maitland
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake




More information about the CMake mailing list