Compilation time is only multiplied if you are specifying the same source file in multiple targets. If you are seeing a 2x difference, then you must have *all* of your source files listed twice. Shouldn't this only be for a few of your source files at most?
<br><br><div>I would argue that it&#39;s better to be correct, if a bit slower, than it is to have a chance of being subtly incorrect and wasting hours figuring out the subtlety. I bet you have never spent hours or days figuring out that you should not have been re-using an .obj file, but should have recompiled it with the flags to match the rest of the library. I have, so I appreciate CMake&#39;s default choice in this case.
<br><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><span class="gmail_quote">On 12/19/07, <b class="gmail_sendername">Joël Schaerer</b> &lt;<a href="mailto:Joel.Schaerer@insa-lyon.fr">
Joel.Schaerer@insa-lyon.fr</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Quoting David Cole &lt;<a href="mailto:david.cole@kitware.com">
david.cole@kitware.com</a>&gt;:<br><br>&gt; One other very good reason, too:<br>&gt; Same target may have two source files of the exact same name, but they exist<br>&gt; in different directories (Abc/Object.cxx and Def/Object.cxx). In that case,
<br>&gt; the object files will be further hidden in subdirectories to avoid two files<br>&gt; in the &quot;object files directory&quot; from having a name collision.<br><br>Does that really justify multiplying compilation time by 2 or more?
<br>Who would want multiple files with the same name in the same project<br>anyways? Plus, you could very well create a tree structure in the<br>build directory.<br><br>I must be missing something but I really don&#39;t get how compiling
<br>things multiple times for nothing could seem acceptable.<br><br>&gt;<br>&gt;<br>&gt; On 12/19/07, Alexander Neundorf &lt;<a href="mailto:a.neundorf-work@gmx.net">a.neundorf-work@gmx.net</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; On Wednesday 19 December 2007, you wrote:
<br>&gt;&gt; ...<br>&gt;&gt; &gt; Yeah, you could even create one static library per executable...<br>&gt;&gt; &gt; Awesome! What was the problem with putting all the object files in the<br>&gt;&gt; &gt; same directory, again? Shouldn&#39;t that be an option, at least? It would
<br>&gt;&gt; &gt; be SO much easier than all the dirty hacks I&#39;m being proposed...<br>&gt;&gt;<br>&gt;&gt; Different targets may be compiled with different compiler flags, defines,<br>&gt;&gt; etc.<br>&gt;&gt; So the object files for the same source files can differ. This is used in
<br>&gt;&gt; some projects.<br>&gt;&gt;<br>&gt;&gt; Alex<br>&gt;&gt; _______________________________________________<br>&gt;&gt; CMake mailing list<br>&gt;&gt; <a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>&gt;&gt; 
<a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br>&gt;&gt;<br>&gt;<br><br><br><br></blockquote></div><br>&nbsp;</div>