1
1

More than 3 years have passed since last update.

【UE4】プロジェクトファイル作成をコマンドラインで行う方法+UE4.25での対策

Posted at

本題の主旨

Windows C++ プロジェクトファイルを生成する場合、通常は *.uproject ファイルを右クリックして "Generate Visual Studio project files" で生成します。
これをコマンドラインで行う方法と UE4.25 での注意点を説明します。

UE4.25までの内容です。

プロジェクトファイルを生成

  • <UBTPath> -projectfiles <ProjectPath> - エディタで指定されたプロジェクトを生成する
  • <UBTPath> -projectfiles <ProjectPath> -2019 - VS2019 プロジェクトファイルを生成
  • <UBTPath> -projectfiles <ProjectPath> -Code - VSCode プロジェクトファイルを生成

略称表記の定義

  • <UBTPath> : c:\Program Files\Epic Games\<UEVersion>\Engine\Binaries\DotNET\UnrealBuildTool.exe
  • <UEVersion> : UEのバージョン。例: UE_4.24
  • <ProjectPath> : 対象のプロジェクトファイルへのフルパス

UE4.25の場合

上記の方法で生成することはできますが、引数でプロジェクトファイルを生成した場合は警告が出て以下の対応策を提示されます。

WARNING: Project file formats specified via the command line will be ignored when generating
         project files from the editor and other engine tools.

         Consider setting your desired IDE from the editor preferences window, or modify your
         BuildConfiguration.xml file with:

         <?xml version="1.0" encoding="utf-8" ?>
         <Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
           <ProjectFileGenerator>
             <Format>VisualStudio2019</Format>
           </ProjectFileGenerator>
         </Configuration>

"コマンドライン引数ではなく BuildConfiguration.xml で対象を指定してね" とのことです。

BuildConfiguration.xml は ビルド コンフィギュレーション | Unreal Engine Documentation に記載されている箇所に置くことで読み込まれます。

注意点

この設定はエディタで指定されたプロジェクトの種類の設定より優先されるため、必要な時以外は記述しないほうが良いかもしれません。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1