AUTOMOC_COMPILER_PREDEFINES.rst 1016 B

123456789101112131415161718192021222324
  1. AUTOMOC_COMPILER_PREDEFINES
  2. ---------------------------
  3. Boolean value used by :prop_tgt:`AUTOMOC` to determine if the
  4. compiler pre definitions file ``moc_predefs.h`` should be generated.
  5. CMake generates a ``moc_predefs.h`` file with compiler pre definitions
  6. from the output of the command defined in
  7. :variable:`CMAKE_CXX_COMPILER_PREDEFINES_COMMAND <CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND>`
  8. when
  9. - :prop_tgt:`AUTOMOC` is enabled,
  10. - :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` is enabled,
  11. - :variable:`CMAKE_CXX_COMPILER_PREDEFINES_COMMAND <CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND>` isn't empty and
  12. - the Qt version is greater or equal 5.8.
  13. The ``moc_predefs.h`` file, which is generated in :prop_tgt:`AUTOGEN_BUILD_DIR`,
  14. is passed to ``moc`` as the argument to the ``--include`` option.
  15. By default :prop_tgt:`AUTOMOC_COMPILER_PREDEFINES` is initialized from
  16. :variable:`CMAKE_AUTOMOC_COMPILER_PREDEFINES`, which is ON by default.
  17. See the :manual:`cmake-qt(7)` manual for more information on using CMake
  18. with Qt.