AUTOGEN_TARGET_DEPENDS.rst 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. AUTOGEN_TARGET_DEPENDS
  2. ----------------------
  3. Target dependencies of the corresponding ``_autogen`` target.
  4. Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property
  5. ``ON`` have a corresponding ``_autogen`` target which is used to auto generate
  6. ``moc`` and ``uic`` files. As this ``_autogen`` target is created at
  7. generate-time, it is not possible to define dependencies of it,
  8. such as to create inputs for the ``moc`` or ``uic`` executable.
  9. The :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set instead to a
  10. list of dependencies of the ``_autogen`` target. Dependencies can be target
  11. names or file names.
  12. See the :manual:`cmake-qt(7)` manual for more information on using CMake
  13. with Qt.
  14. Use cases
  15. ^^^^^^^^^
  16. If :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` depends on a file that is either
  17. - a :prop_sf:`GENERATED` non C++ file (e.g. a :prop_sf:`GENERATED` ``.json``
  18. or ``.ui`` file) or
  19. - a :prop_sf:`GENERATED` C++ file that isn't recognized by :prop_tgt:`AUTOMOC`
  20. and :prop_tgt:`AUTOUIC` because it's skipped by :prop_sf:`SKIP_AUTOMOC`,
  21. :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071` or
  22. - a file that isn't in the target's sources
  23. it must added to :prop_tgt:`AUTOGEN_TARGET_DEPENDS`.