Calling
ctest -j4 -DCTEST_MEMORYCHECK_COMMAND="/usr/bin/valgrind" -DMemoryCheckCommand="/usr/bin/valgrind" --output-on-failure -T MemCheck
says
Memory checker (MemoryCheckCommand) not set, or cannot find the specified program.
Why doesn't it find valgrind automatically nor when specified manually?
As described on the CTest Wiki page, CTest reads the location of the memory check command (among other settings) from a file DartConfiguration.tcl
in the build directory. One way to create the dart configuration file is to simply include the CTest CMake module in your CMakeLists.txt:
include (CTest)
The CTest module will find your valgrind installation in /usr/bin
and put a variable MemoryCheckCommand
pointing to it in the DartConfiguration.tcl
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With