tahoma2d/doc/how_to_build_win_ja.md
Shinya Kitaoka fd19c4eedf Support Visual Studio 2015 (#544)
* Small changes, for some reason VS 2015 can't link cprintf and they added a second function std::map::count and bind couldn't resolve the function. Substituted with a lambda-expression.

* Created all 64bit version of the 3rd party libs.

* Cleanup popup opens CleanupSettings instead of CleanupSettingsPane. Not finished, panel is wrong now (also uses CleanupSettings).

* Tried to get Twain working, failed.

* When there are more then 3 peg holes create additional holes.

* When a hole touches the boundary it should still be considered a hole.

* Do not compare dot size against fixed size. Will not work in some scan resolutions. Used the same value (PERCENT * max dot size) as later in the code in compare_dots.

* When there are more than three peg holes the code looked for the best fit and used that. The problem was, that the middle hole was used as center for auto center. For three peg holes that is correct, but does not work for more than three. Now the best fit is calculated and from there the offset of the middle of the three best fit holes is calculated and applied.

* One of the last changes broke VS2015 compatibility, it chocked on a missing include.

* fix for msvs2013

* revert autopos.cpp

* apply clang-format

* use GIT-LFS
2016-07-04 17:50:30 +09:00

7.8 KiB
Raw Blame History

ビルド手順Windows

Visual Studio 2013とQt 5.6でビルドできることを確認しています。

必要なソフトウェアの導入

Visual Studio Express 2013 for Windows Desktop

CMake

ソースコードの取得

  • 本リポジトリをcloneします
  • 以下の説明中の$opentoonzは、本リポジトリのrootを表します
  • Visual Studio 2013はBOMの無いUTF-8のソースコードを正しく認識できず、改行コードがLFで、1行コメントの末尾が日本語の場合に、改行が無視されて次の行もコメントとして扱われる問題があるため、Gitに下記の設定をして改行コードをCRLFに変換すると良いでしょう
    • git config core.safecrlf true

必要なライブラリのインストール

サイズの大きいライブラリはこのリポジトリには含めていないので、別途インストールする必要があります。

Qt

  • http://download.qt.io/official_releases/qt/5.6/5.6.0/
  • クロスプラットフォームのGUIフレームワークです
  • 現在はQt 5.6には対応していません
  • 上記のURLから以下のファイルをダウンロードして適当なフォルダにインストールします
    • qt-opensource-windows-x86-msvc2013_64-5.6.0.exe

boost

ビルド

CMakeでVisual Studioのプロジェクトを生成する

  1. CMakeを立ち上げる
  2. Where is the source codeに$opentoonz/toonz/sourcesを指定する
  3. Where to build the binariesに$opentoonz/toonz/buildを指定する
  • 他の場所でも構いません
  • チェックアウトしたフォルダ内に作成する場合は、buildから開始するフォルダ名にするとgitから無視されます
  • ビルド先を変更した場合は、以下の説明を適宜読み替えてください
  1. Configureをクリックして、Visual Studio 12 2013 Win64を選択します
  2. Qtのインストール先がデフォルトではない場合、Specify QT_PATH properlyというエラーが表示されるので、QT_DIRにQt5をインストールしたフォルダ内のmsvc2013_64のパスを指定します
  3. Generateをクリック
  • CMakeLists.txtに変更があった場合は、ビルド時に自動的に処理が走るので、以降はCMakeを直接使用する必要はありません

ライブラリの設定

下記のファイルをコピーします

  • $opentoonz/thirdparty/LibJPEG/jpeg-9/jconfig.vc$opentoonz/thirdparty/LibJPEG/jpeg-9/jconfig.h
  • $opentoonz/thirdparty/tiff-4.0.3/libtiff/tif_config.vc.h$opentoonz/thirdparty/tiff-4.0.3/libtiff/tif_config.h
  • $opentoonz/thirdparty/tiff-4.0.3/libtiff/tiffconf.vc.h$opentoonz/thirdparty/tiff-4.0.3/libtiff/tiffconf.h
  • $opentoonz/thirdparty/libpng-1.6.21/scripts/pnglibconf.h.prebuilt$opentoonz/thirdparty/libpng-1.6.21/pnglibconf.h

tif_config.h の 50 行目あたりに下記の修正を加えます:

+#if _MSC_VER < 1900
#define snprintf _snprintf
+#endif

ビルド

  1. $opentoonz/toonz/build/OpenToonz.slnを開いてRelease構成を選択してビルドします
  2. $opentoonz/toonz/build/Releaseにファイルが生成されます

実行

実行可能ファイルなどの配置

  1. $oepntoonz/toonz/build/Releaseの中身を適当なフォルダにコピーします
  2. OpenToonz_1.0.exeのパスを引数にしてQtに付属のwindeployqt.exeを実行します
  • 必要なQtのライブラリなどがOpenToonz_1.0.exeと同じフォルダに集められます
  1. 下記のファイルをOpenToonz_1.0.exeと同じフォルダにコピーします
  • $opentoonz/thirdparty/glut/3.7.6/lib/glut64.dll
  • $opentoonz/thirdparty/glew/glew-1.9.0/bin/64bit/glew32.dll
  1. バイナリ版のOpenToonzのインストール先にあるsrvフォルダをOpenToonz_1.0.exeと同じフォルダにコピーします
  • srvが無くてもOpenToonzは動作しますが、mov形式などに対応できません
  • srv内のファイルの生成方法は後述します

Stuffフォルダの作成

既にバイナリ版のOpenToonzをインストールしている場合、この手順とレジストリキーの作成と同様の処理が行われているため、これらの手順は不要です。

  1. $opentoonz/stuffを適当なフォルダにコピーします

レジストリキーの作成

  1. レジストリエディタで下記のキーを作成し、Stuffフォルダの作成でコピーしたstuffフォルダのパスを記載します
  • HKEY_LOCAL_MACHINE\SOFTWARE\OpenToonz\OpenToonz\1.0\TOONZROOT

実行

OpenToonz_1.0.exeを実行して動作すれば成功です。おめでとうございます。

srvフォルダ内のファイルの生成

OpenToonzはQuickTime SDKを用いてmov形式などへ対応しています。QuickTime SDKは32ビット版しかないため、t32bitsrv.exeという32ビット版の実行可能ファイルにQuickTime SDKを組み込み、64ビット版のOpenToonzはt32bitsrv.exeを経由してQuickTime SDKの機能を使用しています。以下の手順ではt32bitsrv.exeなどと合わせて、32ビット版のOpenToonzも生成されます。

Qt

QuickTime SDK

  1. Appleの開発者登録をして下記のURLからQuickTime 7.3 SDK for Windows.zipをダウンロードします
  1. QuickTime SDKをインストールして、C:\Program Files (x86)\QuickTime SDKの中身をthirdparty/quicktime/QT73SDKの中にコピーします

CMakeでVisual Studioの32ビット版のプロジェクトを生成する

  • 64ビット版と同様の手順で、次のようにフォルダ名とターゲットを読み替えます
    • $opentoonz/toonz/build$opentoonz/toonz/build32
    • Visual Studio 12 2013 Win64 → Visual Studio 12 2013
  • QT_DIRには32ビット版のQtのパスを指定します

32ビット版のビルド

  1. $opentoonz/toonz/build32/OpenToonz.slnを開いてビルドします

srvフォルダの配置

  • 64ビット版のsrvフォルダの中に下記のファイルをコピーします
    • $opentoonz/toonz/build32/Releaseから
      • t32bitsrv.exe
      • image.dll
      • tnzcore.dll
    • Qtの32ビット版のインストール先から
      • Qt5Core.dll
      • Qt5Network.dll
    • $opentoonz/thirdparty/glut/3.7.6/lib/glut32.dll

翻訳ファイルの生成

Qtの翻訳ファイルは、ソースコードから.tsファイルを生成して、.tsファイルに対して翻訳作業を行い、.tsファイルから.qmファイルを生成します。Visual Studioソリューション中のtranslation_から始まるプロジェクトに対して「translation_???のみをビルド」を実行すると、.tsファイルと.qmファイルの生成が行われます。これらのプロジェクトはソリューションのビルドではビルドされないようになっています。