title: CMake: not linking already existing libraries when arm neon compiler options added
body: <p>I need to optimize the library g2o at <a href="https://github.com/RainerKuemmerle/g2o" rel="nofollow">https://github.com/RainerKuemmerle/g2o</a> for ARM using neon instructions. I am running my code on an ARMv7 machine running Ubuntu. </p>
  
  <p>I edited the main <a href="https://github.com/RainerKuemmerle/g2o/blob/master/CMakeLists.txt" rel="nofollow">CMakesLists.txt file</a> and added the compiler options as following</p>
  
  <pre><code>set(ARM_CXX_FLAGS "--march=armv7-a -mfloat-abi=softfp  -mfpu=neon")
  </code></pre>
  
  <p>and edited the lines </p>
  
  <pre><code>SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${g2o_CXX_FLAGS}")
  </code></pre>
  
  <p>to</p>
  
  <pre><code>SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${g2o_CXX_FLAGS} ${ARM_CXX_FLAGS }")   
  </code></pre>
  
  <p>After that I am able to include </p>
  
  <pre><code>#include &lt;arm_neon.h&gt;
  </code></pre>
  
  <p>and some sample vectorization code in one of the files and perform cmake and make successfully. But when I try to execute the cli application with an input file in the root folder by the command</p>
  
  <pre><code>./g2o -v ../input_file
  </code></pre>
  
  <p>I am getting errors that some other completely different libraries are missing. </p>
  
  <pre><code># Used Compiler: GNU /usr/bin/c++
  bool g2o::DlWrapper::openLibrary(const string&amp;) Cannot open library: libGL.so.1: cannot open       shared object file: No such file or directory
  bool g2o::DlWrapper::openLibrary(const string&amp;) Cannot open library: libcholmod.so.2.1.2: cannot open shared object file: No such file or directory
  bool g2o::DlWrapper::openLibrary(const string&amp;) Cannot open library: libcxsparse.so.3.1.2: cannot open shared object file: No such file or directory
  bool g2o::DlWrapper::openLibrary(const string&amp;) Cannot open library: libcxsparse.so.3.1.2: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>The application works perfectly fine before making the changes in CMakeLists.txt as mentioned. I am not able to understand what is causing this as I did not make any other changes in the CMakesLists files. What could be going wrong? Am I giving the compiler options wrong?</p>