If ENABLE_TESTING is ON, you can now use memory checking tools to run the test
suite and check for memory leaks. By default CMake will try to find valgrind in
your path and set some default options.
To customize this behavior use the MEMORYCHECK_COMMAND and
MEMORYCHECK_COMMAND_OPTIONS variables. To run tests with the memory checker,
use the MemCheck action in ctest:
Run entire test suite:
ctest -T MemCheck
Run single test:
ctest -T MemCheck -R TESTNAME
Run test in verbose mode:
ctest -V -T MemCheck -R TESTNAME