Replace ctest command with "ctest --output-on-failure" permanently for a specific project in CMakeLists.txt
<p>I have found that generic <code>ctest</code> command doesn't give much information about the tests, so I would like to add <code>ctest --output-on-failure</code> but not have the users to worry about the flag. I want them just to <code>cmake</code>, <code>make</code> the project and run ctest and it should run ctest <strong>with</strong> the <code>--output-on-failure</code> flag. Is it possible to do that in CMakeLists.txt?</p>

<p><strong>EDIT:</strong></p>

<p>Output of <code>env CTEST_OUTPUT_ON_FAILURE=1 make test</code></p>

<pre><code> 4/13 Test  #4: TEST_SSSP ........................***Failed  Required regular expression not found.Regex=[CORRECT
]  0.00 sec
Loading Matrix-market coordinate-formatted graph ...
Input graph file /home/muhammad/gunrock/dataset/small/chesapeake.mtx does not exis
</code></pre>

<p>Output of <code>set_property(TEST TestName PROPERTY ENVIRONMENT "CTEST_OUTPUT_ON_FAILURE=1")</code></p>

<pre><code> 4/13 Test  #4: TEST_SSSP ........................***Failed  Required regular expression not found.Regex=[CORRECT
]  0.00 sec
</code></pre>

<p>The flag in <code>set_property</code> is not working.</p>