19 November 2023
This is based on project is based on Elliotcodes
YouTube video How to Setup OpenCV for C++ on Visual Studio Code (MacOS)
https://youtu.be/Ozc3zWJ_NhQ?si=kJsDgmfhg79IAQvg. This project adds a few bits which make using OpenCV or any other modern C++ project easier on the Mac.
- It uses the still experimental but nonetheless excellent CMake extension for VS Code. (Version is 0.0.17 at time of writing)
- CMake does all of the grunt work of finding libraries that you have installed. You don't have to create and configure
tasks.json
orc_cpp_properties.json
.
- CMake does all of the grunt work of finding libraries that you have installed. You don't have to create and configure
- It includes a video and it is of me of course, talking about Android development in 2012.
- You should have the following already installed on your Mac:
- Xcode, from Mac App Store,
-> App Store
- Be sure to install Xcode command line extensions.
- Open the Terminal app and enter:
xcode-select --install
- Homebrew: go to
https://brew.sh/
- Use brew to install:
- cmake,
brew install cmake
- pkg-config,
brew install pkg-config
- opencv,
brew install opencv
- cmake,
- Visual Studio Code: go to
https://code.visualstudio.com/download
- Xcode, from Mac App Store,
- Main Tools
- C/C++
- C/C++ Extension Pack
- C/C++ Themes
- CMake Tools
- CMake
- Check each extension to be sure it is
Enabled
.
- Docker and Remote Tools (Not needed for this app but useful to have)
- Dev Containers
- Docker
- Remote - SSH
- Remote - SSH: Editing Configuration Files
- Remote Explore
- CMake: Select a Kit,
- Select: Clang 13.0.0
- This will create a build folder
- CMake: Select a Variant
- Select Debug (typical while developing)
- CMake: Configure
- Build