Robert Dailey wrote:
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'd like to take is where we only have two projects:

...

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.


thank goodness! someone else!

I'm currently dealing with the same issue for a large number of reasons

* clutters IDEs
* tests add long compile / link time
* some developers interested in TDD (test-driven development)
* etc

The solution the CMake project itself uses is sub-projects. Since we'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.

I'm currently in mid-development, so this hasn't merged back to trunk yet. 
Otherwise I'd have a link to the source for you (Second Life is open source). 
The current good but project-cluttering solution is here:
http://svn.secondlife.com/trac/linden/browser/trunk/indra/cmake/LLAddBuildTest.cmake

(the new stuff will be in the same file)

I'm *really* interested in hearing what you wind up doing!

+ poppy
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to