deepfryed/similie — Issue #1: Can't create Makefile on OSX
Author: Tuxie
Created: 2011-11-19 22:04:10+00:00
State: open

I'm trying to install the similie gem on OSX but it doesn't find opencv because the extconf.rb doesn't use pkg-config.

If I change the extconf.rb to only include this, it works fine:
require 'mkmf'
$CFLAGS = \`pkg-config opencv --cflags\`
$LDFLAGS = \`pkg-config opencv --libs\`
create_makefile 'similie'

opencv is installed using Homebrew, which is pretty much THE standard way to install cli tools on OSX these days.

The pkg-config output is:
$ pkg-config --cflags
-I/usr/local/Cellar/opencv/2.3.1a/include/opencv -I/usr/local/Cellar/opencv/2.3.1a/include
$ pkg-config --libs
-L/usr/local/Cellar/opencv/2.3.1a/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

Regards, Per