fix MACRO
fix2 for OpenCL on/off
added guard against linking qt5 and VTK together
modified viz module header layout for 2.4 compatibility
implemented OpenCL version of cv::updateMotionHistory
some fixes and improvements in cv::matchTemplate
rewrote perf tests for SURF
turn on CUDA part of nonfree module on Android for non-dynamic build
Merge pull request #2254 from ilya-lavrenov:opengl
Merge pull request #2253 from ilya-lavrenov:cuda
Merge pull request #2255 from ilya-lavrenov:ocl_doc
turn on CUDA part of stitching module on Android for non-dynamic build
update stitching sample
Merge remote-tracking branch 'origin/2.4' into merge-2.4

Conflicts:
	modules/cudaimgproc/test/test_color.cpp
	modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/imgproc.cpp
	modules/gpu/test/test_core.cpp
	modules/gpu/test/test_imgproc.cpp
	modules/java/generator/src/cpp/VideoCapture.cpp
	samples/gpu/performance/CMakeLists.txt
	samples/tapi/CMakeLists.txt
Merge pull request #2256 from ilya-lavrenov:tapi_matchTempl
Merge pull request #2258 from ilya-lavrenov:tapi_video
Merge pull request #2259 from ilya-lavrenov:ocl_surf
Merge pull request #2257 from ilya-lavrenov:tapi_opencl_game2
test for failure
more strict checks and reseting state