CMP0008.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  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 VS IDE and Xcode generators this used to
  11. work by accident because CMake would always split off the library
  12. directory and ask the linker to search for the library by name
  13. (-lsomelib or somelib.lib). Despite the failure with Makefiles, some
  14. projects have code like this and build only with VS and/or Xcode.
  15. This version of CMake prefers to pass the full path directly to the
  16. native build tool, which will fail in this case because it does not
  17. name a valid library file.
  18. This policy determines what to do with full paths that do not appear
  19. to name a valid library file. The OLD behavior for this policy is to
  20. split the library name from the path and ask the linker to search for
  21. it. The NEW behavior for this policy is to trust the given path and
  22. pass it directly to the native build tool unchanged.
  23. This policy was introduced in CMake version 2.6.1. CMake version
  24. |release| warns when the policy is not set and uses OLD behavior. Use
  25. the cmake_policy command to set it to OLD or NEW explicitly.
  26. .. include:: DEPRECATED.txt