[CMake] make install renders my executable un-runnable

Chris Stankevitz chrisstankevitz at gmail.com
Fri Jul 26 20:30:35 EDT 2013


Hello,

I am looking into the following problem and will report back when I
find the solution.

I use linux with the XFCE window manager.  This window manager (and
many others) supports what are called ".desktop" files.  These files
are created on your hard drive when you "create a launcher" on your
desktop (or anywhere else) to start an application.  They are very
popular and form the foundation of the various "start menus" used in
different linux UIs.

Consider that foo exists in two places:
/home/user/build/foo
/usr/local/bin/foo

The first is the cmake build directory.  The second is where cmake installed.

FYI: diff /usr/local/bin/foo home/user/build/foo reports differences.
This is weird to me, but I will try to ignore for the time being
(perhaps the result of a strip).

You can "launch" a .desktop file by double-clicking it.  An alternate
way to launch is to open a terminal and issue the command "xdg-open
foo.desktop"

Consider these two .desktop files:

foo-build.desktop
foo-bin.desktop

These two files are configured to launch either the foo executable in
the build directory or the one installed to /usr/local/bin.

Consider these results:

a) xdg-open foo-build.desktop -- this works

b) xdg-open foo-bin.desktop -- this works

c) double-click foo-build.desktop -- this works

d) double-click foo-bin.desktop -- this fails

I am trying to understand why (d) fails.  If you have hints, please
comment.  Otherwise I hope to figure it out by studying
cmake_install.cmake

Thank you,

Chris


PS: I think it is related to the operation "remove run time path" that
is performed by cmake_install.cmake


More information about the CMake mailing list