Mar 25, 2008

OpenCV on Mac

New Setting:
1.
PKG_CONFIG_PATH=/opt/local/var/macports/software/opencv/1.0.0_0/opt/local/lib/pkgconfig: ${PKG_CONFIG_PATH}

2.
export PKG_CONFIG_PATH

3.
g++ `pkg-config --cflags opencv` `pkg-config --libs opencv` -o water watershed.cpp


g++ -c Wrapper.cxx `pkg-config opencv --cflags`
g++ -o hello Wrapper.o `pkg-config opencv --libs`
./hello



export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig


Makefile:
#by lono kao, 970325
CXX = g++
CFLAGS += `pkg-config opencv --cflags`
LDFLAGS += `pkg-config opencv --libs`
#LTool/LImage
TARGET = deleteme
SRC = LTool/LImage.cpp deleteme.cpp
#SRC = a.c b.c
#OBJ = $(SRC:.c=.o)
all : $(TARGET)

$(TARGET) : $(TARGET).cpp
$(CXX) $(SRC) $(CFLAGS) $(LDFLAGS) -o $(TARGET)

.cpp.o : $*.cpp
$(CXX) $*.cpp $(CFLAGS) $(LDFLAGS) -o $*

clean :
rm -f $(OBJS) $(TARGET)

0 comments:

 
TEMPLATE HACKS AND TWEAKS BY [ METAMUSE ] BLACKCAT 1.1
/scripts/shBrushJScript.js'/>