UnaNancyOwen
10/23/2017 - 3:11 PM

How to use Qt that installed by Vcpkg with Qt Creator

How to use Qt that installed by Vcpkg with Qt Creator

How to use Qt that installed by Vcpkg with Qt Creator

(0) Install Qt using Vcpkg

Vcpkgを使用してQtをインストールする。(e.g. C:\vcpkg)

cd C:\vcpkg
.\vcpkg install qt5:x64-windows
(.\pkg install qt5:x86-windows)

CMakeを利用している場合、CMakeListsに以下の行を加えます。

set( CMAKE_TOOLCHAIN_FILE "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" )

(1) Download and Install Qt Creator

以下のページからQt Creator(qt-creator-opensource-windows-x86_64-4.4.1.exe)をダウンロード、インストールする。

(2) Setting Qt that installed by Vcpkg to Qt Creator

  1. Qt Creatorのメニューから[Tools]>[Options...]を選択してオプションの設定画面を開く。

  2. オプションの設定画面から[Build & Run]を選択してビルド&実行の設定画面を開く。

  3. ビルド&実行の設定画面から[Qt Versions]タブを開き、[Add]ボタンを押す。
    VcpkgでインストールされたQMmake(vcpkg\installed\<triplet>\tools\qt5\qmake.exe)を選択して開く。

  4. ビルド&実行の設定画面から[Kits]タブを開き、[Add]ボタンを押す。
    以下の欄(Name、Compiler、Qt version)を設定する。

    • Name: Desktop (any name)
    • Compiler:
      • C: "Microsoft Visual C++ Compiler 15.0 (amd64)" (or "Microsoft Visual C++ Compiler 15.0 (amd64_x86)")
      • C++: "Microsoft Visual C++ Compiler 15.0 (amd64)" (or "Microsoft Visual C++ Compiler 15.0 (amd64_x86)")
    • Qt version: Qt 5.8.0 (qt5)

  5. [Apply]ボタンを押して設定を適用する。