SET(OpenCV_Debug_Suffix "d")
SET(OpenCV_Debug_Abbrev "DBG")
SET(OpenCV_Release_Abbrev "OPT")
foreach(ARCH "Debug" "Release") 
	SET(OpenCV_MISSING_DLL FALSE)
	foreach(OPENCV_SUB_LIB ${OpenCV_DLLs_List}) 
		IF(EXISTS "${OpenCV_BIN_DIR_${OpenCV_${ARCH}_Abbrev}}/${LIB_PREFIX}${OPENCV_SUB_LIB}${OPENCV_VER}${OpenCV_${ARCH}_Suffix}.${DLL_EXT}")
			add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OpenCV_BIN_DIR_${OpenCV_${ARCH}_Abbrev}}/${LIB_PREFIX}${OPENCV_SUB_LIB}${OPENCV_VER}${OpenCV_${ARCH}_Suffix}.${DLL_EXT}" $<TARGET_FILE_DIR:${EXECUTABLE_NAME}>)
		ELSEIF(NOT OpenCV_MISSING_DLL)
			MESSAGE(WARNING "Unable to find DLL at ${OpenCV_BIN_DIR_${OpenCV_${ARCH}_Abbrev}}/${LIB_PREFIX}${OPENCV_SUB_LIB}${OPENCV_VER}${OpenCV_${ARCH}_Suffix}.${DLL_EXT} - has (the correct) OpenCV ${ARCH} been built?")
			SET(OpenCV_MISSING_DLL TRUE)
		ENDIF()
	endforeach(OPENCV_SUB_LIB) 
endforeach(ARCH)
