The following software is required to build DJV on macOS:
You can install CMake and git with Homebrew. Follow the instructions at the link to install Homebrew and then run:
$ brew install git $ brew install cmake
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 shell and clone the DJV repository in the DJV_BUILD directory:
$ cd $DJV_BUILD $ git clone https://github.com/darbyjohnston/DJV.git
Setup the environment:
[Debug] $ export DJV_BUILD=$PWD $ export PATH=$DJV_BUILD/DJV-install-Debug/bin:$PATH $ export DYLD_LIBRARY_PATH=$DJV_BUILD/DJV-install-Debug/lib:$DYLD_LIBRARY_PATH
[Release] $ export DJV_BUILD=$PWD $ export PATH=$DJV_BUILD/DJV-install-Release/bin:$PATH $ export DYLD_LIBRARY_PATH=$DJV_BUILD/DJV-install-Release/lib:$DYLD_LIBRARY_PATH
This is the recommended way to build DJV, this builds both DJV and the third party software that DJV depends upon.
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 -DCMAKE_FIND_FRAMEWORK="LAST"
[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 -DCMAKE_FIND_FRAMEWORK="LAST"
Start a parallel build using 8 cores:
$ cmake --build . -j 8
Try running the DJV player application:
$ ./DJV/src/DJV-build/build/bin/djv
After the third party dependencies are built you can speed up build times using the DJV sub-project:
$ cd ./DJV/src/DJV-build $ cmake --build . -j 8
This builds DJV using the third party software provided by the system.
Create a directory for the build and configure CMake:
[Debug] $ mkdir DJV-Debug $ cd DJV-Debug $ cmake ../DJV -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$DJV_BUILD/DJV-install-Debug -DCMAKE_PREFIX_PATH=$DJV_BUILD/DJV-install-Debug -DCMAKE_FIND_FRAMEWORK="LAST"
[Release] $ mkdir DJV-Release $ cd DJV-Release $ cmake ../DJV -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$DJV_BUILD/DJV-install-Release -DCMAKE_PREFIX_PATH=$DJV_BUILD/DJV-install-Release -DCMAKE_FIND_FRAMEWORK="LAST"
Start a parallel build using 8 cores:
$ cmake --build . -j 8
Try running the confidence tests to make sure everything is working OK:
$ cmake --build . -j 8 --target test
Try running the DJV player application:
$ ./build/bin/djv