[CMake] Re: cmake 2.2: make install PREFIX not working with CMAKE_INSTALL_PREFIX set to "/"

Michael Biebl mbiebl at gmail.com
Mon Apr 10 17:16:28 EDT 2006


It's getting stranger and stranger.
As I wanted to avoid that cmake generates "//" at the beginning of the
path name, I used
SET(CMAKE_INSTALL_PREFIX "" CACHE INTERNAL "")
Now, the following install command
INSTALL_FILES(/foo/bar FILES dir/test1)
installs on "make install DESTDIR=/tmp" the file
into /tmp/usr/local/foo/bar/dir/test1 (note the "/usr/local")
whereas
INSTALL_FILES(/foo/bar FILES test2) installs as expected to
/tmp/foo/bar/test2

This is really getting weird.

Hope, someone can help me with this problem.

Cheers,
Michael

On 4/10/06, Michael Biebl <mbiebl at gmail.com> wrote:
> I forgot to add:
> Removing
> SET(CMAKE_INSTALL_PREFIX / CACHE INTERNAL "")
> and running
> cmake .. -DCMAKE_INSTALL_PREFIX=/
> works fine.
>
>
> On 4/10/06, Michael Biebl <mbiebl at gmail.com> wrote:
> > With cmake 2.2 I get a very strange behaviour.
> > I use the following statement in my toplevel CMakeLists.txt file:
> > SET(CMAKE_INSTALL_PREFIX / CACHE INTERNAL "")
> > because I want to install the binaries to /sbin, /bin etc. by default.
> > A make install works fine, but if I run "make install
> > DESTDIR=/tmp/test" I get the following error message:
> >
> > FILE called with network path DESTINATION. This does not make sense
> > when using DESTDIR. Specify local absolute path or remove DESTDIR
> > environment variable.
> > make: *** [install] Fehler 255
> >
> > It seems that cmake doesn't like PATHS starting with two slashes:
> > //bin. One coming from CMAKE_INSTALL_PREFIX and the other from
> > INSTALL_TARGET(/bin ...)
> > Am I doing something wrong here? I seems to work with cmake-2.3.4 though.


More information about the CMake mailing list