DJV Download Documentation Contribute Donate Contact

Building on Microsoft Windows

Prerequisites

Preparation

Building FFmpeg

Building with Visual Studio

Building from a command prompt

Prerequisites

The following software is required to build DJV on Windows:

Preparation

Choose a directory to work in, this is where the code will be checked out and built. This directory will be referred to as DJV_BUILD in the rest of the documentation.

Open a command prompt and clone the DJV repository in the DJV_BUILD directory:

> cd DJV_BUILD
> git clone https://github.com/darbyjohnston/DJV.git

Building FFmpeg

Most of the third party software that DJV depends upon is built as part of the CMake build, except for FFmpeg on Windows. Instead the Windows Subsystem for Linux (WSL) is used to compile FFmpeg as a separate step before the CMake build. Note that FFmpeg is an optional dependency for DJV so this step may be skipped if necessary.

Enable the Windows Subsystem for Linux:

Install Ubuntu from the Windows app store, then open a shell and install necessary software:

$ sudo apt update
$ sudo apt install mingw-w64 yasm make unzip

Build FFmpeg; note that the DJV_BUILD path will be different in WSL, forward slashes are used for path separators and drive letters are replaced with mount points (for example "/mnt/c" instead of "C:\"):

[Debug]

$ $DJV_BUILD/DJV/etc/Windows/build_ffmpeg_wsl.sh $DJV_BUILD/DJV-install-Debug
[Release]

$ $DJV_BUILD/DJV/etc/Windows/build_ffmpeg_wsl.sh $DJV_BUILD/DJV-install-Release

Building with Visual Studio

Setup the environment:

Configure CMake:

Start the build:

Try running the DJV application:

After the third party dependencies are built you can speed up build times by using the DJV sub-solution, "DJV_BUILD\DJV-Debug\DJV\src\DJV-build\DJV.sln" for debug builds or "DJV_BUILD\DJV-Release\DJV\src\DJV-build\DJV.sln" for release builds.

Building from a command prompt

Open a Visual Studio x64 command prompt and setup the environment:

[Debug]

> set DJV_BUILD=%CD%
> set PATH=%DJV_BUILD%\DJV-install-Debug\bin;%PATH%
[Release]

> set DJV_BUILD=%CD%
> set PATH=%DJV_BUILD%\DJV-install-Release\bin;%PATH%

Create a directory for the build and configure CMake:

[Debug]

> mkdir DJV-Debug
> cd DJV-Debug
> cmake ..\DJV\etc\SuperBuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=%DJV_BUILD%/DJV-install-Debug -DCMAKE_PREFIX_PATH=%DJV_BUILD%/DJV-install-Debug
[Release]

> mkdir DJV-Release
> cd DJV-Release
> cmake ..\DJV\etc\SuperBuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%DJV_BUILD%/DJV-install-Release -DCMAKE_PREFIX_PATH=%DJV_BUILD%/DJV-install-Release

Start the build:

[Debug]

> cmake --build . --config Debug -j
[Release]

> cmake --build . --config Release -j

Try running the DJV application:

[Debug]

> DJV\src\DJV-build\build\bin\Debug\djv
[Release]

> DJV\src\DJV-build\build\bin\Release\djv

After the third party dependencies are built you can speed up build times using the DJV sub-project:

[Debug]

> cd DJV\src\DJV-build
> cmake --build . --config Debug -j
[Release]

> cd DJV\src\DJV-build
> cmake --build . --config Release -j