AUTOGEN_TARGET_DEPENDS.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. AUTOGEN_TARGET_DEPENDS
  2. ----------------------
  3. Additional 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 generates
  6. ``moc`` and ``uic`` files. As this ``_autogen`` target is created at
  7. generate-time, it is not possible to define dependencies of it using
  8. e.g. :command:`add_dependencies`. Instead the
  9. :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set to a
  10. :ref:`;-list <CMake Language Lists>` of additional dependencies for the
  11. ``_autogen`` target. Dependencies can be target names or file names.
  12. In total the dependencies of the ``_autogen`` target are composed from
  13. - forwarded origin target dependencies
  14. (enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`)
  15. - additional user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS`
  16. See the :manual:`cmake-qt(7)` manual for more information on using CMake
  17. with Qt.
  18. Use cases
  19. ^^^^^^^^^
  20. If :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` depends on a file that is either
  21. - a :prop_sf:`GENERATED` non C++ file (e.g. a :prop_sf:`GENERATED` ``.json``
  22. or ``.ui`` file) or
  23. - a :prop_sf:`GENERATED` C++ file that isn't recognized by :prop_tgt:`AUTOMOC`
  24. and :prop_tgt:`AUTOUIC` because it's skipped by :prop_sf:`SKIP_AUTOMOC`,
  25. :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071` or
  26. - a file that isn't in the origin target's sources
  27. it must added to :prop_tgt:`AUTOGEN_TARGET_DEPENDS`.