What do you mean when you say LIB2 depends on EXE1...?<br><br>Does EXE1 generate some code that is built into LIB2 or is it something else? Normally libs don&#39;t depend on exes in the CMake TARGET sense...<br><br><br><div>
<span class="gmail_quote">On 12/21/07, <b class="gmail_sendername">Nicolas Tisserand</b> &lt;<a href="mailto:nicolas.tisserand@gmail.com">nicolas.tisserand@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I&#39;m working on a C++ project that&#39;s been happily using CMake as a<br>cross-platform (mac/pc/linux) build tool for a year now.<br><br>We&#39;re using CMake 2.4.6 on all platforms.<br><br>Recently, some changes in our build system lead to the following
<br>dependency graph:<br><br>LIB1 &lt;- EXE1 &lt;- LIB2 &lt;- EXE2<br>&nbsp;&nbsp;^&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>&nbsp;&nbsp; `-----------------------------------&#39;<br><br>(LIB* are static libraries, and EXE* executables)<br><br>
EXE1 is a tool that generates input source files for LIB2, hence the<br>extra-dependency.<br><br>Everything works nice and smooth with the Linux / Make, MacOS X / Make<br>and WIN32 / VC80 generators.<br><br>Trouble is, on the mac, the XCODE_DEPEND_HELPER (XDH) is added to all
<br>final (executable, dynamic libraries and modules) targets by the XCode<br>generator:<br><br>&nbsp;&nbsp;.---------------------------------------<br>&nbsp;&nbsp;v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<br>LIB1 &lt;-------.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EXE1 &lt;- LIB2&nbsp;&nbsp;&lt;- EXE2<br>XDH &lt;-------&#39;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>&nbsp;&nbsp;^---------------- -----------------------&#39;<br><br>When EXE2 (or ALL_BUILD) is the active target and LIB2 needs a<br>
rebuild, the following happens:<br><br>* The XCODE_DEPEND_HELPER make command is run, doing nothing.<br>* EXE1 is left alone<br>* LIB2 gets correctly rebuilt<br>* EXE2 does not get relinked because when XCODE_DEPEND_HELPER was run,
<br>EXE2 was still up-to-date with LIB2 :-(<br><br>This is very annoying.<br><br>Here&#39;s the only sort-of workaround I could come up with:<br><br>* remove the EXE1 &lt;- LIB2 dependency, so that EXE2 gets correctly<br>
relinked when the active target is EXE2<br>* exclude EXE1 from the build (using EXCLUDE_FROM_ALL), so that EXE2<br>gets correctly relinked when the active target is ALL_BUILD<br><br>But this forces XCode users to rebuild EXE1 manually.
<br><br><br>Finally, here are my questions:<br><br>Is there a nicer solution to my problem?<br>Is this a known bug?<br>Are there any plans for fixing it?<br>Would 2.4.7 solve my problems? (I checked the ChangeLogs but did not
<br>see any mention of it)<br><br>Sorry for the bad ascii-art :-)<br>--<br>Nicolas<br>_______________________________________________<br>CMake mailing list<br><a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br><a href="http://www.cmake.org/mailman/listinfo/cmake">
http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>