Discussion:
[CMake] cmake 2.2: make install PREFIX not working with CMAKE_INSTALL_PREFIX set to "/"
Michael Biebl
2006-04-10 20:51:51 UTC
Permalink
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.

Cheers,
Michael
Michael Biebl
2006-04-10 20:53:21 UTC
Permalink
I forgot to add:
Removing
SET(CMAKE_INSTALL_PREFIX / CACHE INTERNAL "")
and running
cmake .. -DCMAKE_INSTALL_PREFIX=/
works fine.
Post by Michael Biebl
With cmake 2.2 I get a very strange behaviour.
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
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
//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.
Cheers,
Michael
Michael Biebl
2006-04-10 21:16:28 UTC
Permalink
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
Post by Michael Biebl
Removing
SET(CMAKE_INSTALL_PREFIX / CACHE INTERNAL "")
and running
cmake .. -DCMAKE_INSTALL_PREFIX=/
works fine.
Post by Michael Biebl
With cmake 2.2 I get a very strange behaviour.
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
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
//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.
Michael Biebl
2006-04-11 00:01:42 UTC
Permalink
Post by Michael Biebl
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
I guess I found the reason for that behaviour. These install rules are
used in a CMakeLists.txt file in a subdirectory. I had
SET(CMAKE_INSTALL_PREFIX "" CACHE INTERNAL "") placed
after the SUBDIRS macro in the toplevel CMakeLists.txt file. After
switching the location of these two macros, the installation paths
seem to be correct now.

Loading...