[Cmake] Runtime search paths under Unix

Bill Hoffman bill.hoffman at kitware.com
Wed Jun 6 09:54:46 EDT 2001


That is the solution, and it would be a good addition.
It is however, a bit tricky which is why it has not yet been done.
As far as I know there are two ways that a run time path can be
specified:

1. $(CMAKE_RUNTIME_FLAG)Path1 $(CMAKE_RUNTIME_FLAG)Path2 
2. $(CMAKE_RUNTIME_FLAG)Path1,Path2 

So, it would require two variables.  

1. the flag to set the run time path
CMAKE_RUNTIME_FLAG : -R or -Wl,-rpath , or -Wl,+b, etc 
the Templates/configure.in already figures out a bunch of these:
# the following is an excerpt from the tcl7.5b2 configure.in
you may want to update that from a newer version of tcl.

2. a flag that tells the generator if the runtime flag takes one
or more directories at the same time.  CMAKE_RUNTIME_COMMALIST  true|false

Good luck, and thanks for the effort.

-Bill



At 01:11 AM 6/6/2001 -0400, Amitha Perera wrote:
>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