I have a situation where there exists on some systems a library
(/lib/librt.so.1) that conflicts with the name we use for BRL-CAD's
raytracing library (also librt).  For various reasons, I can't rename
our lib - this means I have to deal with the situation where there
exists a system library with the correct name but incorrect contents.

Generally, we install into directories with a prefix (e.g.
/usr/brlcad) to avoid stomping over system libs.  However, when it
comes to defining target_link_libraries lines for our executables, I
end up with something like:

add_executable(rt ${rt_SRCS})
target_link_libraries(rt librt)

This works splendidly, particularly combined with the RPATH settings
that let me run the executables both in the build and install
locations without jumping through hoops.  However, the linker
(justifiably) is confused by the presence of the system librt file
when it is present.

Is there a way to specify my local librt to the target_link_libraries
command in such a way that avoids any chance of picking up the system
librt, but still preserves the nice properties of running executables
both in build and install directories cleanly?

Thanks for any help,
CY
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to