On Sat, May 17, 2008 at 10:28 AM, Michael Bowerman &lt;<a href="mailto:michael.bowerman@gmail.com">michael.bowerman@gmail.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
List,<br><br>I am trying to use cppunit for my automated tests.&nbsp; I have the project compiling with autotools.&nbsp; But, I am moving to cmake to build on windows (while the project is still small-ish).<br><br>So, is the proper way to look for CppUnit to use pkg_check_modules?</blockquote>
<div><br>Only if CppUnit is only meant to work only with the GCC compiler or you will only ever use the GCC compiler.&nbsp; If there is a chance you&#39;ll want to compile your code with MSVC or some other compiler or you wish to contribute your find modules back to CMake you should consider using the find_library() and find_path() commands to locate the cppunit header files and library.<br>
<br>This is usually fairly simple to do and most people encapsulate this activity in a Find* macro.&nbsp; Looks like someone has already done some work to make a FindCppUnit macro but it never got cleaned up and checked into CMake.<br>
<br><a href="http://www.cmake.org/pipermail/cmake/2006-October/011446.html">http://www.cmake.org/pipermail/cmake/2006-October/011446.html</a><br><br>Just set your CMAKE_MODULE_PATH and call FIND_PACKAGE(CppUnit) and then react accordingly based on the cache variables it provides.&nbsp; You should probably also take advantage of CPPUNIT_FOUND in determining if it&#39;s appropriate to build and link the test code.<br>
<br>Depending on how many test executables you have, you may want to make a small macro wrapper that calls ADD_EXECUTABLE() then ADD_TEST() that way you can keep your CMake code to a minimum.<br><br></div></div>-- <br>Philip Lowman