<div class="gmail_quote">On Wed, Apr 8, 2009 at 5:33 PM, Paul Oppenheim (Poppy Linden) <span dir="ltr">&lt;<a href="mailto:poppy@lindenlab.com">poppy@lindenlab.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Robert Dailey wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Obviously this creates a lot of clutter in the solution explorer window in Visual Studio. Is there a more recommended practice for structuring unit tests in CMake? Personal advice is also welcome. One approach I&#39;d like to take is where we only have two projects:<br>

<br>
</blockquote></div>
...<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If we include these source files in the same project, then it interrupts the whole compilation process. They have to be separate in order to work properly.<br>
<br>
</blockquote>
<br></div>
thank goodness! someone else!<br>
<br>
I&#39;m currently dealing with the same issue for a large number of reasons<br>
<br>
* clutters IDEs<br>
* tests add long compile / link time<br>
* some developers interested in TDD (test-driven development)<br>
* etc<br>
<br>
The solution the CMake project itself uses is sub-projects. Since we&#39;re only interested in unit tests at the moment, the process of adding targets and tests is quite mechanical, so I have a CMake macro that auto-generates sub-build CMakeFiles.txt files.<br>

<br>
I&#39;m currently in mid-development, so this hasn&#39;t merged back to trunk yet. Otherwise I&#39;d have a link to the source for you (Second Life is open source). The current good but project-cluttering solution is here:<br>

<a href="http://svn.secondlife.com/trac/linden/browser/trunk/indra/cmake/LLAddBuildTest.cmake" target="_blank">http://svn.secondlife.com/trac/linden/browser/trunk/indra/cmake/LLAddBuildTest.cmake</a><br>
<br>
(the new stuff will be in the same file)<br>
<br>
I&#39;m *really* interested in hearing what you wind up doing!</blockquote><div><br></div><div>Do you have unit tests that require failure to compile in order to be successful? If you do, placing these particular unit tests in a project with other tests that must compile to succeed will interrupt the process, depending on the order of compilation. </div>
</div>