<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<link href="chrome://translator/skin/floatingPanel.css"
type="text/css" rel="stylesheet">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 30-Apr-13 08:40, Rolf Eike Beer
wrote:<br>
</div>
<blockquote cite="mid:3823346.LiFpFMZ1Qv@eto" type="cite">
<pre wrap="">Haroogan wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On 29-Apr-13 23:27, Alexander Neundorf wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Monday 29 April 2013, Haroogan wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Have a look at my post on StackOverflow
<a class="moz-txt-link-rfc2396E" href="http://stackoverflow.com/questions/16286872/cmake-automoc-feature-skips-"><http://stackoverflow.com/questions/16286872/cmake-automoc-feature-skips-></a> >> so
urces-of-executable-targets> for details.
<a class="moz-txt-link-rfc2396E" href="http://stackoverflow.com/questions/16286872/cmake-automoc-feature-skips-"><http://stackoverflow.com/questions/16286872/cmake-automoc-feature-skips-></a> >> so
urces-of-executable-targets>
</pre>
</blockquote>
<pre wrap="">
can you please create a small testcase and post it here, or create an
entry on <a class="moz-txt-link-freetext" href="http://public.kitware.com/Bug">http://public.kitware.com/Bug</a> and attach it there ?
It should work.
</pre>
</blockquote>
</blockquote>
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">I've found the cause, and I think that's very confusing behavior. I'll
try to do my best explaining it.
Let's begin with top 'CMakeLists.txt':
...
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
...
# NOTE: Order matters (the most independent ones go first)
# because some libraries expose variables through cache (see below).
add_subdirectory(components/B)
add_subdirectory(components/A)
add_subdirectory(components/Executable)
So imagine that we have the 'FindMyPrecious.cmake' custom CMake module
to locate 3rd party framework "MyPrecious":
find_package(Qt4
4.7.4
COMPONENTS QtCore
QtGui
QtXml
REQUIRED)
find_path(MyPrecious_INCLUDE_DIR...)
find_library(MyPrecious_LIBRARY_DEBUG...)
find_library(MyPrecious_LIBRARY_RELEASE...)
set(QT_DEFINITIONS ${QT_DEFINITIONS}
-DQT_CORE_LIB
-DQT_GUI_LIB
-DQT_XML_LIB)
if (CMAKE_BUILD_TYPE MATCHES [Dd][Ee][Bb][Uu][Gg])
set(QT_DEFINITIONS ${QT_DEFINITIONS}
-DQT_DEBUG)
else ()
set(QT_DEFINITIONS ${QT_DEFINITIONS}
-DQT_NO_DEBUG)
endif ()
set(MyPrecious_DEFINITIONS ${QT_DEFINITIONS})
set(MyPrecious_INCLUDE_DIRS ${MyPrecious_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${QT_QTCORE_INCLUDE_DIR}
${QT_QTGUI_INCLUDE_DIR}
${QT_QTXML_INCLUDE_DIR})
set(MyPrecious_LIBRARY debug ${MyPrecious_LIBRARY_DEBUG}
optimized ${MyPrecious_LIBRARY_RELEASE})
</pre>
</blockquote>
<pre wrap="">
cmake --help-module SelectLibraryConfigurations
</pre>
<blockquote type="cite">
<pre wrap=""># -------------------------------
# ATTENTION: Theoretically, I don't have to add the line below.
# -------------------------------
# find_package(MyPrecious REQUIRED)
</pre>
</blockquote>
<pre wrap="">
You have to. If you don't the non-cached variables like QT_VERSION* are not
present in this scope. No Qt, no automoc. And everything else may only work by
pure luck.
Also you should read the warning about file(GLOB) in the documentation.
Eike
-- </pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">--
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the CMake FAQ at: <a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></pre>
</blockquote>
Thank you for clarifying this. What would you recommend? Shall I
find Qt explicitly or implicitly (like with "MyPrecious") in every
subproject, and not rely on transitive dependency technique all at
once? What is sort of the best practice?<br>
<br>
Concerning GLOB, yes, I'm aware of that, but to be honest this
warning doesn't make sense at all since:<br>
<ol>
<li>I think it is evident to everyone that CMake can capture those
files only during the configuration/generation stage;</li>
<li>What's the point of recommending against it? Either one adds
sources by hand or one does it with GLOB - one has to rerun
CMake anyway. However, with GLOB one doesn't have to add sources
manually.</li>
</ol>
<p><br>
</p>
<div style="bottom: auto; left: 707px; right: auto; top: 676px;
display: none;" class="translator-theme-default"
id="translator-floating-panel">
<div title="Click to translate"
id="translator-floating-panel-button"></div>
</div>
</body>
</html>