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