Closed mdavis777 closed 3 years ago
I was able to fix that issue by changing
BYPRODUCTS
${Coverage_NAME}.base
${Coverage_NAME}.capture
${Coverage_NAME}.total
${Coverage_NAME}.info
${Coverage_NAME}
to
BYPRODUCTS
${Coverage_NAME}.base
${Coverage_NAME}.capture
${Coverage_NAME}.total
${Coverage_NAME}.info
${Coverage_NAME}/index.html
I then ran more issues.
1:
if(${Coverage_BASE_DIRECTORY})
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
Always uses the default no matter if BASE_DIRECTORY is set or not. Fixed with:
if(DEFINED Coverage_BASE_DIRECTORY)
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
else()
set(BASEDIR ${PROJECT_SOURCE_DIR})
endif()
After that there is something ninja does with relative paths that makes it impossible to find the source. It bases some things relative to the PROJECT_BINARY_DIRECTORY and some relative to PROJECT_SOURCE_DIR. Still working that part out.
I am trying to use CodeCoverage.cmake with Ninja. On build I always get this error: ninja: warning: phony target 'do_coverage' names itself as an input; ignoring [-w phonycycle=warn] ninja: error: build.ninja:176: multiple rules generate do_coverage [-w dupbuild=err]
Here is the snip it I have from my cmake file