Skip to content

Compile OpenImageIO

Tested on version 2.5.4.0

Requirements

Get OpenImageIO source

You can get OpenImageIO source from here

Build

You need to set some environment variables to help cmake to find dependencies.

You only to set the EnvVariable nor the CMakeVariable, not both.

EnvVariableCMakeVariableValuePkgTested
JPEGTurbo_ROOT and JPEGTurbo_ROOT-Dlibjpeg-turbo_ROOT<LIBJPEDTURBO_CLONE_DIR>/installlibjpeg-turbotrue
Boost_ROOT-DBoost_ROOT<BOOST_CLONE_DIR>/installboosttrue
OpenEXR_ROOT-DOpenEXR_ROOT<OPENEXR_CLONE_DIR>/installOpenEXRtrue
LIBTIFF_ROOT and LD_LIBRARY_PATH to <TIFF_CLONE_DIR>/install/lib-DTIFF_ROOT<TIFF_CLONE_DIR>/installtifftrue
ZLIB_ROOT-DZLIB_ROOT<ZLIB_CLONE_DIR>/installzlibtrue
bash
cmake -S . -B ./build \
 -DBoost_USE_STATIC_LIBS=ON \
 -DCMAKE_INSTALL_PREFIX=<OIIO_SOURCE_DIR>\install \
 -DBoost_ROOT=<BOOST_SOURCE_DIR>\boost-1.83.0\install_prefix \
 -DOpenEXR_ROOT=<OEXR_SOURCE_DIR>\install \
 -DTIFF_ROOT=<LIBTIFF_SOURCE_DIR>\install_prefix \
 -Dlibjpeg-turbo_ROOT=<LIBJPEG-TURBO_SOURCE_DIR>install \
 -DCMAKE_BUILD_TYPE=Release \
 -DZLIB_ROOT=<ZLIB_SOURCE_DIR>\prefix_install \
 -Dpybind11_ROOT=<PYBIND11_SOURCE_DIR>\mock_install \
 -DPython_ROOT=M:\rez_package\python\3.10.5\platform-windows

cmake --build ./build --config Release --target check

All the compiled files will be in <CLONE_DIR>/install And the python module will be in <CLONE_DIR>/install/lib64/python3.10/site-packages

References