1CMP0023 2------- 3 4Plain and keyword :command:`target_link_libraries` signatures cannot be mixed. 5 6CMake 2.8.12 introduced the :command:`target_link_libraries` signature using 7the ``PUBLIC``, ``PRIVATE``, and ``INTERFACE`` keywords to generalize the 8``LINK_PUBLIC`` and ``LINK_PRIVATE`` keywords introduced in CMake 2.8.7. 9Use of signatures with any of these keywords sets the link interface of a 10target explicitly, even if empty. This produces confusing behavior 11when used in combination with the historical behavior of the plain 12:command:`target_link_libraries` signature. For example, consider the code: 13 14:: 15 16 target_link_libraries(mylib A) 17 target_link_libraries(mylib PRIVATE B) 18 19After the first line the link interface has not been set explicitly so 20CMake would use the link implementation, A, as the link interface. 21However, the second line sets the link interface to empty. In order 22to avoid this subtle behavior CMake now prefers to disallow mixing the 23plain and keyword signatures of :command:`target_link_libraries` for a single 24target. 25 26The ``OLD`` behavior for this policy is to allow keyword and plain 27:command:`target_link_libraries` signatures to be mixed. The ``NEW`` behavior for 28this policy is to not to allow mixing of the keyword and plain 29signatures. 30 31This policy was introduced in CMake version 2.8.12. 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