title: Can't Include LibXML2 Files in a CMake C++ Project (using QtCreator IDE)
body: <p>I'm working on a Cmake based C++ project in QtCreator. I am trying to use mlpack in my project, but as soon as I include the line <code>#include &lt;mlpack/core.hpp&gt;</code> to my only source file, I get an error pertaining to some libxml files that are included by mlpack/core.hpp:</p>
  
  <pre><code>    In file included from /usr/local/include/mlpack/core/util/save_restore_utility.hpp:26:0,
               from /usr/local/include/mlpack/core.hpp:171,
               from /home/revinci/code/workspaces/qt_ws/Semantic_Perception/src/features_slic.cpp:18:
      /usr/include/libxml2/libxml/parser.h:15:31: fatal error: libxml/xmlversion.h: No such file or directory
      #include &lt;libxml/xmlversion.h&gt;
  </code></pre>
  
  <p>Now, I went into <code>/usr/include/libxml2/libxml/</code> and found <code>parser.h</code> with the line <code>#include &lt;libxml/xmlversion.h&gt;</code> in it.
  So, I saw that <code>xmlversion.h</code> and <code>parser.h</code> are in the same folder and tried a hack: I changed the <code>#include &lt;libxml/xmlversion.h&gt;</code> in <code>parser.h</code> to <code>#include "xmlversion.h"</code> only to get the following error:</p>
  
  <pre><code>    In file included from /usr/include/libxml2/libxml/parser.h:15:0,
               from /usr/local/include/mlpack/core/util/save_restore_utility.hpp:26,
               from /usr/local/include/mlpack/core.hpp:171,
               from /home/revinci/code/workspaces/qt_ws/Semantic_Perception/src/features_slic.cpp:18:
      /usr/include/libxml2/libxml/xmlversion.h:13:31: fatal error: libxml/xmlexports.h: No such file or directory
      #include &lt;libxml/xmlexports.h&gt;
  </code></pre>
  
  <p>Which is basically telling me that it can't find <code>xmlexports.h</code> (included by <code>xmlversion.h</code>). More importantly, <code>xmlexports.h</code> is in the same directory as <code>xmlversion.h</code> and <code>parser.h</code>!</p>
  
  <p>I tried the solution mentioned <a href="https://stackoverflow.com/questions/23254475/ubuntu-eclipse-libxml2-error-fatal-error-libxml-xmlversion-h-no-such-file-or">here</a> and installed <code>libxml2-dev</code> (again) and <code>libxslt1-dev</code>, but my problem wasn't solved.</p>
  
  <p>I think this may have something to do with specifying my include paths correctly. I've tried to add <code>/usr/include/libxml2</code> to the various path environment variables (<code>PATH</code>, <code>INCLUDE_PATH</code> and <code>CPATH</code>) that are present in my build environment in QtCreator, but to no avail. My <code>CMakeLists.txt</code> looks like this:</p>
  
  <pre><code>    project(Semantic_Perception)
      cmake_minimum_required(VERSION 2.8)
  
  
  
      #Vigra Headers
      include_directories(
          include
      )
      file(GLOB_RECURSE VigraImpex include/impex/)
      add_library(VigraImpex ${VigraImpex})
  
      #LibXml2 Headers
      find_package(LibXml2 REQUIRED)
  
      #Armadillo Headedrs
      find_package(Armadillo REQUIRED)
      include_directories(${ARMADILLO_INCLUDE_DIRS})
  
      #Boost Headers
      find_package(Boost 1.54.0 REQUIRED)
  
  
  
      add_executable(features_slic src/features_slic.cpp)
      target_link_libraries(features_slic
          VigraImpex
          ${ARMADILLO_LIBRARIES}
      )
  </code></pre>
  
  <p>BTW: LibXml2, Armadillo and Boost are all dependencies of the library I am trying to use - <strong>mlpack</strong>. The command <code>find_pakcage(mlpack)</code> won't work because there is no <code>Findmlpack.cmake</code> file on my system anywhere, and I couldn't find one on the internet either.</p>