I am exhausted by this problem... I have spend several days on it.
I use target_link_libraries link A with B and C
target_link_libraries(A rootdir/B.lib rootdir/C.lib)
while B need some other files in E and F directory, I use
link_directories(rootdir/E rootdir/F)
to include the directory E and F, but using make VERBOSE=1 I found although cmake add -i before the E and F and passed them to the link, it also add some extra flags such as
-Wl,-rpath, rootdir/E:rootdir/F:
where does these extra parameters come from? How can I fix this problem? I will be grateful for any help! Thanks!