Skip to content

Commit

Permalink
Rename IMATH_REPO/TAG to OPENEXR_IMATH_REPO/TAG and update install do…
Browse files Browse the repository at this point in the history
…cs (#1495)

For consistency with ``OPENEXR_DEFLATE_REPO`` and other config options.

Also, add docs section for the ``DEFLATE`` options.

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm authored Jul 28, 2023
1 parent 34fd643 commit da9f785
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 9 deletions.
12 changes: 6 additions & 6 deletions cmake/OpenEXRSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ endif()

option(OPENEXR_FORCE_INTERNAL_IMATH "Force using an internal imath" OFF)
# Check to see if Imath is installed outside of the current build directory.
set(IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING
set(OPENEXR_IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING
"Repo for auto-build of Imath")
set(IMATH_TAG "main" CACHE STRING
set(OPENEXR_IMATH_TAG "main" CACHE STRING
"Tag for auto-build of Imath (branch, tag, or SHA)")
if(NOT OPENEXR_FORCE_INTERNAL_IMATH)
#TODO: ^^ Release should not clone from main, this is a place holder
Expand All @@ -239,14 +239,14 @@ endif()

if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
if(OPENEXR_FORCE_INTERNAL_IMATH)
message(STATUS "Imath forced internal, installing from ${IMATH_REPO} (${IMATH_TAG})")
message(STATUS "Imath forced internal, installing from ${OPENEXR_IMATH_REPO} (${OPENEXR_IMATH_TAG})")
else()
message(STATUS "Imath was not found, installing from ${IMATH_REPO} (${IMATH_TAG})")
message(STATUS "Imath was not found, installing from ${OPENEXR_IMATH_REPO} (${OPENEXR_IMATH_TAG})")
endif()
include(FetchContent)
FetchContent_Declare(Imath
GIT_REPOSITORY "${IMATH_REPO}"
GIT_TAG "${IMATH_TAG}"
GIT_REPOSITORY "${OPENEXR_IMATH_REPO}"
GIT_TAG "${OPENEXR_IMATH_TAG}"
GIT_SHALLOW ON
)

Expand Down
45 changes: 42 additions & 3 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ Imath Dependency

* ``CMAKE_PREFIX_PATH``

The standard CMake path in which to
search for dependencies, Imath in particular. A comma-separated
path. Add the root directory where Imath is installed.
The standard CMake path in which to search for dependencies, Imath
in particular. A comma-separated path. Add the root directory where
Imath is installed.

* ``Imath_DIR``

Expand All @@ -296,6 +296,45 @@ Imath Dependency
file, which is typically the ``lib/cmake/Imath`` folder of the root
install directory.

* ``OPENEXR_IMATH_REPO`` and ``OPENEXR_IMATH_TAG``

The github Imath repo to auto-fetch if an installed library cannot
be found, and the tag to sync it to. The default repo is
``https://github.com/AcademySoftwareFoundation/Imath.git`` and the
tag is specific to the OpenEXR release. The internal build is
configured as a CMake subproject.

* ``OPENEXR_FORCE_INTERNAL_IMATH``

If set to ``ON``, force auto-fetching and internal building of Imath
using ``OPENEXR_IMATH_REPO`` and ``OPENEXR_IMATH_TAG``. This means
do *not* use any existing installation of Imath.

libdeflate Dependency
~~~~~~~~~~~~~~~~~~~~~

As of OpenEXR release v3.2, OpenEXR depends on
`libdeflate <https://github.com/ebiggers/libdeflate>`_ for
DEFLATE-based compression. Previous OpenEXR releases relied on `zlib
<https://www.zlib.net>`_. Builds of OpenEXR can choose either an
libdeflat installation, or CMake can auto-fetch the source and build it
internally. The internal build is linked statically, so no extra
shared object is produced.

* ``OPENEXR_DEFLATE_REPO`` and ``OPENEXR_DEFLATE_TAG``

The github Imath repo to auto-fetch if an installed library cannot
be found, and the tag to sync it to. The default repo is
``https://github.com/ebiggers/libdeflate.git`` and the tag is
``v1.18``. The internal build is configured as a CMake subproject.

* ``OPENEXR_FORCE_INTERNAL_DEFLATE``

If set to ``ON``, force auto-fetching and internal building of
``libdeflate`` using ``OPENEXR_DEFLATE_REPO`` and
``OPENEXR_DEFLATE_TAG``. This means do *not* use any existing
installation of ``libdeflate``.

Namespace Options
~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit da9f785

Please sign in to comment.