c++ - Always run test cases using CMake -


this question has answer here:

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

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -