- C++
- opencv -> brew install opencv
- cmake -> brew install cmake
- gcc -> brew install gcc
- Link for reference: https://www.youtube.com/watch?v=Ozc3zWJ_NhQ&t=254s
- Create CMaketxt File
touch CMakeLists.txt
// Paste this text into text file:
cmake_minimum_required(VERSION 3.10)
project(MyProject)
find_package(OpenCV REQUIRED)
add_executable(MyProject webcamtest.cpp)
target_link_libraries(MyProject ${OpenCV_LIBS})
- Create Build Directory
mkdir build
- Move to build
cd build
- Generate cmake project
cmake ..
-
Create your test.cpp
-
Compile
cd build
make
- Run
./MyProject
cd build
make
./MyProject
Dont forget to change the file name in CMakeLists.txt to run your test!