GENERATED.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. GENERATED
  2. ---------
  3. Is this source file generated as part of the build or CMake process.
  4. Tells the internal CMake engine that a source file is generated by an outside
  5. process such as another build step, or the execution of CMake itself.
  6. This information is then used to exempt the file from any existence or
  7. validity checks.
  8. Any file that is
  9. - created by the execution of commands such as
  10. :command:`add_custom_command` and :command:`file(GENERATE)`
  11. - listed as one of the ``BYPRODUCTS`` of an :command:`add_custom_command`
  12. or :command:`add_custom_target` command, or
  13. - created by a CMake ``AUTOGEN`` operation such as :prop_tgt:`AUTOMOC`,
  14. :prop_tgt:`AUTORCC`, or :prop_tgt:`AUTOUIC`
  15. will be marked with the ``GENERATED`` property.
  16. When a generated file created as the ``OUTPUT`` of an
  17. :command:`add_custom_command` command is explicitly listed as a source file
  18. for any target in the same directory scope (which usually means the same
  19. ``CMakeLists.txt`` file), CMake will automatically create a dependency to
  20. make sure the file is generated before building that target.
  21. The :ref:`Makefile Generators` will remove ``GENERATED`` files during
  22. ``make clean``.
  23. Generated sources may be hidden in some IDE tools, while in others they might
  24. be shown. For the special case of sources generated by CMake's :prop_tgt:`AUTOMOC`
  25. or :prop_tgt:`AUTORCC` functionality, the :prop_gbl:`AUTOGEN_SOURCE_GROUP`,
  26. :prop_gbl:`AUTOMOC_SOURCE_GROUP` and :prop_gbl:`AUTORCC_SOURCE_GROUP` target
  27. properties may influence where the generated sources are grouped in the project's
  28. file lists.