link_libraries.rst 650 B

12345678910111213141516171819
  1. link_libraries
  2. --------------
  3. Link libraries to all targets added later.
  4. ::
  5. link_libraries([item1 [item2 [...]]]
  6. [[debug|optimized|general] <item>] ...)
  7. Specify libraries or flags to use when linking any targets created later in
  8. the current directory or below by commands such as :command:`add_executable`
  9. or :command:`add_library`. See the :command:`target_link_libraries` command
  10. for meaning of arguments.
  11. .. note::
  12. The :command:`target_link_libraries` command should be preferred whenever
  13. possible. Library dependencies are chained automatically, so directory-wide
  14. specification of link libraries is rarely needed.