title: CMake undefined reference when using fmt from vcpkg
body: <p>I'm pretty new at VSCode CMake and vcpkg, but I get in trouble when setting up environment.</p>
  <p>Here's CMakeList.txt</p>
  <pre><code>cmake_minimum_required(VERSION 3.0.0)
  project(temp VERSION 0.1.0)
  
  set(CMAKE_TOOLCHAIN_FILE &quot;C:/vcpkg/scripts/buildsystems/vcpkg.cmake&quot;)
  set(VCPKG_TARGET_TRIPLET &quot;x64-windows&quot;)
  
  #include(&quot;C:/Users/dell/vcpkg/scripts/buildsystems/vcpkg.cmake&quot;)
  
  #include(FetchContent)
  
  #FetchContent_Declare(fmt
  #  GIT_REPOSITORY https://github.com/fmtlib/fmt.git
  #  GIT_TAG master
  #)
  
  #FetchContent_MakeAvailable(fmt)
  
  add_executable(temp C++/temp/temp.cpp)
  SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/C++/temp)
  
  find_package(fmt CONFIG REQUIRED)
  target_link_libraries(temp PRIVATE fmt::fmt)
  </code></pre>
  <p>Here's my example for fmt:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &quot;fmt/format.h&quot;
  
  int main() {
      fmt::print(&quot;This is a string {}&quot;, &quot;world&quot;);
  }
  </code></pre>
  <p>Here's error CMake gave:</p>
  <pre><code>[main] Building folder: VS Code Project 
  [build] Starting build
  [proc] Executing command: &quot;C:\Program Files\CMake\bin\cmake.EXE&quot; --build &quot;c:/Users/dell/Desktop/VS Code Project/build&quot; --config Debug --target all -j 14 --
  [build] Consolidate compiler generated dependencies of target temp
  [build] [ 50%] Building CXX object CMakeFiles/temp.dir/C++/temp/temp.cpp.obj
  [build] [100%] Linking CXX executable ..\C++\temp\temp.exe
  [build] E:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\temp.dir/objects.a(temp.cpp.obj): in function `void fmt::v8::print&lt;char const (&amp;) [6]&gt;(fmt::v8::basic_format_string&lt;char, fmt::v8::type_identity&lt;char const (&amp;) [6]&gt;::type&gt;, char const (&amp;) [6])':
  [build] C:/Users/dell/vcpkg/installed/x64-windows/include/fmt/core.h:3208: undefined reference to `__imp__ZN3fmt2v86vprintENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_format_contextINS0_8appenderEcEEEE'
  [build] collect2.exe: error: ld returned 1 exit status
  [build] mingw32-make[2]: *** [CMakeFiles\temp.dir\build.make:100: ../C++/temp/temp.exe] Error 1
  [build] mingw32-make[1]: *** [CMakeFiles\Makefile2:82: CMakeFiles/temp.dir/all] Error 2
  [build] mingw32-make: *** [Makefile:110: all] Error 2
  [build] Build finished with exit code 2
  </code></pre>
  <p>But building with FetchContent works fine, what happened ?</p>