[Cmake] "Automatic" LINK_DIRECTORIES under Unix

Amitha Perera perera at cs.rpi.edu
Sat Jun 16 00:24:30 EDT 2001


I'd like to modify the Unix makefile generation to do the following:
on a LINK_LIBRARIES(abc) command, if CMake knows about abc, then the
path to abc is implicitly added to the link directories. This means
that, using a vxl example,
  LINK_DIRECTORIES( ${allvxl_BINARY_DIR}/vxl/vnl )
  LINK_LIBRARIES( vnl )
would simply become
  LINK_LIBRARIES( vnl )

It has the added benefit of not hardcoding the location of libraries,
which means that LIBRARY_OUTPUT_PATH can be used effectively. For all
the libraries that CMake knows about, it will supply the appropriate
search directories.

Any glaring problem that I don't see, especially with linking against
external libraries? Will this break anything in vtk/itk?

Thanks,
Amitha.




More information about the CMake mailing list