CMP0008.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. CMP0008
  2. -------
  3. Libraries linked by full-path must have a valid library file name.
  4. In CMake 2.4 and below it is possible to write code like
  5. ::
  6. target_link_libraries(myexe /full/path/to/somelib)
  7. where ``somelib`` is supposed to be a valid library file name such as
  8. ``libsomelib.a`` or ``somelib.lib``. For Makefile generators this
  9. produces an error at build time because the dependency on the full
  10. path cannot be found. For :ref:`Visual Studio Generators` IDE
  11. and :generator:`Xcode` generators this used to
  12. work by accident because CMake would always split off the library
  13. directory and ask the linker to search for the library by name
  14. (``-lsomelib`` or ``somelib.lib``). Despite the failure with Makefiles, some
  15. projects have code like this and build only with Visual Studio and/or Xcode.
  16. This version of CMake prefers to pass the full path directly to the
  17. native build tool, which will fail in this case because it does not
  18. name a valid library file.
  19. This policy determines what to do with full paths that do not appear
  20. to name a valid library file. The ``OLD`` behavior for this policy is to
  21. split the library name from the path and ask the linker to search for
  22. it. The ``NEW`` behavior for this policy is to trust the given path and
  23. pass it directly to the native build tool unchanged.
  24. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.1
  25. .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
  26. .. include:: STANDARD_ADVICE.txt
  27. .. include:: DEPRECATED.txt