Am Sonntag, 4. März 2012, 12:55:40 schrieb Kevin Nathan:
> On Sun, 04 Mar 2012 19:50:50 +0100
>
> Rolf Eike Beer <[email protected]> wrote:
> >Am Sonntag, 4. März 2012, 11:28:47 schrieb Kevin Nathan:
> >> ...doing an out-of-source build, my 'old-common' library (which will
> >> eventually be phased out) ends up in ./build/old-common but the
> >> source for prog2 and prog3 all look for it in ./old-common.
> >
> >target_link_libraries(prog2 old-common)
> >target_link_libraries(prog3 old-common)
>
> Thanks, Eike! That's what I was doing, so your suggestion told me I
> hadn't messed up there and I went looking for the problem a little
> deeper. That's when I found that in the "link_directories" command, in
> two of the CMakeLists.txt files, was pointing to an old dir (from the
> old code) and I hadn't updated it to use the "old-common" dir. (The
> curse of copy/paste when you aren't sure of what you're doing!) Now,
> it's working -- thanks, again!

Remove it altogether. Link_directories() is never needed when linking to a
target built in the same CMake project. You must only make sure that the
library is built before the executables.

Eike

Attachment: signature.asc
Description: This is a digitally signed message part.

--

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