<div dir="ltr">of course... This is the source of my test cmake file<br><br>#Cmake file of Tests<br>cmake_minimum_required (VERSION 2.6)<br><br>SET(TST_SRC test_rev.cpp test_runner.cpp)<br><br>FIND_PACKAGE(Boost REQUIRED COMPONENTS unit_test_framework)<br>
<br>INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})<br>INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}../../src/lib/reverse)<br>ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)<br>ADD_EXECUTABLE(test_rev ${TST_SRC})<br>TARGET_LINK_LIBRARIES(test_rev ${Boost_LIBRARIES})<br>
TARGET_LINK_LIBRARIES(test_rev Reverse)<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 4:55 PM, Petr Kmoch <span dir="ltr">&lt;<a href="mailto:petr.kmoch@gmail.com" target="_blank">petr.kmoch@gmail.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 dir="ltr"><div><div>1. Can you post tests/CMakeLists.txt (or at least the parts relevant to creating test_rev)?<br>
<br></div>2. Does it work if you use the enhanced signature of add_test? I mean &#39;add_test(NAME Test COMMAND test_rev)&#39;<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888">Petr<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 1:18 PM, Lloyd <span dir="ltr">&lt;<a href="mailto:lloydkl.tech@gmail.com" target="_blank">lloydkl.tech@gmail.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 dir="ltr"><div><div><div>Yes I built the test and it is in <br><br>E:\CMakeDemo\BuildDir\tests\Debug\test_rev.exe<br>

<br></div>I don&#39;t know the right way to locate this test executable for cmake<br><br></div>Thanks,<br>
</div>  Lloyd<div><div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 4:42 PM, Petr Kmoch <span dir="ltr">&lt;<a href="mailto:petr.kmoch@gmail.com" target="_blank">petr.kmoch@gmail.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 dir="ltr"><div><div>Hi Lloyd.<br><br></div>Do you actually have a target (executable) named &quot;test_rev&quot;? And have you built it before running RUN_TESTS? RUN_TEST (or its Makefile equivalent &#39;make test&#39;) doesn&#39;t automatically build the test executables before running them.<br>



<br></div>Petr<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Fri, Apr 12, 2013 at 1:08 PM, Lloyd <span dir="ltr">&lt;<a href="mailto:lloydkl.tech@gmail.com" target="_blank">lloydkl.tech@gmail.com</a>&gt;</span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>I was successful in creating and compiling a simple project C++/Visual studio using cmake. I have also included one unit test project. All these projects builds successfully. The test project source and main project source resides in the root directory of the project. When I try to run &quot;RUN_TESTS&quot; it gives me an error <br>




<br>Test project E:/CMakeDemo/BuildDir<br>1&gt;      Start 1: Test<br>1&gt;  Could not find executable test_rev<br>1&gt;  Looked in the following places:<br>1&gt;  Unable to find executable: test_rev<br>1&gt;  test_rev<br>




1&gt;  test_rev.exe<br>1&gt;  Debug/test_rev<br>1&gt;  Debug/test_rev.exe<br>1&gt;  Debug/test_rev<br>1&gt;  Debug/test_rev.exe<br>1&gt;  1/1 Test #1: Test .............................***Not Run   0.00 sec<br><br></div>



I have added the tests in my main cmake file as shown below<br>
<br>#Root cmake file<br>cmake_minimum_required (VERSION 2.6)<br>PROJECT (Tutorial)<br><br>ADD_SUBDIRECTORY(src/lib/reverse)<br>ADD_SUBDIRECTORY(src)<br>#SUBDIRS(src/lib/reverse src)<br><br>############################################################<br>




SET (DO_TEST false CACHE BOOL &quot;Enable Testing?&quot;)<br>if(DO_TEST)<br>MESSAGE (STATUS &quot;Testing is enabled&quot;)<br>ENABLE_TESTING()<br>ADD_SUBDIRECTORY(tests)<br><br><br>ADD_TEST(Test test_rev)<br><br><br>endif(DO_TEST)<br>




#############################################################<br></div><br><br></div>What am i missing here?<br><br></div>Thanks a lot,<br></div>  Lloyd<br><div><div><div><div><div><br><br></div></div></div></div></div></div>




<br></div></div><span><font color="#888888">--<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></font></span></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>