Description | When a library is specified as a full path in a cache entry then CMake should setup the build system to make sure that exact library is found. Currently the library path "/path/to/libfoo.a" is split into the options "-L/path/to -lfoo" when passed to the linker. If an earlier-listed -L path has a different foo library or there are two foo libraries in the same directory then the linker might choose the wrong one.
We need to investigate what happens if the full path to the library is given to the linker. Alternatively, a special directory could be created in the build tree that is listed first in the -L paths. This directory would contain symbolic links to the correct locations for all the libraries to be linked. Then the linker would hopefully always find the correct library.
We would probably have to have one such special directory per library target. Perhaps it could be combined with the directory that contains all the .o files for that target if we ever implement the one-object-per-source-per-target functionality. |