title: Boost include headers not found using cmake
body: <p>This question is very similar to <a href="https://stackoverflow.com/questions/1065011/why-is-this-boost-header-file-not-included">Why is this boost header file not included</a>, however the hints there don't (seem to) solve my problem.</p>
  
  <p>I got a CMakeLists.txt</p>
  
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
  PROJECT(jetorigin)
  
  SET(Boost_ADDITIONAL_VERSIONS "1.43" "1.43.0" "1.44" "1.44.0" "1.45" "1.45.0")
  SET(BOOST_ROOT "$ENV{HOME}/usr")
  MESSAGE(STATUS "** Search Boost root: ${BOOST_ROOT}")
  FIND_PACKAGE(Boost 1.43 COMPONENTS filesystem regex REQUIRED)
   MESSAGE(STATUS "** Boost Include: ${Boost_INCLUDE_DIR}")
   MESSAGE(STATUS "** Boost Libraries: ${Boost_LIBRARY_DIRS}")
   MESSAGE(STATUS "** Boost Libraries: ${Boost_LIBRARIES}")
  
  INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIR})
  LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
  
  ADD_SUBDIRECTORY(src)
  </code></pre>
  
  <p>And include some boost headers in my code like this:</p>
  
  <pre><code>#include &lt;boost/regex.hpp&gt;
  #include &lt;boost/filesystem.hpp&gt;
  #include &lt;boost/filesystem/fstream.hpp&gt;
  </code></pre>
  
  <p>Now the output from cmake looks ok</p>
  
  <pre><code>-- ** Search Boost root: /home/oli/usr
  -- Boost version: 1.43.0
  -- Found the following Boost libraries:
  --   filesystem
  --   regex
  -- ** Boost Include: /home/oli/usr/include
  -- ** Boost Libraries: /home/oli/usr/lib
  -- ** Boost Libraries: /home/oli/usr/lib/libboost_filesystem.so;/home/oli/usr/lib/libboost_regex.so
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>error: boost/regex.hpp: No such file or directory
  </code></pre>
  
  <p>(and similar for the other includes). Full output from make VERBOSE=1 can be found here <a href="http://pastebin.ca/2039425" rel="nofollow noreferrer">http://pastebin.ca/2039425</a>. It looks as though there is no -I flag added even though Boost_INCLUDE_DIR seems to be set correctly.</p>
  
  <p>I'm using CMake 2.8.1 by the way.
  I would very much appreciate any hints on what is going wrong here..</p>
  
  <hr>
  
  <p>EDIT:
  I've found the problem. Seems I pulled some ancient version of my standard CMakeLists.txt from the depths of my archives. It needs to be:</p>
  
  <pre><code>INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
  </code></pre>
  
  <p>(note the non-capitalized "Boost")...
  Maybe older versions of CMake have been more tolerant in this respect or by bad luck I simply chose to start with a version of my CMakeLists.txt with an unfixed bug..</p>