[CMake] Installing shared libs with symlinks

Martin Apel martin.apel at simpack.de
Wed Dec 10 04:04:39 EST 2008


Hi there,

I am trying to install the boost libraries my software needs into the
target installation directory as follows:

Find_Package(Boost 1.34.1 COMPONENTS filesystem system signals
program_options REQUIRED)
FOREACH (Lib ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${Boost_SIGNALS_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
  INSTALL(PROGRAMS ${Lib} DESTINATION run/bin)
ENDFOREACH (Lib ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${Boost_SIGNALS_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})

The variables returned from FindBoost contain symlinks to the real
libraries, e.g.
  libboost_system-gcc43-mt-1_35.so ->
libboost_system-gcc43-mt-1_35.so.1.35.0

When installing these the files in the destination directory are
symlinks again, which is not what I want. I tried using
    GET_FILENAME_COMPONENT(LibWithoutSymLink ${Lib} ABSOLUTE)
in the above loop, but this does not help, the returned path still does
not contain the resolved name. This looks to me like a bug in the
implementation
of GET_FILENAME_COMPONENT. Is there any recommended way to install
referenced libraries including resolving any symlinks?

Regards,

Martin

____________
Virus checked by G DATA AntiVirus
Version: AVF 19.180 from 09.12.2008




More information about the CMake mailing list