[CMake] FILE(INSTALL does not follow symbolic links

Nicolas Desprès nicolas.despres at gmail.com
Thu Oct 2 10:36:13 EDT 2008


Hi there,

I'm using cmake 2.6.2 and I'm using FILE(INSTALL ...) to install
dependent dynamic libraries in script called by INSTALL(SCRIPT ...).

Here my scenario:

$ cd /tmp/test
$ ls -l
total 4.0K
lrwxrwxrwx 1 despres despres 11 Oct  2 16:25 libfoo.so -> libfoo.so.1
-rw-r--r-- 1 despres despres  0 Oct  2 16:25 libfoo.so.1
-rw-r--r-- 1 despres despres 67 Oct  2 16:25 test.cmake
$ cat test.cmake
file(INSTALL DESTINATION /tmp/install TYPE FILE FILES ./libfoo.so)
$ cmake -P test.cmake
-- Installing: /tmp/install/libfoo.so
$ ls -l /tmp/install
total 0
lrwxrwxrwx 1 despres despres 11 Oct  2 16:26 libfoo.so -> libfoo.so.1
$

I have read the source of the file command in cmFileCommand.cxx
(because the subcommand INSTALL is not documented in --help-command
file), but I couldn't find a way to tell the FILE(INSTALL command to
follow symbolic links.

Of course I could do the copy by hand using cmake -E copy but I would
like to have a consistent output with the -- Installing: .... printed
by cmake and the -- Up-to-date stuff.

As a workaround, how can I write a cmake script that retrieve the name
of the file pointed by a symbolic link?

-- 
Nicolas Desprès


More information about the CMake mailing list