Building libcamera-apps without rebuilding libcamera

You can rebuild libcamera-apps without first rebuilding the whole of libcamera and libepoxy. If you do not need support for the X11/GLES preview window then libepoxy can be omitted entirely. Mostly this will include Raspberry Pi OS Lite users, and they must be sure to use -DENABLE_X11=0 when running cmake later. These users should run:

sudo apt install -y libcamera-dev libjpeg-dev libtiff5-dev


Now proceed directly to the instructions for building libcamera-apps. Raspberry Pi OS Lite users should check that git is installed first 

sudo apt install -y git

-----------------------------------------------------------------------------------------
Building libcamera-apps

First fetch the necessary dependencies for libcamera-apps.

sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev


The libcamera-apps build process begins with the following:

cd
git clone https://github.com/raspberrypi/libcamera-apps.git
cd libcamera-apps
mkdir build
cd build

cmake .. -DENABLE_DRM=1 -DENABLE_X11=0 -DENABLE_QT=0 -DENABLE_OPENCV=0 -DENABLE_TFLITE=0


After executing the cmake command of your choice, the whole process concludes with the following:

make -j4  # use -j1 on Raspberry Pi 3 or earlier devices
sudo make install
sudo ldconfig # this is only necessary on the first build


If you are using an image where libcamera-apps have been previously installed as an apt package, and you want to run the new libcamera-apps executables from the same terminal window where you have just built and installed them, you may need to run hash -r to be sure to pick up the new ones over the system supplied ones. 
