diff --git a/README.md b/README.md index f94f619..4cc06d2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ cmake -S . -B build -G "Visual Studio 17 2022" -A x64 [rocbuild.cmake](rocbuild.cmake) is a set of functions/macros for daily building opeorations: - copy dlls for recursive shared dependencies -- copy OpenCV's videoio dlls +- copy OpenCV's videoio plugin dlls - enable Ninja colorful output by default - use `CMAKE_BINARY_DIR` as output location for artifacts: `.a/.lib/.dll/.so/.exe/...` - more fuctionalities to be added... diff --git a/rocbuild.cmake b/rocbuild.cmake index d4a2906..c97e732 100644 --- a/rocbuild.cmake +++ b/rocbuild.cmake @@ -56,20 +56,20 @@ endfunction() # Scan opencv_videoio dlls and copy them to the target executable's folder -function(rocbuild_copy_opencv_videoio_plugin_dll target) +function(rocbuild_copy_opencv_videoio_plugin_dlls target) # Sanity checks if(CMAKE_CROSSCOMPILING OR (NOT WIN32)) return() endif() if(NOT TARGET ${target}) - message(WARNING "rocbuild_copy_opencv_videoio_plugin_dll() was called with a non-target: ${target}") + message(WARNING "rocbuild_copy_opencv_videoio_plugin_dlls() was called with a non-target: ${target}") return() endif() get_target_property(TYPE ${target} TYPE) if(NOT ${TYPE} STREQUAL "EXECUTABLE") - message(WARNING "rocbuild_copy_opencv_videoio_plugin_dll() was called on a non-executable target: ${target}") + message(WARNING "rocbuild_copy_opencv_videoio_plugin_dlls() was called on a non-executable target: ${target}") return() endif() @@ -87,23 +87,23 @@ function(rocbuild_copy_opencv_videoio_plugin_dll target) set(COPY_SCRIPT_CONTENT "") if(EXISTS "${OpenCV_DIR}/bin") - set(opencv_videoio_dll_dir "${OpenCV_DIR}/bin") + set(opencv_videoio_plugin_dll_dir "${OpenCV_DIR}/bin") elseif(EXISTS "${OpenCV_DIR}/../bin") - set(opencv_videoio_dll_dir "${OpenCV_DIR}/../bin") + set(opencv_videoio_plugin_dll_dir "${OpenCV_DIR}/../bin") else() - message(WARNING "Could not find opencv_videoio dlls in ${OpenCV_DIR}/bin or ${OpenCV_DIR}/../bin") + message(WARNING "Could not find opencv videoio plugin dlls in ${OpenCV_DIR}/bin or ${OpenCV_DIR}/../bin") return() endif() - file(REAL_PATH "${opencv_videoio_dll_dir}" opencv_videoio_dll_dir) - file(GLOB opencv_videoio_dlls "${opencv_videoio_dll_dir}/opencv_videoio_*.dll") + file(REAL_PATH "${opencv_videoio_plugin_dll_dir}" opencv_videoio_plugin_dll_dir) + file(GLOB opencv_videoio_plugin_dlls "${opencv_videoio_plugin_dll_dir}/opencv_videoio_*.dll") # convert opencv_videoio_dlls to a string - string(REPLACE ";" "\n" opencv_videoio_dlls "${opencv_videoio_dlls}") + string(REPLACE ";" "\n" opencv_videoio_plugin_dlls "${opencv_videoio_plugin_dlls}") string(APPEND COPY_SCRIPT_CONTENT - "set(opencv_videoio_dlls\n${opencv_videoio_dlls}\n)\n" - "foreach(file IN ITEMS \${opencv_videoio_dlls})\n" + "set(opencv_videoio_plugin_dlls\n${opencv_videoio_plugin_dlls}\n)\n" + "foreach(file IN ITEMS \${opencv_videoio_plugin_dlls})\n" " if(EXISTS \"\${file}\")\n" " execute_process(COMMAND \${CMAKE_COMMAND} -E copy_if_different \"\${file}\" \"$\")\n" " endif()\n"