Added opencv_tests and opencv_perf_tests targets to simplify building tests only

This commit is contained in:
Andrey Kamaev 2012-03-02 08:48:33 +00:00
parent 2f4bb580fc
commit aa6c677bd8
2 changed files with 35 additions and 13 deletions

View File

@ -37,17 +37,37 @@ endif()
# performance tests, for "make perf"
#-----------------------------------
if(BUILD_PERF_TESTS AND PYTHON_EXECUTABLE)
if(CMAKE_VERSION VERSION_GREATER "2.8.2")
add_custom_target(perf
${PYTHON_EXECUTABLE} "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" --configuration $<CONFIGURATION> "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py"
)
else()
add_custom_target(perf
${PYTHON_EXECUTABLE} "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py"
)
endif()
if(CMAKE_VERSION VERSION_GREATER "2.8.2")
add_custom_target(perf
${PYTHON_EXECUTABLE} "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" --configuration $<CONFIGURATION> "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py"
)
else()
add_custom_target(perf
${PYTHON_EXECUTABLE} "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py"
)
endif()
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(perf PROPERTIES FOLDER "tests performance")
endif()
endif()
#-----------------------------------
# spefial targets to build all tests
#-----------------------------------
if(BUILD_TESTS)
add_custom_target(opencv_tests)
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(opencv_tests PROPERTIES FOLDER "tests accuracy")
endif()
endif()
if(BUILD_PERF_TESTS)
add_custom_target(opencv_perf_tests)
if(ENABLE_SOLUTION_FOLDERS)
set_target_properties(opencv_perf_tests PROPERTIES FOLDER "tests performance")
endif()
endif()

View File

@ -541,6 +541,7 @@ macro(ocv_add_perf_tests)
add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES})
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_perf_tests ${the_target})
# Additional target properties
set_target_properties(${the_target} PROPERTIES
@ -591,6 +592,7 @@ macro(ocv_add_accuracy_tests)
add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES})
target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
add_dependencies(opencv_tests ${the_target})
# Additional target properties
set_target_properties(${the_target} PROPERTIES