title: cmake, swig and python: How to override conflicting symbols
body: <p>I am using cmake to create a python wrapper with swig. The problem is, that there are conflicting symbols in lapack and python. I have a simple script to undefine the conflicting symbols before compilation and I can write a makefile that works. I am wondering, what would be the best approach to take when using cmake.</p>
  
  <p>This makefile works:</p>
  
  <pre><code>tools_wrap.cc toolspy: tools.i ../libtools.a
      swig -I../ -c++ -python $(PYFLAGS) -shadow -o tools_wrap_tmp.cc tools.i 
      # A terrible hack to override conflicting function names in python and lapack
      python ./fix_undefs.py &lt; tools_wrap_tmp.cc &gt; tools_wrap.cc
  
  _tools.so: tools_wrap.cc ../libtools.a
       $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(PYTHONINC) $(INCLUDES) -I../ tools_wrap.cc $(LIBS) -o _tools.so
  </code></pre>
  
  <p>Thanks for any help!</p>
  
  <p>Vesa</p>