c++ - Always run test cases using CMake -
this question has answer here:
- cmake add_custom_command not being run 2 answers
i using cmake , linux run test cases cmakelists.txt using following command:
add_custom_command( target tests post_build command ${cmake_current_binary_dir}/tests )
this executes if code has been changed, there anyway run binary?
for solution, had this:
add_custom_command( output tests.a post_build command ${cmake_current_binary_dir}/tests ) add_custom_target( runtests dpeends tests.a )
use add_custom_target instead. executed @ every build. http://www.cmake.org/cmake/help/v3.0/command/add_custom_target.html
add_custom_target( run_test command ${cmake_current_binary_dir}/tests )
Comments
Post a Comment