2012-05-13 17:34:33 +08:00
|
|
|
set(the_description "The ts module")
|
|
|
|
|
2015-12-12 20:02:10 +08:00
|
|
|
if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS)
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_module_disable(ts)
|
|
|
|
endif()
|
2012-01-25 17:04:49 +08:00
|
|
|
|
2013-08-06 21:56:25 +08:00
|
|
|
set(OPENCV_MODULE_TYPE STATIC)
|
2012-05-13 17:34:33 +08:00
|
|
|
set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
|
2012-06-12 22:46:12 +08:00
|
|
|
|
2015-05-18 16:57:18 +08:00
|
|
|
if(WINRT)
|
|
|
|
# WINRT doesn't have access to environment variables
|
|
|
|
# so adding corresponding macros during CMake run
|
|
|
|
add_env_definitions(OPENCV_TEST_DATA_PATH)
|
|
|
|
add_env_definitions(OPENCV_PERF_VALIDATION_DIR)
|
|
|
|
endif()
|
|
|
|
|
2013-03-15 21:58:18 +08:00
|
|
|
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
|
|
|
|
|
2015-05-19 21:15:54 +08:00
|
|
|
ocv_add_module(ts INTERNAL opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui)
|
2012-10-09 22:37:26 +08:00
|
|
|
|
2012-02-03 19:26:49 +08:00
|
|
|
ocv_glob_module_sources()
|
|
|
|
ocv_module_include_directories()
|
|
|
|
ocv_create_module()
|
2016-11-30 01:28:59 +08:00
|
|
|
|
|
|
|
# generate config file
|
|
|
|
set(OPENCV_TESTS_CONFIG_FILE "${CMAKE_BINARY_DIR}/opencv_tests_config.hpp")
|
|
|
|
set(OPENCV_TESTS_CONFIG_STR "")
|
|
|
|
if(CMAKE_INSTALL_PREFIX)
|
|
|
|
set(OPENCV_TESTS_CONFIG_STR "${OPENCV_TESTS_CONFIG_STR}
|
|
|
|
#define OPENCV_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\"
|
|
|
|
")
|
|
|
|
endif()
|
|
|
|
if(OPENCV_TEST_DATA_INSTALL_PATH)
|
|
|
|
set(OPENCV_TESTS_CONFIG_STR "${OPENCV_TESTS_CONFIG_STR}
|
|
|
|
#define OPENCV_TEST_DATA_INSTALL_PATH \"${OPENCV_TEST_DATA_INSTALL_PATH}\"
|
|
|
|
")
|
|
|
|
endif()
|
|
|
|
if(EXISTS "${OPENCV_TESTS_CONFIG_FILE}")
|
|
|
|
file(READ "${OPENCV_TESTS_CONFIG_FILE}" __content)
|
|
|
|
endif()
|
|
|
|
if(NOT OPENCV_TESTS_CONFIG_STR STREQUAL "${__content}")
|
|
|
|
file(WRITE "${OPENCV_TESTS_CONFIG_FILE}" "${OPENCV_TESTS_CONFIG_STR}")
|
|
|
|
endif()
|