title: How can I find installed Boost library on ubuntu using CMake?
body: <p>I've installed Boost using this command</p>
  
  <pre><code>sudo apt-get install libboost-all-dev
  </code></pre>
  
  <p>and I wrote this simple example in main.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;boost/asio.hpp&gt;
  #include &lt;boost/date_time/posix_time/posix_time.hpp&gt;
  
  int main()
  {
    boost::asio::io_service io;
  
    boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
    t.wait();
  
    std::cout &lt;&lt; "Hello, world!" &lt;&lt; std::endl;
  
    return 0;
  }
  </code></pre>
  
  <p>And in my CMakeLists.txt I have this:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  
  find_package(Boost REQUIRED)
  if(NOT Boost_FOUND)
      message(SEND_ERROR "Failed to find Boost")
      return()
  else()
      include_directories(${Boost_INCLUDE_DIR})
  endif()
  
  add_executable(main main.cpp)
  </code></pre>
  
  <p>CMake worked correctly, but after launching with make I got a few errors:</p>
  
  <pre><code>main.cpp:(.text+0x11f): undefined reference to `boost::system::generic_category()'
  </code></pre>
  
  <p>How to correctly include boost in my CMakeLists.txt so that cmake will find libraries ? </p>