1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5\page qt-generate-moc.html
6\ingroup cmake-commands-qtcore
9\keyword qt6_generate_moc
11\summary {Calls moc on an input file.}
13\include cmake-find-package-core.qdocinc
20qt_generate_moc(src_file dest_file
24\versionlessCMakeCommandsNote qt6_generate_moc()
28Creates a rule to call the \l{moc}{Meta-Object Compiler (moc)} on \c src_file
29and store the output in \c dest_file.
31\note This is a low-level macro. See the \l{CMake AUTOMOC Documentation} for a
32more convenient way to let source files be processed with \c{moc}.
33\l qt_wrap_cpp is also similar, but automatically generates a temporary file
38You can set an explicit \c{TARGET}. This will make sure that the target
39properties \c{INCLUDE_DIRECTORIES} and \c{COMPILE_DEFINITIONS} are also used
40when scanning the source files with \c{moc}.
44\snippet cmake-macros/examples.cmake qt_generate_moc