Installing exiv2 on Mac with Apple Silicon (M1/M2)
Exiv2 Installation Guide — Last updated on 2023–03–15
Exiv2 is a command line tool and a library that helps in manipulating exif tags that are embedded within digital photos. Learn more about exiv2 here. Exiv2 is open source and powers many popular open source tools like darktable.
As it stands, exiv2 hosts builds for Intel Mac and does not currently host builds for Apple Silicon Mac. You can install exiv2 using homebrew or MacPorts. This guide helps you install exiv2 command line tool by building locally.
Pre-requisites
Local build requires installing CMake
(Download CMake.- https://cmake.org/download/ and install on your MacBook)
Step 1:
Download source — https://exiv2.org/download.html
Step 2:
Uncompress exiv2 source to a local folder
Step 3:
Create a sub-directory in the source folder and name it “build”
Step 4:
Configure using CMake
- Select source folder location
- Select build folder location
- Add environment entry CMAKE_BUILD_TYPE=Release as shown below
- Once you add the environment variable above, press Configure. You should see auto discovered environment variables along with your environment variable.
Turn on EXIV2_ENABLE_BMFF flag. This flag enables support for HEIC files generated by Apple iPhone Camera.
Step 5
You are now ready to build your exiv2 binary locally. Open Terminal app on your mac, navigate to your build directory in Terminal and type the following
/Applications/CMake.app/Contents/bin/cmake --build .
Step 6
Copy the binary manually as shown below
cp ./bin/exiv2 /usr/local/bin/
OR
install using included script. This will install the library into the “standard locations”. The library will be installed in /usr/local/lib
, executables (including the exiv2 command-line program) in /usr/local/bin/
and header files in /usr/local/include/exiv2
/Applications/CMake.app/Contents/bin/cmake --install .