<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>