From 19ad22fe11e69bb29a4a28e9ef008e91fe546dbd Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Sat, 22 Sep 2012 07:38:38 +0200
Subject: [PATCH] Adaptations to the package compiles under OSX with OpenCV 2.4

---
 flandmark/ext/ext.cpp |  2 +-
 setup.py              | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/flandmark/ext/ext.cpp b/flandmark/ext/ext.cpp
index 8845409..183b8b7 100644
--- a/flandmark/ext/ext.cpp
+++ b/flandmark/ext/ext.cpp
@@ -5,9 +5,9 @@
  * @brief Boost.Python extension to flandmark
  */
 
+#include <boost/python.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/shared_array.hpp>
-#include <boost/python.hpp>
 #include <bob/core/python/gil.h>
 #include <bob/core/python/ndarray.h>
 #include <cv.h>
diff --git a/setup.py b/setup.py
index c7f9cb9..c69357d 100644
--- a/setup.py
+++ b/setup.py
@@ -57,9 +57,19 @@ def pkgconfig(package):
     if flag_map.has_key(token[:2]):
       kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
 
-    else: # throw others to extra_link_args
+    elif token[0] == '-': # throw others to extra_link_args
       kw.setdefault('extra_compile_args', []).append(token)
 
+    else: # these are maybe libraries
+      if os.path.exists(token):
+        dirname = os.path.dirname(token)
+        if dirname not in kw.get('library_dirs', []):
+          kw.setdefault('library_dirs', []).append(dirname)
+
+        bname = os.path.splitext(os.path.basename(token))[0][3:]
+        if bname not in kw.get('libraries', []):
+          kw.setdefault('libraries', []).append(bname)
+
   for k, v in kw.iteritems(): # remove duplicated
     kw[k] = uniq(v)
 
-- 
GitLab