fix compilation and linking on Mac OS X
diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
index 7e9e888..22d7340 100644
--- a/swig/CMakeLists.txt
+++ b/swig/CMakeLists.txt
@@ -28,6 +28,12 @@
 include(GrSwig)
 include(GrPython)
 
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+  # Mac OS X specific code
+  # Without this flag it does not find some of the libraries
+  SET(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup")
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
 ########################################################################
 # Setup swig generation
 ########################################################################