<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Am 21.10.2016 um 13:39 schrieb Alan W.
Irwin:<br>
</div>
<blockquote
cite="mid:alpine.DEB.2.11.1610210256020.1243@enira.zlyna.ubzr"
type="cite">On 2016-10-21 09:42+0200 Sebastian Holtermann wrote:
<br>
<blockquote type="cite">headers-to-moc to the sources list.
<br>
- add_executable(helloworld main.cpp)
<br>
+ add_executable(helloworld main.cpp
<br>
+ ${CMAKE_SOURCE_DIR}/include/test_q_object.h)
<br>
<br>
The #include "moc_test_q_object.cpp" in main.cpp can be removed
then.
<br>
</blockquote>
<br>
1. The automoc documentation at
<br>
<a class="moz-txt-link-rfc2396E" href="https://cmake.org/cmake/help/v3.6/prop_tgt/AUTOMOC.html"><https://cmake.org/cmake/help/v3.6/prop_tgt/AUTOMOC.html></a>
only
<br>
documents the #include method (which doesn't work for the current
test
<br>
case nor for PLplot), and the above working fullpath method is not
<br>
documented at all there.
<br>
</blockquote>
<br>
At least in cmake-qt(7) [1] this is documented:<br>
<br>
If a <code class="docutils literal"><span class="pre">Q_OBJECT</span></code>
or <code class="docutils literal"><span class="pre">Q_GADGET</span></code>
macro is found in a header file, <code class="docutils literal"><span
class="pre">moc</span></code> will be run on the file. The
result will be put into a file named according to <code
class="docutils literal"><span class="pre">moc_<basename>.cpp</span></code>.
If the macro is found in a C++ implementation file, the moc output
will be put into a file named according to <code class="docutils
literal"><span class="pre"><basename>.moc</span></code>,
following the Qt conventions. The <code class="docutils literal"><span
class="pre">moc</span> <span class="pre">file</span></code> may
be included by the user in the C++ implementation file with a
preprocessor <code class="docutils literal"><span class="pre">#include</span></code>.
If it is not so included, it will be added to a separate file which
is compiled into the target.<br>
<br>
<br>
Marc<br>
<br>
<br>
[1] <a class="moz-txt-link-freetext"
href="https://cmake.org/cmake/help/v3.6/manual/cmake-qt.7.html#automoc">https://cmake.org/cmake/help/v3.6/manual/cmake-qt.7.html#automoc</a><br>
<br>
<br>
</body>
</html>