CMP0112.rst 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. CMP0112
  2. -------
  3. .. versionadded:: 3.19
  4. Target file component generator expressions do not add target dependencies.
  5. The following target-based generator expressions that query for directory or
  6. file name components no longer add a dependency on the evaluated target.
  7. - ``TARGET_FILE_NAME``
  8. - ``TARGET_FILE_DIR``
  9. - ``TARGET_LINKER_FILE_BASE_NAME``
  10. - ``TARGET_LINKER_FILE_NAME``
  11. - ``TARGET_LINKER_FILE_DIR``
  12. - ``TARGET_SONAME_FILE_NAME``
  13. - ``TARGET_SONAME_FILE_DIR``
  14. - ``TARGET_PDB_FILE_NAME``
  15. - ``TARGET_PDB_FILE_DIR``
  16. - ``TARGET_BUNDLE_DIR``
  17. - ``TARGET_BUNDLE_DIR_NAME``
  18. - ``TARGET_BUNDLE_CONTENT_DIR``
  19. In CMake 3.18 and lower a dependency on the evaluated target of the above
  20. generator expressions would always be added. CMake 3.19 and above prefer
  21. to not add this dependency. This policy provides compatibility for projects
  22. that have not been updated to expect the new behavior. The policy setting
  23. is recorded on each target when it is created, and decides whether generator
  24. expressions referencing that target imply a dependency on it.
  25. The ``OLD`` behavior for this policy is to add a dependency on the evaluated
  26. target for the above generator expressions. The ``NEW`` behavior of
  27. this policy is to not add a dependency on the evaluated target for the
  28. above generator expressions.
  29. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
  30. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
  31. .. include:: STANDARD_ADVICE.txt
  32. See documentation of the
  33. :variable:`CMAKE_POLICY_WARNING_CMP0112 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
  34. variable to control the warning.
  35. .. include:: DEPRECATED.txt