title: Two versions of same library in one app
body: <p>I have two versions (with almost identical API) of same shared library. I must use them in same application. I know how to resolve name clashes in the headers -- I will just import them like this</p>
  
  <pre><code>namespace version1 {
      #include "version1/library.h"
  }
  
  namespace version2 {
      #include "version2/library.h"
  }
  </code></pre>
  
  <p>I do not know though how I resolve linking clashes -- library is dynamically linked. First version creates following structure in custom lib folder:</p>
  
  <pre><code>libsomething.so -&gt; libsomething.so.2
  libsomething.so.2 -&gt; libsomething.so.0.8.31.1
  libsomething.so.0.8.31.1
  </code></pre>
  
  <p>second one:</p>
  
  <pre><code>libsomething.so -&gt; libsomething.so.2
  libsomething.so.2 -&gt; libsomething.so.0.8.32
  libsomething.so.0.8.32
  </code></pre>
  
  <p>My target environment is Linux machine.</p>
  
  <p>Context:</p>
  
  <p>I have source of libraries but they are downloaded and compiled automatically so I would like to avoid changing anything in CMakeProject of those libs but I can do it if other options are to complicated. I would prefer solution that does changes to those libs after compilation e.g. change soname. But again if I have to do some complicated stuff in app code to use those libs I prefer doing changes to these libs project and maintaining them (because version can change but there will always be two of them -- one version will probably be set forever and never updated so I would prefer to change this non changing version).</p>