Skip to content

I. How to build HEIF Source Code

lassehe edited this page Apr 13, 2022 · 10 revisions

Build Guide:

Prerequisites:

  • Prerequisites: cmake and compiler supporting C++11 in PATH.
  • Optional: Doxygen for documentation generation
  • HEIF Source Code repository is cloned. From command line/terminal:
    • git clone https://github.com/nokiatech/heif.git

Compiling under Linux Environment

In order to build HEIF Writer and Reader Library apply the following commands:

cd heif/build
cmake ../srcs
make

Example executable ends up under heif/build/bin/ with libraries under heif/build/lib/.

API headers for libraries are under heif/srcs/api/...

Note that you can provide additional CMake flags for default path and installation path. If they are not provided, default values (based on your Linux distro) applies.

Optional: Generating the documentation:

After the above-listed steps, issue the following commands:

cd heif/docs
cmake .
make

Doxygen documentation created: heif/docs/doxygen_html/index.html

Compiling under Windows Environment (MSVS 2017)

In order to build HEIF Writer and Reader Library using the MSVS, apply the following commands:

cd heif/build
cmake ..\srcs -G "Visual Studio 15 2017 Win64"
cmake --build . --target ALL_BUILD --config Release

or convenience batch file:

cd heif/build
cmake_MSVS2017_Win64.bat

This also creates Visual Studio solution file heif/build/heif.sln

Example executable ends up under heif/build/bin/ with libraries under heif/build/lib/.

API headers for libraries are under heif/srcs/api/...

For other visual studio versions or compilation toolchains list them with cmake:

cd heif/build
cmake --help
cmake ../srcs -G"<Generator listed by above command for your target platform>"
cmake --build .

Compiling for Android (Linux Environment)

Extra prerequisites:

  • Android NDK installed and ANDROID_NDK environment variable defined.

Shell script is provided for convenience (uses Android NDK cmake toolchain file and targets API level 23):

cd heif/build/android
./build.sh

Compiling for iOS (Mac Environment)

Extra prerequisites:

  • Xcode installed.

Shell script is provided for convenience (uses provided cmake ios toolchain file):

cd heif/build/ios
./build.sh