I am trying to setup CTest to run a coverage analysis. It seems like I have to make a MyScript.cmake file and call it with ctest -S MyScript.cmake
. I thought a simple example might look like this:
ctest_start(TestCoverage)
ctest_coverage(BUILD ${CTEST_BINARY_DIRECTORY})
but I am getting
ctest_start source directory not specified. Specify source directory as an argument or set CTEST_SOURCE_DIRECTORY
I don't want to hard code this path in the script file as I may want to run it in different places, so where am I supposed to get paths for CTEST_SOURCE_DIRECTORY
and CTEST_BINARY_DIRECTORY
?