title: Qt Creator vcpkg integration
body: <p>I'm trying to follow this guide, in order to integrate vcpkg with Qt Creator on Windows 10:<br />
  <a href="https://www.qt.io/blog/qt-creator-cmake-package-manager-auto-setup" rel="nofollow noreferrer">https://www.qt.io/blog/qt-creator-cmake-package-manager-auto-setup</a><br />
  The goal is to use libs from vcpkg inside Qt Creator projects.</p>
  <p>Unfortunately <code>find_package</code> does not work. With this CMakeLists.txt:</p>
  <pre><code>cmake_minimum_required(VERSION 3.5)
  
  project(TESTvcpkg LANGUAGES CXX)
  
  set(CMAKE_CXX_STANDARD 11)
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
  
  add_executable(TESTvcpkg main.cpp)
  
  
  find_package(wt REQUIRED)
  target_link_libraries(TESTvcpkg PRIVATE wt::wt)
  </code></pre>
  <p>I get this error:</p>
  <blockquote>
  <p><code>8: error: Target &quot;TESTvcpkg&quot; links to target &quot;wt::wt&quot; but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?</code></p>
  </blockquote>
  <p>If I run <code>vcpkg list</code> from a command prompt I get the list as expected. So the environment variables should be ok.</p>
  <p>The guide talks about <code>vcpkg.json</code> file, but is not clear to me where I have to place it; I placed it inside the project folder:</p>
  <p>{
  &quot;name&quot;: &quot;TESTvcpkg&quot;,
  &quot;version-string&quot;: &quot;0.0.1&quot;,
  &quot;dependencies&quot;: [
  &quot;wt&quot;
  ]
  }</p>
  <p>I have <code>auto-setup.cmake</code> inside the project tree of Qt Creator. The last lines are related with vcpkg:</p>
  <pre><code>#
  # vcpkg
  #
  macro(qtc_auto_setup_vcpkg)
    if (EXISTS &quot;${CMAKE_SOURCE_DIR}/vcpkg.json&quot; AND NOT QT_CREATOR_SKIP_VCPKG_SETUP)
      option(QT_CREATOR_SKIP_VCPKG_SETUP &quot;Skip Qt Creator's vcpkg package manager auto-setup&quot; OFF)
  
      find_program(vcpkg_program vcpkg)
      if (NOT vcpkg_program)
        message(WARNING &quot;Qt Creator: vcpkg executable not found. &quot;
                        &quot;Package manager auto-setup will be skipped. &quot;
                        &quot;To disable this warning set QT_CREATOR_SKIP_VCPKG_SETUP to ON.&quot;)
        return()
      endif()
      get_filename_component(vpkg_root ${vcpkg_program} DIRECTORY)
  
      if (NOT EXISTS &quot;${CMAKE_BINARY_DIR}/vcpkg-dependencies/toolchain.cmake&quot;)
        message(STATUS &quot;Qt Creator: vcpkg package manager auto-setup. &quot;
                       &quot;Skip this step by setting QT_CREATOR_SKIP_VCPKG_SETUP to ON.&quot;)
  
        file(WRITE &quot;${CMAKE_BINARY_DIR}/vcpkg-dependencies/toolchain.cmake&quot; &quot;
          set(CMAKE_C_COMPILER \&quot;${CMAKE_C_COMPILER}\&quot;)
          set(CMAKE_CXX_COMPILER \&quot;${CMAKE_CXX_COMPILER}\&quot;)
          &quot;)
        if (CMAKE_TOOLCHAIN_FILE AND NOT
            CMAKE_TOOLCHAIN_FILE STREQUAL &quot;${CMAKE_BINARY_DIR}/vcpkg-dependencies/toolchain.cmake&quot;)
          file(APPEND &quot;${CMAKE_BINARY_DIR}/vcpkg-dependencies/toolchain.cmake&quot;
            &quot;include(\&quot;${CMAKE_TOOLCHAIN_FILE}\&quot;)\n&quot;)
        endif()
  
        if (VCPKG_TARGET_TRIPLET)
          set(vcpkg_triplet ${VCPKG_TARGET_TRIPLET})
        else()
          if (WIN32)
            set(vcpkg_triplet x64-mingw-static)
            if (CMAKE_CXX_COMPILER MATCHES &quot;cl.exe&quot;)
              set(vcpkg_triplet x64-windows)
            endif()
          elseif(APPLE)
            set(vcpkg_triplet x64-osx)
          else()
            set(vcpkg_triplet x64-linux)
          endif()
        endif()
  
        file(APPEND &quot;${CMAKE_BINARY_DIR}/vcpkg-dependencies/toolchain.cmake&quot; &quot;
          set(VCPKG_TARGET_TRIPLET ${vcpkg_triplet})
          include(\&quot;${vpkg_root}/scripts/buildsystems/vcpkg.cmake\&quot;)
        &quot;)
      endif()
  
      set(CMAKE_TOOLCHAIN_FILE &quot;${CMAKE_BINARY_DIR}/vcpkg-dependencies/toolchain.cmake&quot; CACHE PATH &quot;&quot; FORCE)
    endif()
  endmacro()
  qtc_auto_setup_vcpkg()
  </code></pre>
  <p>Is there something I have to change?</p>
  <p>To obtain Wt, I've used: <code>vcpkg install wt:x64-windows</code> triplet.<br />
  The kit in Qt creator uses Microsoft Visual C++ compiler (AMD64)</p>
  <p><strong>EDIT:</strong>
  changing these parameters, the example <a href="https://www.qt.io/blog/qt-creator-cmake-package-manager-auto-setup" rel="nofollow noreferrer">https://www.qt.io/blog/qt-creator-cmake-package-manager-auto-setup</a> seems to work:
  <a href="https://i.stack.imgur.com/wythc.png" rel="nofollow noreferrer">Qt Creator Screenshot</a></p>