[Cmake] CMaking Unix Makefiles... install target

Maitland Bottoms bottoms at debian . org
Sat, 8 Dec 2001 23:25:14 -0500


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