[CMake] Dynamic linking doesn't work after install

David Doria daviddoria at gmail.com
Fri Apr 22 09:48:59 EDT 2011


I have created an executable like this:

  add_executable(ImageCompleter ${AppSources})
  target_link_libraries(ImageCompleter ${LibrariesAlwaysUsed})

  INSTALL( TARGETS ImageCompleter
    RUNTIME DESTINATION ${INSTALL_DIR} )

When I run the one that is created with 'make', it works fine.
However, when I run the one that is copied by 'make install' I get:

error while loading shared libraries: I get
libwx_gtk2u_core-2.9.so.1: cannot open shared object file: No such
file or directory

It looks like this problem:
http://www.cmake.org/pipermail/cmake/2010-July/038213.html
but that link doesn't offer a solution.

When I install it says
-- Installing: /home/doriad/bin/Research/ImageCompleter
-- Removed runtime path from "/home/doriad/bin/Research/ImageCompleter"

I'm assuming that "removed runtime path" is the problem? How do I stop
that from happening?

Thanks,

David


More information about the CMake mailing list