<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 "RUN_TESTS" it gives me an error <br>
<br>Test project E:/CMakeDemo/BuildDir<br>1> Start 1: Test<br>1> Could not find executable test_rev<br>1> Looked in the following places:<br>1> Unable to find executable: test_rev<br>1> test_rev<br>
1> test_rev.exe<br>1> Debug/test_rev<br>1> Debug/test_rev.exe<br>1> Debug/test_rev<br>1> Debug/test_rev.exe<br>1> 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 "Enable Testing?")<br>if(DO_TEST)<br>MESSAGE (STATUS "Testing is enabled")<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>