title: How do I add valgrind tests to my cmake "test" target
body: <p>I run unit tests by building with <code>ninja</code> and then running <code>ninja test</code> from my build tree:</p>
  
  <pre><code>cmake -G Ninja /source/tree
  ninja
  ninja test
  </code></pre>
  
  <p>However, to run valgrind I need to run it manually:</p>
  
  <pre><code>valgrind rel/path/to/test
  </code></pre>
  
  <p>I'd like <code>valgrind</code> to run automatically when I run <code>ninja test</code>. <a href="https://cmake.org/Wiki/CMake/Testing_With_CTest" rel="noreferrer">According to the cmake documentation</a> <em>"setting up [valgrind tests] is <strong>extremely easy</strong>"</em>, but when I run</p>
  
  <pre><code>ctest -D NightlyMemoryCheck
  </code></pre>
  
  <p>I just get this error:</p>
  
  <pre><code>Cannot find file: /home/arman/tinman/deb/DartConfiguration.tcl
     Site: 
     Build name: (empty)
  WARNING: No nightly start time found please set in CTestConfig.cmake or DartConfig.cmake
  Problem initializing the dashboard.
  </code></pre>
  
  <p>I get a similar error when I follow the instructions from this SO question:</p>
  
  <p><a href="https://stackoverflow.com/questions/9303711/how-do-i-make-ctest-run-a-program-with-valgrind-without-dart">How do I make ctest run a program with valgrind without dart?</a></p>
  
  <p>I don't know what <code>dart</code> is, but according the website it's some kind of online testing doodad.</p>
  
  <p>Clearly <em>extremely easy</em> is not easy enough for me. Does anyone know of a solution that is so supremely easy that you'd have to be some kind of IT warlock to make it <em>not</em> work?</p>