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

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -