[Cmake] Runtime search paths under Unix

Amitha Perera perera at cs.rpi.edu
Wed Jun 6 01:11:38 EDT 2001


CMake currently does not include the runtime search paths when
generating an executable from a shared library build. I have a small
patch that corrects this. If no-one objects, I'll commit the change.

The solution is to generate a "-R..." every time a "-L..." is
generated, where the -R is in the variable CMAKE_RUNTIME_FLAG, and
could be "-R " or "-Wl,-rpath," or whatever the compiler expects. It is
set in Templates/configure. If the variable is not set, runtime paths
are not generated.

The run-time search directory = the link time search directories, so
it shouldn't cause any problems, and should automatically handle
changes in library output location.

Or perhaps there is a much better mechanism for shared libraries in
the works?

Amitha.




More information about the CMake mailing list