-
Build platform specific OpenCV libraries
- For Mac,
- Download Source archieve from from OpenCV website https://opencv.org/releases/.
- Refer https://docs.opencv.org/4.x/d0/db2/tutorial_macos_install.html
- To use OpenCV in your CMake-based projects through find_package(OpenCV) specify OpenCV_DIR=
<path_to_installed_directory>
variable.
- For Mac,
-
OpenCV configuration in CMakeLists.txt file.
- Add following line,
find_package(OpenCV 4 REQUIRED)
- Add
${OpenCV_LIBS}
in target_link_libraries as shown below,
target_link_libraries(ImageProcessing PRIVATE Qt${QT_VERSION_MAJOR}::Widgets ${OpenCV_LIBS})
- Set OpenCV_DIR environment variable using
set("OpenCV_DIR" "/Users/username/Library/Frameworks/SDL2.framework/")
How to use OpenCV library in a Qt Project
· One min read