diff --git a/wrappers/gmshpy/CMakeLists.txt b/wrappers/gmshpy/CMakeLists.txt
index 446992475c61f24e4a56f8cf385dde867829af0f..c432e66b1a68a4a746ee46a42d57009721424cbc 100644
--- a/wrappers/gmshpy/CMakeLists.txt
+++ b/wrappers/gmshpy/CMakeLists.txt
@@ -84,6 +84,9 @@ foreach(module ${SWIG_MODULES})
   set(GMSH_PYTHON_MODULES_INCLUDE_CODE 
       "${GMSH_PYTHON_MODULES_INCLUDE_CODE}from ${module} import *\n")
   list(APPEND GMSHPY_DEPENDS "_${module}")
+  if(APPLE)
+    set_target_properties("_${module}" PROPERTIES LINK_FLAGS "-undefined suppress -flat_namespace")
+  endif(APPLE)
 endforeach(module)
 
 add_custom_target("_gmshpy" DEPENDS ${GMSHPY_DEPENDS})