[CMake] Problems with cmake, visualstudio generator and add_library / target_link_libraries

Bill Hoffman bill.hoffman at kitware.com
Wed Sep 24 09:35:37 EDT 2008


Thomas Veith wrote:
> Hi Bill,
> 
> Thanks a lot!
> 
> I did
> 
> add_executable(foo foo.cpp)
> add_dependencies(foo socket)
> 
> and wasnt aware that I also need
> 
> target_link_libraries(foo socket)
> 
> Now it works!
> 

Actually, you don't need that add_dependencies call either.  That is 
only needed to force something to build before something else that it 
does not link to.

-Bill


More information about the CMake mailing list