OpenCV

From ImageWiki

(Difference between revisions)
Jump to: navigation, search
(Eksempel 1: Lidt hjælp...)
(Simpler makefile)
Line 19: Line 19:
  # Compile and link flags
  # Compile and link flags
-
  CXX     =  g
+
  CXX         =  g++
-
  CXXFLAGS = `pkg-config opencv --cflags` -Wall
+
  CFLAGS      = -Wall -g
-
LIBS    = `pkg-config opencv --libs`
+
   
   
-
  # Name of executable
+
  # Compilation (add flags as needed)
-
  EXECUTABLE = myprogram
+
  CXXFLAGS    += `pkg-config opencv --cflags`
   
   
-
  # Files
+
  # Linking (add flags as needed)
-
  SOURCES = myprogram.cc myauxilaryfunction.cc
+
  LDFLAGS    += `pkg-config opencv --libs`
-
OBJECTS = $(patsubst %.cc, %.o, $(SOURCES))
+
   
   
-
  # Linking
+
  # Name your target executables here
-
  all: $(OBJECTS)
+
  all         = test
-
$(CXX) $(LIBS) $(OBJECTS) -o $(EXECUTABLE)
+
   
   
-
  # Compilation
+
  # Default target is the first one - so we will have it make everything :-)
-
  %.o : %.cc
+
  all: $(all)
-
$(CXX) $(CXXFLAGS) -c $^
+
 +
clean:
 +
    rm -f $(all) *.o
 +
 +
# Program dependencies (.o files will be compiles by implicit rules)
 +
test: test.o MyOtherClass.o
== Eksempel 1 ==
== Eksempel 1 ==

Revision as of 20:13, 4 November 2007

Personal tools