CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. set(MODULE_NAME "python_tests")
  2. set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
  3. ocv_add_module(${MODULE_NAME} INTERNAL)
  4. set(OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR "${OpenCV_BINARY_DIR}" CACHE INTERNAL "")
  5. set(OPENCV_PYTHON_TESTS_CONFIG_FILE "${OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR}/opencv_python_tests.cfg" CACHE INTERNAL "")
  6. # get list of modules to wrap
  7. set(OPENCV_PYTHON_MODULES)
  8. foreach(m ${OPENCV_MODULES_BUILD})
  9. if(";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";python.*;" AND HAVE_${m})
  10. list(APPEND OPENCV_PYTHON_MODULES ${m})
  11. #message(STATUS "\t${m}")
  12. endif()
  13. endforeach()
  14. file(RELATIVE_PATH __loc_relative "${OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR}" "${CMAKE_CURRENT_LIST_DIR}")
  15. set(opencv_tests_locations "${__loc_relative}")
  16. foreach(m ${OPENCV_PYTHON_MODULES})
  17. set(__loc "${OPENCV_MODULE_${m}_LOCATION}/misc/python/test")
  18. if(EXISTS "${__loc}")
  19. file(RELATIVE_PATH __loc_relative "${OPENCV_PYTHON_TESTS_CONFIG_FILE_DIR}" "${__loc}")
  20. list(APPEND opencv_tests_locations "${__loc_relative}")
  21. endif()
  22. endforeach(m)
  23. string(REPLACE ";" "\n" opencv_tests_locations_ "${opencv_tests_locations}")
  24. ocv_update_file("${OPENCV_PYTHON_TESTS_CONFIG_FILE}" "${opencv_tests_locations_}")
  25. #
  26. # TODO: Install rules (with test data?)
  27. #