c++ - CMake. Create coverage target -
sorry such popular question. can't correspondingly apply answers here environment.
i have api , tests it. both subprojects main "dummy" project. stuck because used cmake-anitpattern:
cmake_minimum_required (version 2.8) set(cmake_skip_rpath false) add_subdirectory ( src ) add_subdirectory ( test ) add_custom_target(coverage command make command sh ${cmake_source_dir}/do_coverage.sh ) that command make bad solution because planning build project on windows later (yep, need put commands sh-script in cmakelists.txt purpose too).
so, how can let cmake build test project in automatic mode doing coverage things (gcov, gcovr) if after cmake want make coverage straightway? thanks!
you may use cmake build this:
add_custom_target( coverage command ${cmake_command} --build ${cmake_binary_dir} command sh ${cmake_source_dir}/do_coverage.sh )
Comments
Post a Comment