title: CMake Visual Studio project dependencies
body: <p>My solution consists of a static library and a console application that uses it.
  The solution is generated from CMakeLists.txt files (top-level file and two files for every project)
  As I know project dependencies in CMake are managed by changing add_subdirectory() order.
  However, it does not work for me</p>
  
  <p>Providing the complete top-level file</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  project(vtun CXX)
  set(TARGET vtun)
  
  set(Boost_DEBUG ON)
  set(Boost_USE_STATIC_LIBS ON)
  set(BOOST_ROOT ${MY_BOOST_DIR}) 
  
  find_package(Boost 1.55.0) 
  
  if(NOT Boost_FOUND)
    message(FATAL_ERROR "Boost libraries are required")
  endif()
  
  add_subdirectory(vtunlib)
  add_subdirectory(console_client)
  </code></pre>
  
  <p>vtunlib project goes first, but anyway *.sln file does not include dependencies information and console_client is always built first</p>
  
  <p>CMake 3.0, Visual Studio 2013 </p>