title: how to link libraries in vcpkg to my library using cmake?
body: <p>I am trying to use cmake and vcpkg to write a project in vs2019 recently.</p>
  <p>I want to link the dynamic library in vcpkg to my own dynamic library, but I have encountered some troubles.</p>
  <p>I hope someone can help me correct the mistake.</p>
  <p>My project structure:</p>
  <pre><code>project
  -engine
   -Engine.h
   -Engine.cpp
   -Window.h
   -Window.cpp
   -InstanceManager.h
   -InstanceManager.cpp
   -MouseListener.h
   -MouseListener.cpp
   -KeyboardListener.h
   -KeyboardListener.cpp
  -main.cpp
  -CMakeLists.txt
  </code></pre>
  <p>CMakeLists.txt:</p>
  <pre><code>cmake_minimum_required (VERSION 3.8)
  
  project (&quot;mario&quot;)
  
  include_directories(&quot;./engine&quot;)
  
  find_package(GLEW REQUIRED)
  find_package(glfw3 CONFIG REQUIRED)
  
  add_executable (mario main.cpp)
  
  add_library(engine SHARED
  &quot;engine/Engine.h&quot; &quot;engine/Engine.cpp&quot; 
  &quot;engine/Window.h&quot; &quot;engine/Window.cpp&quot;
  &quot;engine/InstanceManager.h&quot; &quot;engine/InstanceManager.cpp&quot; 
  &quot;engine/MouseListener.h&quot; &quot;engine/MouseListener.cpp&quot; 
  &quot;engine/KeyboardListener.h&quot; &quot;engine/KeyboardListener.cpp&quot;)
  
  target_link_libraries(engine PRIVATE GLEW::GLEW)
  target_link_libraries(engine PRIVATE glfw)
  
  target_link_libraries(mario PRIVATE engine)
  </code></pre>
  <p>It shows C1083 cannot open include file “gl/glew.h”: No such file or directory.
  However, when I write this:</p>
  <pre><code>cmake_minimum_required (VERSION 3.8)
  
  project (&quot;mario&quot;)
  
  include_directories(&quot;./engine&quot;)
  
  find_package(GLEW REQUIRED)
  find_package(glfw3 CONFIG REQUIRED)
  
  add_executable (mario main.cpp
  &quot;engine/Engine.h&quot; &quot;engine/Engine.cpp&quot; 
  &quot;engine/Window.h&quot; &quot;engine/Window.cpp&quot;
  &quot;engine/InstanceManager.h&quot; &quot;engine/InstanceManager.cpp&quot; 
  &quot;engine/MouseListener.h&quot; &quot;engine/MouseListener.cpp&quot; 
  &quot;engine/KeyboardListener.h&quot; &quot;engine/KeyboardListener.cpp&quot;)
  
  target_link_libraries(mario PRIVATE GLEW::GLEW)
  target_link_libraries(mario PRIVATE glfw)
  </code></pre>
  <p>It works fine.</p>
  <p>Is this a bug or I made mistakes?</p>