[CMake] make install renders my executable un-runnable

Johannes Zarl johannes.zarl at jku.at
Mon Jul 29 05:02:53 EDT 2013


On Saturday, 27. July 2013, 02:30:35, Chris Stankevitz wrote:
> 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've basically answered that yourself in the P.S.: The binaries in your 
build directory have rpath set (so that you don't have to worry about not-yet-
installed libraries, whereas the runtime-linker should be able to find the 
libraries for installed binaries. This also means that the binaries differ.

> 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

I guess you can directly run the executable file for your program in the same 
shell from which you called xdg-open? If so, I would think that the desktop 
has a slightly different environment that your shell. I.e. you probably set 
LD_LIBRARY_PATH in your bashrc, and your desktop session doesn't have it set 
to the same value.

You should be seeing the exact error message of case d in your ~/.xsession-
errors.

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

Yes, that would also be my guess.

Cheers,
  Johannes


More information about the CMake mailing list