[cmake-developers] link_libraries command (was: Roadmap to CMake 3.0)

Brad King brad.king at kitware.com
Fri Oct 11 15:59:13 EDT 2013


On 10/11/2013 03:34 PM, Rolf Eike Beer wrote:
> Can we do something against link_directories, please? This is a common pitfall 
> for everyone coming from plain Makefiles and probably other people, too.

I'd love to do so but the command still has a real purpose.
Find modules can return MYPKG_LIBRARY_DIRS with a list of
directories and MYPKG_LIBRARIES with a list of libraries by
name rather than full path.  The only way to use these is

 find_package(MYPKG)
 link_directories(${MYPKG_LIBRARY_DIRS})
 target_link_libraries(myexe ${MYPKG_LIBRARIES})

-Brad



More information about the cmake-developers mailing list