Configure CmakeLists.txt to avoid manually copying dlls

55 Views Asked by At

I'm currently experimenting with the OpenCV library in C++. I've set up MinGW, CMake, and I'm coding in VSCode. However, I'm facing an inconvenience where I need to manually copy all the necessary DLL files into the project directory every time I want to run the executable program (.exe). Is there a configuration or setup that can help me avoid this constant copy-pasting of DLLs?

In CMakeLists.txt, I've already set:

set(OpenCV_DIR Path_to_opencv_lib)
find_package( OpenCV REQUIRED )

I'm unclear about why we need to copy DLLs into the current project directory in the first place.

Any assistance with these issues would be greatly appreciated.

0

There are 0 best solutions below