I am learning OpenCV using Learning OpenCV book.
One problem I am facing while compiling the code is that I have to write a long command to compile and get the executabl
Create a file named makefile in your working directory that contains the following:
CFLAGS = $SHELL(pkg-config --cflags opencv)
LIBS = $SHELL(pkg-config --libs opencv)
facedetect : facedetect.cpp
g++ $(CFLAGS) $(LIBS) -o $@ $<
Then when you want to compile you just type:
$ make
(To answer your PS - note that CMake is very different from make - for now you should probaby just use make.)