Skip to content

Instantly share code, notes, and snippets.

@UnaNancyOwen
Last active December 23, 2016 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UnaNancyOwen/133341f1d5279e20323e75ffacca4979 to your computer and use it in GitHub Desktop.
Save UnaNancyOwen/133341f1d5279e20323e75ffacca4979 to your computer and use it in GitHub Desktop.
Building FreeType2 with Visual Studio

Building FreeType 2.7.0 with Visual Studio

Download

  1. FreeType 2.7.0(ft27.zip)をダウンロードしてファイルを解凍する。(C:\freetype-2.7)
    https://sourceforge.net/projects/freetype/files/freetype2/2.7/

CMake

  1. ソースコードの入力先とソリューションファイルの出力先を指定する。

    • Where is the source code: C:\freetype-2.7
    • Where is build the binaries: C:\freetype-2.7\build
  2. [Configure]を押してターゲットとなるVisual Studioを選択する。

  3. 各種設定を行う。

    • CMAKE_CONFIGURATION_TYPES Debug;Release
    • CMAKE_INSTALL_PREFIX C:\Program Files\freetype (or C:\Program Files (x86)\freetype)
  4. [Generate]を押してソリューションファイルを出力する。

Build

  1. Visual Studioを管理者権限で起動してFreeType2のソリューションファイル(C:\freetype-2.7\build\freetype.sln)を開く。
    (Visual Studioを管理者権限で起動しないとINSTALLが失敗する。)

  2. FreeType2をビルドする。(ALL_BUILD)

    1. ソリューションの構成(Debug, Release)を設定する。
    2. ソリューションエクスプローラーからALL_BUILDプロジェクトを選択する。
    3. [ビルド]>[ソリューションのビルド]を押してFreeType2をビルドする。
  3. FreeType2をインストールする。(INSTALL)

    1. ソリューションエクスプローラーからINSTALLプロジェクトを選択する。
    2. [ビルド]>[プロジェクトのみ]>[INSTALLのみをビルド]を押してFreeType2をインストールする。
      CMAKE_INSTALL_PREFIXで指定した出力先へ必要なファイルがコピーされる。

Environment Variable

  1. 環境変数FREETYPE_DIRを作成してFreeType2のパス(C:\Program Files\freetype)を設定する。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment