link_directories.rst 694 B

12345678910111213141516171819
  1. link_directories
  2. ----------------
  3. Specify directories in which the linker will look for libraries.
  4. ::
  5. link_directories(directory1 directory2 ...)
  6. Specify the paths in which the linker should search for libraries.
  7. The command will apply only to targets created after it is called.
  8. Relative paths given to this command are interpreted as relative to
  9. the current source directory, see :policy:`CMP0015`.
  10. Note that this command is rarely necessary. Library locations
  11. returned by :command:`find_package` and :command:`find_library` are
  12. absolute paths. Pass these absolute library file paths directly to the
  13. :command:`target_link_libraries` command. CMake will ensure the linker finds
  14. them.