Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qt_generate_moc.qdoc
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qt-generate-moc.html
6\ingroup cmake-commands-qtcore
7
8\title qt_generate_moc
9\keyword qt6_generate_moc
10
11\summary {Calls moc on an input file.}
12
13\include cmake-find-package-core.qdocinc
14
15\cmakecommandsince 5.0
16
17\section1 Synopsis
18
19\badcode
20qt_generate_moc(src_file dest_file
21 [TARGET target])
22\endcode
23
24\versionlessCMakeCommandsNote qt6_generate_moc()
25
26\section1 Description
27
28Creates a rule to call the \l{moc}{Meta-Object Compiler (moc)} on \c src_file
29and store the output in \c dest_file.
30
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
34path for you.
35
36\section1 Arguments
37
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}.
41
42\section1 Examples
43
44\snippet cmake-macros/examples.cmake qt_generate_moc
45*/