require 'mkmf' require 'pkg-config' $CFLAGS << " #{PKGConfig.cflags('opencv')}" unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O3') $CFLAGS << ' -O3' end if CONFIG['CC'] =~ /gcc/ $CFLAGS << ' -Wall' if $DEBUG && !$CFLAGS.gsub!(/ -O[\dsz]?/, ' -O0 -ggdb') $CFLAGS << ' -O0 -ggdb' end end dir_config("opencv", "/usr/local/include/opencv", "/usr/local/lib") opencv_libraries = ["opencv_core", "opencv_imgproc", "opencv_highgui"] puts ">> check require libraries..." opencv_libraries.each{|lib| raise "lib#{lib} not found." unless have_library(lib) } create_makefile("logo/recognize")