このページでは

CMake 設定ファイルの編集

CMakeLists.txt ファイルを編集用に開くには、Projects ビューでファイルを右クリックし、Open With >CMake Editor を選択します。

また、ロケーターで cmo フィルタを使用して、現在の実行設定のCMakeLists.txt ファイルをエディターで開くこともできます。これは、BuildBuild for Run Configuration を選択した場合と同じビルドターゲットです。

以下の機能がサポートされています:

  • にカーソルがあるときにF2 を選択する:
    • ファイル名 - ファイルを開きます。
    • CMake 関数、マクロ、オプション、ターゲット、CMake の検索またはインクルードモジュール、set またはlist で作成されたローカル変数、またはパッケージ - その項目に移動します。
  • キーワード補完
  • ローカル関数と変数、キャッシュ変数、ENV 、ターゲット、パッケージ、find_package が追加する変数のコード補完。
  • CMake の印刷プロパティや変数の設定、Qt コンソールや GUI アプリケーションの作成、サンプル Find モジュールの作成のための定義済みコードスニペット。
  • パスの補完
  • 自動インデント
  • 括弧と引用符のマッチング

警告とエラーはIssues で表示されます。

不足している Qt パッケージのインストール

find_package で追加した Qt モジュールがインストールされていない場合、Qt CreatorQt Online Installer でインストールするかどうかを尋ねます。

不足しているQtパッケージのインストール

Qt Online Installer でパッケージをインストールするには、Yes を選択します。

How To: Build with CMakeCMakeCompletionSnippetsも参照してください

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.