Unable to set ctest options for test targets
I want to run tests with --output-on-failure via "cmake test" but it seems this is impossible. (https://stackoverflow.com/questions/16158091/cmake-setting-an-environmental-variable-for-ctest-or-otherwise-getting-failed)
# Following sets the environment variable for the shell in which the test
# progoram 'hello' is run, but not the shell in which ctest is run
SET_TESTS_PROPERTIES(testhello
PROPERTIES ENVIRONMENT "CTEST_OUTPUT_ON_FAILURE=1")
"...and experimenting shows that the environmental variable is set in the shell that the test program is executed in, but not in the shell that ctest is executed in."
The work-around is to define a custom target. This is extremely unfriendly.
Please provide a way to control ctest options in CMakeLists.txt
Edited by kevin cline