[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 20:01:42 EDT 2006
On 4/10/06, Michael Biebl <mbiebl at gmail.com> wrote:
> 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.
More information about the CMake
mailing list