OGRE build error: freetype package could not be located

FreeType error in CMake GUI
FreeType error in CMake GUI


I was trying to build OGRE on Ubuntu:

$ mkdir build
$ cd build
$ cmake ..

CMake threw this error:

CMake Error at CMake/Utils/MacroLogFeature.cmake:100 (MESSAGE):
  -- The following REQUIRED packages could NOT be located on your system.
  -- Please install them before continuing this software installation.
  -- If you are in Windows, try passing -DOGRE_DEPENDENCIES_DIR=<path to dependencies>
  + freetype: Portable font engine <http://www.freetype.org>

CMake complained that it could not find the FreeType package. But, I had already installed both the libfreetype6 and libfreetype6-dev packages.


The dependency on FreeType is listed in the CMake/Dependencies.cmake file in the OGRE source. OGRE seems to be using its own CMake script to find FreeType located at CMake/Packages/FindFreetype.cmake. This script seems to be failing to locate some file or directory of FreeType, even though it is installed.

I solved this by opening the CMake GUI:

$ cmake-gui ..

Enable Advanced and Grouped so that its easy to view the results. Click Configure. The same FreeType error is thrown up. But, now we can see that for some reason the FREETYPE_INCLUDE_DIR is not being found. I set this to /usr/include/freetype2. Click Configure again and the error is gone. Then click Generate. Compilation worked fine after this.

Tried with: OGRE 1.8 and Ubuntu 14.04


2 thoughts on “OGRE build error: freetype package could not be located

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.