You could do:<div>get_filename_component(dir "${CMAKE_CURRENT_SOURCE_DIR}/../src" ABSOLUTE)</div><div><br></div><div>and then use:</div><div>${dir}/testTest.cpp</div><div><br></div><div>Does that work?</div><div>
<br><br><div class="gmail_quote">2010/2/26 Raphaël M. <span dir="ltr"><<a href="mailto:latcho.dives@gmail.com">latcho.dives@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hello,</div><div><br></div><div>I'm starting to use CTest and having some trouble generating the test driver.</div><div><br></div><div>Here is the cmake commands I'm using :</div><div><br></div><div><div>create_test_sourcelist (Tests_src</div>
<div><span style="white-space:pre">        </span>TestSuite.cpp</div><div><span style="white-space:pre">        </span>../src/testTest.cpp</div><div>)</div><div><br></div><div>My directory structure is </div>
<div><br></div><div>LoggerTest/</div><div> - build/</div><div> -CMakeLists.txt</div><div> - inc/</div><div> - src/</div><div> testTest.cpp (which contains int testTest(int argc, char*[] argv) )</div>
</div><div><br></div><div>When I run 'cmake .' it generates a file called TestSuite.cpp which doesn't compile when I then run "make"</div><div><br></div><div>The reason is that cmake generated a function prototype like this :</div>
<div><div><br></div><div>/* Forward declare test functions. */</div><div>int .._src_testTest(int, char*[]);</div></div><div><br></div><div><br></div><div>(Obviously, I tested putting the CMakeLists.txt and the source files in one same directory, and it works, but I don't think that's an elegant solution)</div>
<div><br></div><div>Does anyone have a clean solution to fix this issue and keep the CMakeLists.txt in a separate folder than the source files ?</div><div><br></div><div>Thanks a lot,</div><br clear="all">Raphaël Mor<br>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>