title: CMake: How to specify directory where ctest should look for executables?
body: <p>I wanted to integrate ctest to a c++/c project. I use google tests to write unit tests.</p>
  
  <p>Relevant part of my CMakeLists.txt looks like this:</p>
  
  <pre><code>...
  ####### CREATING EXE #######
  add_executable(test_exe main.cpp test.cpp)
  target_link_libraries(test_exe GTest::GTest GTest::Main)
  set_target_properties (test_exe PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${UNIT_TEST_BIN_OUTPUT_DIR})
  add_test(test_exe test_exe)
  </code></pre>
  
  <p>As you can see i specified the output directory of my executable (UNIT_TEST_BIN_OUTPUT_DIR).</p>
  
  <p>The executable works fine on its own when I use the terminal:</p>
  
  <pre><code>cd &lt;UNIT_TEST_BIN_OUTPUT_DIR&gt;
  ./test_exe
  </code></pre>
  
  <p>I want to use ctest to execute my tests. So I go to the "ctest folder" generated by cmake. Here I want to use ctest to execute all test added by "add_test" in cmake. </p>
  
  <pre><code>user@user:~/&lt;dir to cmake&gt;/cmake/unit_tests$ ctest
  Test project /&lt;dir to cmake&gt;/cmake/unit_tests
      Start 1: test_exe
  Could not find executable test_exe
  Looked in the following places:
  test_exe
  test_exe
  Release/test_exe
  Release/test_exe
  Debug/test_exe
  Debug/test_exe
  MinSizeRel/test_exe
  MinSizeRel/test_exe
  RelWithDebInfo/test_exe
  RelWithDebInfo/test_exe
  Deployment/test_exe
  Deployment/test_exe
  Development/test_exe
  Development/test_exe
  Unable to find executable: test_exe
  1/1 Test #1: test_exe ......***Not Run   0.00 sec
  
  0% tests passed, 1 tests failed out of 1
  
  Total Test time (real) =   0.00 sec
  
  The following tests FAILED:
        1 - test_exe (Not Run)
  Errors while running CTest
  </code></pre>
  
  <p>If I put the "test_exe" in one of the shown paths it works fine. But I don't want them to be there. </p>
  
  <p><strong>My Question:</strong></p>
  
  <p>Is there a way to tell ctest it should look in <code>UNIT_TEST_BIN_OUTPUT_DIR</code> in order to find the executable? </p>