[CMake] Generated library location

Andreas Pakulat apaku at gmx.de
Sun Mar 4 16:15:52 EST 2012


On 04.03.12 13:36:57, Kevin Nathan wrote:
> On Sun, 04 Mar 2012 21:30:21 +0100
> Rolf Eike Beer <eike at sf-mail.de> wrote:
> 
> >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.
> >
> 
> I need it, though, for additional libs (KDE, Qt, MySQL, etc.) but I
> will keep that in mind for some of my other projects that I am
> converting to CMake... 

No, for those three at least you also don't need link_directories. The
find-modules for all 3 provide the absolute paths to the libraries in
CMake variables which you can use with target_link_libraries directly
and it'll just work. 

Andreas



More information about the CMake mailing list