CMakeLists.txt 836 B

1234567891011121314151617181920212223
  1. set(TEST_PROXY ${CMAKE_CURRENT_BINARY_DIR}/test.proxy)
  2. file(REMOVE ${TEST_PROXY})
  3. # generate
  4. # call the python executable to generate the Matlab gateways
  5. add_custom_command(
  6. OUTPUT ${TEST_PROXY}
  7. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/OpenCVTest.m ${CMAKE_CURRENT_BINARY_DIR}
  8. COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/testsuite.m ${CMAKE_CURRENT_BINARY_DIR}
  9. COMMAND ${CMAKE_COMMAND} -E touch ${TEST_PROXY}
  10. COMMENT "Building Matlab tests"
  11. )
  12. # targets
  13. # opencv_matlab_sources --> opencv_matlab
  14. add_custom_target(opencv_test_matlab ALL DEPENDS ${TEST_PROXY})
  15. add_dependencies(opencv_test_matlab ${the_module})
  16. # run the matlab test suite
  17. add_test(opencv_test_matlab
  18. COMMAND ${MATLAB_BIN} "-nodisplay" "-r" "testsuite.m"
  19. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  20. )