[CMake] How not to copy a link

David Cole david.cole at kitware.com
Fri Jan 6 13:45:37 EST 2012


Have you considered setting the VERSION and SOVERSION target
properties on your libraries instead of doing the symlinks yourself?
CMake will build and install the symlinks automatically for you on
platforms where they are supported if you set these target properties.

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:SOVERSION
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:VERSION

(Or was that just an example, and you need to do this with other
symlink files that are not simply the version symlinks for a
library...?)


HTH,
David


On Fri, Jan 6, 2012 at 11:30 AM, Kevin Burge <kevin.burge at systemware.com> wrote:
> I'm trying to copy a file that is a link to another file, but I want the
> file to be copied, not the link itself.  Historically, I've resorted to
> putting the real file as the source, and then using RENAME to rename the
> file, which puts more detail into my install commands than I'd like.
>
> Example:
>
> where libfoo.so.1.0 -> libfoo.so.1.0.8:
>
> i.e. instead of:
>
> install (FILES libfoo.so.1.0.8 DESTINATION lib RENAME libfoo.so.1.0)
>
> I'd like to just do:
>
> install (FILES libfoo.so.1.0 DESTINATION lib)
>
> I've had little success search the cmake source and documentation and
> google.
>
> Thanks,
> Kevin
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list