diff --git a/cmake/jkqtplotter_deployopencv.cmake b/cmake/jkqtplotter_deployopencv.cmake index e47f41a5f2..659facd74e 100644 --- a/cmake/jkqtplotter_deployopencv.cmake +++ b/cmake/jkqtplotter_deployopencv.cmake @@ -1,12 +1,20 @@ function(jkqtplotter_deployopencv TARGET_NAME) - #use windeploy if(OpenCV_FOUND) if(WIN32) - add_custom_command(TARGET ${EXENAME} POST_BUILD # Adds a post-build event the TARGET - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${_OpenCV_LIB_PATH}" - $ + if (EXISTS ${_OpenCV_LIB_PATH}) + add_custom_command(TARGET ${EXENAME} POST_BUILD # Adds a post-build event the TARGET + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${_OpenCV_LIB_PATH}" + "$" ) + endif() + if (EXISTS ${OpenCV_INSTALL_PATH}/bin) + add_custom_command(TARGET ${EXENAME} POST_BUILD # Adds a post-build event the TARGET + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${OpenCV_INSTALL_PATH}/bin" + "$" + ) + endif() endif(WIN32) endif(OpenCV_FOUND) endfunction(jkqtplotter_deployopencv)