[CMake] Testing shared library

William A. Hoffman billlist at nycap.rr.com
Tue Jul 25 14:56:12 EDT 2006


At 02:19 PM 7/25/2006, Flávio P. Duarte wrote:
>It looks like CMake is prependind LD_LIBRARY_PATH before ../src and in
>LD_LIBRARY_PATH there is an older version of mylib.
>The CMake command line looks like:
>/usr/bin/c++   -g -Wall   -fPIC -L/home/user/lib/
>"CMakeFiles/test1.dir/obj1.o" "CMakeFiles/test1.dir/obj2.o"   -o test1
>-rdynamic -L/home/user/test/src
> I think the first -L is being added to CMake to correspond to
>LD_LIBRARY_PATH environment variable. The easiest solution would be get
>rid of LD_LIBRARY_PATH, but I consider it as a last option. And if the
>first -L corresponds to LD_LIBRARY_PATH, it might be a bug. People will
>not be able to test their libraries without changing this variable first.
>        As an alternative, I thought change the command line, but I open to
>suggestions.
>
>Flavio

CMake is not looking at LD_LIBRARY_PATH.  You must be doing an in-source
build and creating a library that is being put in /home/user/test/src which
is why cmake is adding the -L.

-Bill



More information about the CMake mailing list