Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa521922c9 | ||
|
+3 |
92db29b9e7 | ||
|
|
b35fb73b86 | ||
|
|
caa20dd196 | ||
|
|
f885f8378e | ||
|
|
957ccd513b | ||
|
|
6fc9f1f8da | ||
|
|
0872a69d05 | ||
|
|
8854e13604 | ||
|
|
f9de269fc9 | ||
|
|
96f528fdfb | ||
|
|
de6d62d9fb | ||
|
|
7ff912d748 | ||
|
|
47d758a73b | ||
|
|
929d5364c4 | ||
|
|
9221ffadb8 | ||
|
|
9cc2486559 | ||
|
|
84948c773f | ||
|
|
bdc4cd1241 | ||
|
|
f26df74417 | ||
|
|
93ee2cc8a4 | ||
|
|
6dec6b23a7 | ||
|
|
16b180240f | ||
|
|
8e801dc07b | ||
|
|
6bf2dc0bb8 | ||
|
|
454b502cce | ||
|
|
219ac86ef6 | ||
|
|
a5a6be55c7 | ||
|
|
f0a181a00f | ||
|
|
a12ce22125 | ||
|
|
5d49864dca | ||
|
|
01f2175087 | ||
|
|
22f5ee00c1 | ||
|
|
9659603d9e | ||
|
|
9d0a5a4ff3 | ||
|
|
28a4b3a8ad | ||
|
|
20f13dec67 | ||
|
|
e93efe3b70 | ||
|
|
9d572cfab7 | ||
|
|
f651a1aed9 | ||
|
|
3797a92481 | ||
|
|
b848482642 | ||
|
|
91761f256b | ||
|
|
17f5c98f9b | ||
|
|
5152635a18 | ||
|
|
051241c9f1 | ||
|
|
1d126b56e9 | ||
|
|
6d7c4791f1 | ||
|
|
907ed3be17 | ||
|
|
332462e7f5 | ||
|
|
4fa775030a | ||
|
|
811902b37d | ||
|
|
b6e40f4fca | ||
|
|
d5cedbf551 | ||
|
|
a00a48ff35 |
@@ -22,372 +22,6 @@ on:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------------------------------------------
|
||||
# Linux latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
linux_latest:
|
||||
name: 'Linux CentOS 7 VFX CY${{ matrix.vfx-cy }} latest
|
||||
<${{ matrix.compiler-desc }}
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
docs=${{ matrix.build-docs }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-base:${{ matrix.vfx-cy }}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# GCC
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2022, C++17, docs, OpenFX
|
||||
- build: 1
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 9.3.1
|
||||
vfx-cy: 2022
|
||||
# VFX CY2021, C++14
|
||||
- build: 2
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 9.3.1
|
||||
vfx-cy: 2021
|
||||
# -------------------------------------------------------------------
|
||||
# Clang
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2022, C++17
|
||||
- build: 3
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 9
|
||||
vfx-cy: 2022
|
||||
# VFX CY2021, C++14, docs, OpenFX
|
||||
- build: 4
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 9
|
||||
vfx-cy: 2021
|
||||
env:
|
||||
CXX: ${{ matrix.cxx-compiler }}
|
||||
CC: ${{ matrix.cc-compiler }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/linux/yum/install_docs_env.sh
|
||||
if: matrix.build-docs == 'ON'
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/linux/yum/install_tests_env.sh
|
||||
- name: Setup ext environment
|
||||
run: |
|
||||
EXT_PATH=/usr/local
|
||||
echo "EXT_PATH=$EXT_PATH" >> $GITHUB_ENV
|
||||
- name: Install indirect dependencies
|
||||
run: |
|
||||
share/ci/scripts/multi/install_pugixml.sh latest
|
||||
- name: Install fixed ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH
|
||||
share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH
|
||||
- name: Install latest ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_imath.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openexr.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_oiio.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_osl.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openfx.sh latest $EXT_PATH
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=NONE \
|
||||
-DOCIO_WARNING_AS_ERROR=OFF \
|
||||
-DPython_EXECUTABLE=$(which python) \
|
||||
-DOCIO_USE_OIIO_CMAKE_CONFIG=ON
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
-- -j$(nproc)
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C Release
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . \
|
||||
--config Release
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# MacOS latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
macos-latest:
|
||||
name: 'macOS latest
|
||||
<AppleClang 12.0
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
docs=${{ matrix.build-docs }},
|
||||
python=${{ matrix.python-version }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
include:
|
||||
# C++17
|
||||
- build: 1
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 17
|
||||
python-version: 3.9
|
||||
# C++14
|
||||
- build: 2
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 14
|
||||
python-version: 3.9
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/macos/install_docs_env.sh
|
||||
if: matrix.build-docs == 'ON'
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/macos/install_tests_env.sh
|
||||
- name: Setup ext environment
|
||||
run: |
|
||||
EXT_PATH=/usr/local
|
||||
echo "EXT_PATH=$EXT_PATH" >> $GITHUB_ENV
|
||||
- name: Install indirect dependencies
|
||||
run: |
|
||||
share/ci/scripts/macos/install_bison.sh latest
|
||||
share/ci/scripts/macos/install_boost.sh latest
|
||||
share/ci/scripts/multi/install_pugixml.sh latest $EXT_PATH
|
||||
- name: Install fixed ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH
|
||||
share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH
|
||||
- name: Install latest ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_imath.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openexr.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_oiio.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_osl.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openfx.sh latest $EXT_PATH
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=NONE \
|
||||
-DOCIO_WARNING_AS_ERROR=OFF \
|
||||
-DPython_EXECUTABLE=$(which python) \
|
||||
-DOCIO_USE_OIIO_CMAKE_CONFIG=ON
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
-- -j$(sysctl -n hw.ncpu)
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C Release
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . \
|
||||
--config Release
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Windows latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
windows-latest:
|
||||
name: 'Windows latest
|
||||
<MSVC
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
docs=${{ matrix.build-docs }},
|
||||
python=${{ matrix.python-version }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
include:
|
||||
# C++17
|
||||
- build: 1
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 17
|
||||
python-version: 3.9
|
||||
# C++14
|
||||
- build: 2
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 14
|
||||
python-version: 3.9
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/windows/install_docs_env.sh
|
||||
shell: bash
|
||||
if: matrix.build-docs == 'ON'
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/windows/install_tests_env.sh
|
||||
shell: bash
|
||||
- name: Setup ext environment
|
||||
run: |
|
||||
EXT_PATH=$GITHUB_WORKSPACE/_ext
|
||||
VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT/installed/x64-windows
|
||||
echo "EXT_PATH=$EXT_PATH" >> $GITHUB_ENV
|
||||
echo "CMAKE_PREFIX_PATH=$VCPKG_ROOT;$EXT_PATH" >> $GITHUB_ENV
|
||||
echo "$VCPKG_ROOT/bin" >> $GITHUB_PATH
|
||||
echo "$EXT_PATH/bin" >> $GITHUB_PATH
|
||||
mkdir $EXT_PATH
|
||||
shell: bash
|
||||
- name: Install indirect dependencies
|
||||
run: |
|
||||
vcpkg install zlib:x64-windows
|
||||
vcpkg install tiff:x64-windows
|
||||
vcpkg install boost-asio:x64-windows
|
||||
vcpkg install boost-container:x64-windows
|
||||
vcpkg install boost-filesystem:x64-windows
|
||||
vcpkg install boost-math:x64-windows
|
||||
vcpkg install boost-stacktrace:x64-windows
|
||||
vcpkg install boost-system:x64-windows
|
||||
vcpkg install boost-thread:x64-windows
|
||||
share/ci/scripts/multi/install_pugixml.sh latest $EXT_PATH
|
||||
shell: bash
|
||||
- name: Install fixed ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH
|
||||
shell: bash
|
||||
# OSL not installed due to LLVM compilation time.
|
||||
- name: Install latest ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_imath.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openexr.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_oiio.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openfx.sh latest $EXT_PATH
|
||||
shell: bash
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
shell: bash
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_GENERATOR_PLATFORM=x64 \
|
||||
-DOCIO_BUILD_DOCS=OFF \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=NONE \
|
||||
-DOCIO_WARNING_AS_ERROR=OFF \
|
||||
-DPython_EXECUTABLE=$(which python) \
|
||||
-DOCIO_BUILD_PYTHON=OFF \
|
||||
-DOCIO_USE_OIIO_CMAKE_CONFIG=ON
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
--parallel
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -V -C Release
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . \
|
||||
--config Release
|
||||
export PATH=../../../_install/bin:$PATH
|
||||
./Release/consumer
|
||||
shell: bash
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# SonarCloud static analysis
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -395,9 +29,7 @@ jobs:
|
||||
linux_sonarcloud:
|
||||
name: 'Linux CentOS 7 VFX CY2022 SonarCloud <GCC 9.3.1>'
|
||||
# Don't run on OCIO forks
|
||||
if: |
|
||||
github.repository == 'AcademySoftwareFoundation/OpenColorIO' &&
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
@@ -409,7 +41,7 @@ jobs:
|
||||
CC: gcc
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 50
|
||||
- name: Install docs env
|
||||
|
||||
+249
-209
@@ -44,7 +44,7 @@ jobs:
|
||||
<${{ matrix.compiler-desc }}
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
sse=${{ matrix.use-sse }},
|
||||
simd=${{ matrix.use-simd }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
docs=${{ matrix.build-docs }},
|
||||
oiio=${{ matrix.use-oiio }}>'
|
||||
@@ -60,202 +60,182 @@ jobs:
|
||||
image: aswf/ci-ocio:${{ matrix.vfx-cy }}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
|
||||
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2022 (Python 3.9)
|
||||
# VFX CY2023 (Python 3.10)
|
||||
# -------------------------------------------------------------------
|
||||
# C++17, Clang, Debug, OpenFX
|
||||
- build: 13
|
||||
- build: 12
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 9
|
||||
vfx-cy: 2022
|
||||
# C++17, GCC, no SSE, OpenFX
|
||||
- build: 12
|
||||
compiler-desc: Clang
|
||||
vfx-cy: 2023
|
||||
install-ext-packages: MISSING
|
||||
- build: 11
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'OFF'
|
||||
use-simd: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 9.3.1
|
||||
vfx-cy: 2022
|
||||
# C++14, GCC, static, docs
|
||||
- build: 11
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 9.3.1
|
||||
vfx-cy: 2022
|
||||
# C++11, GCC, static
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2023
|
||||
install-ext-packages: ALL
|
||||
- build: 10
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 9.3.1
|
||||
vfx-cy: 2022
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2023
|
||||
install-ext-packages: ALL
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2021 (Python 3.7)
|
||||
# VFX CY2022 (Python 3.9)
|
||||
# -------------------------------------------------------------------
|
||||
# C++17, Clang
|
||||
- build: 9
|
||||
build-type: Release
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
build-openfx: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 9
|
||||
vfx-cy: 2021
|
||||
# C++14, Clang, static, no SSE, OpenFX
|
||||
compiler-desc: Clang
|
||||
vfx-cy: 2022
|
||||
install-ext-packages: ALL
|
||||
- build: 8
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
use-simd: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2022
|
||||
install-ext-packages: MISSING
|
||||
- build: 7
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 9
|
||||
vfx-cy: 2021
|
||||
# C++11, GCC, Debug
|
||||
- build: 7
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 9.3.1
|
||||
vfx-cy: 2021
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2022
|
||||
install-ext-packages: ALL
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2020 (Python 3.7)
|
||||
# VFX CY2021 (Python 3.7)
|
||||
# -------------------------------------------------------------------
|
||||
# C++14, Clang, OpenFX
|
||||
- build: 6
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang
|
||||
vfx-cy: 2021
|
||||
install-ext-packages: MISSING
|
||||
- build: 5
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'OFF'
|
||||
use-simd: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 7
|
||||
vfx-cy: 2020
|
||||
# C++14, GCC, static, Debug, OpenFX
|
||||
- build: 5
|
||||
build-type: Debug
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 6.3.1
|
||||
vfx-cy: 2020
|
||||
# C++11, GCC, no SSE
|
||||
compiler-desc: Clang
|
||||
vfx-cy: 2021
|
||||
install-ext-packages: ALL
|
||||
- build: 4
|
||||
build-type: Release
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 6.3.1
|
||||
vfx-cy: 2020
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2021
|
||||
install-ext-packages: ALL
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2019 (Python 2.7)
|
||||
# VFX CY2020 (Python 3.7)
|
||||
# -------------------------------------------------------------------
|
||||
# C++11, Clang, static
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
# Doc build requires Python 3
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 11
|
||||
build-openfx: 'ON'
|
||||
use-simd: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 7
|
||||
vfx-cy: 2019
|
||||
# C++11, Clang, Debug, no SSE
|
||||
compiler-desc: Clang
|
||||
vfx-cy: 2020
|
||||
install-ext-packages: MISSING
|
||||
- build: 2
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
# Doc build requires Python 3
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang 7
|
||||
vfx-cy: 2019
|
||||
# C++11, GCC, OpenFX
|
||||
build-openfx: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2020
|
||||
install-ext-packages: ALL
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
# Doc build requires Python 3
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
build-openfx: 'OFF'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC 6.3.1
|
||||
vfx-cy: 2019
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2020
|
||||
install-ext-packages: ALL
|
||||
env:
|
||||
CXX: ${{ matrix.cxx-compiler }}
|
||||
CC: ${{ matrix.cc-compiler }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
# minizip-ng requires CMake 3.13+ but VFX2019 image ships with 3.12
|
||||
- name: Upgrade VFX2019 CMake
|
||||
run: pip install cmake==3.13.3
|
||||
if: matrix.vfx-cy == '2019'
|
||||
uses: actions/checkout@v3
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/linux/yum/install_docs_env.sh
|
||||
if: matrix.build-docs == 'ON'
|
||||
@@ -275,9 +255,9 @@ jobs:
|
||||
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_USE_SSE=${{ matrix.use-sse }} \
|
||||
-DOCIO_USE_SIMD=${{ matrix.use-simd }} \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }} \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=${{ matrix.install-ext-packages }} \
|
||||
-DOCIO_WARNING_AS_ERROR=ON \
|
||||
-DPython_EXECUTABLE=$(which python)
|
||||
working-directory: _build
|
||||
@@ -287,11 +267,12 @@ jobs:
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }} \
|
||||
-- -j$(nproc)
|
||||
echo "ocio_build_path=$(pwd)" >> $GITHUB_ENV
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
- name: Test CMake Consumer with shared OCIO
|
||||
if: matrix.build-shared == 'ON'
|
||||
run: |
|
||||
cmake . \
|
||||
@@ -301,17 +282,46 @@ jobs:
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
- name: Test CMake Consumer with static OCIO
|
||||
if: matrix.build-shared == 'OFF'
|
||||
# The yaml-cpp_VERSION is set below because Findyaml-cpp.cmake needs it but is unable to
|
||||
# extract it from the headers, like the other modules.
|
||||
#
|
||||
# Prefer the static version of each dependencies by using <pkg>_STATIC_LIBRARY.
|
||||
# Alternatively, this can be done by setting <pkg>_LIBRARY and <pkg>_INCLUDE_DIR to
|
||||
# the static version of the package.
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-Dexpat_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dexpat_STATIC_LIBRARY=ON \
|
||||
-DImath_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DImath_STATIC_LIBRARY=ON \
|
||||
-Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_STATIC_LIBRARY=ON \
|
||||
-Dyaml-cpp_VERSION=0.7.0 \
|
||||
-DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DZLIB_STATIC_LIBRARY=ON \
|
||||
-Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dminizip-ng_STATIC_LIBRARY=ON
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# macOS
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
macos:
|
||||
name: 'macOS 10.15
|
||||
<AppleClang 11.0
|
||||
name: 'macOS 11
|
||||
<AppleClang
|
||||
arch=${{ matrix.arch-type }},
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
sse=${{ matrix.use-sse }},
|
||||
simd=${{ matrix.use-simd }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
python=${{ matrix.python-version }},
|
||||
docs=${{ matrix.build-docs }},
|
||||
@@ -320,79 +330,69 @@ jobs:
|
||||
if: |
|
||||
github.event_name == 'push' ||
|
||||
github.event.pull_request.head.repo.full_name != github.repository
|
||||
runs-on: macos-10.15
|
||||
runs-on: macos-11
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5, 6]
|
||||
build: [1, 2, 3, 4]
|
||||
include:
|
||||
# C++17, OpenFX
|
||||
- build: 6
|
||||
- build: 5
|
||||
arch-type: "x86_64"
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 17
|
||||
python-version: 3.9
|
||||
# C++11, Python 3.7
|
||||
- build: 5
|
||||
python-version: '3.11'
|
||||
# Keeping one universal build
|
||||
- build: 4
|
||||
arch-type: "x86_64;arm64"
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
python-version: '3.10'
|
||||
- build: 3
|
||||
arch-type: "x86_64"
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
python-version: 3.7
|
||||
# Debug, OpenFX
|
||||
- build: 4
|
||||
python-version: '3.10'
|
||||
- build: 2
|
||||
arch-type: "x86_64"
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
python-version: 3.7
|
||||
# C++14, OpenEXR, OpenFX
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 14
|
||||
python-version: 3.7
|
||||
# Static, no SSE
|
||||
- build: 2
|
||||
python-version: '3.9'
|
||||
- build: 1
|
||||
arch-type: "x86_64"
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
python-version: 3.7
|
||||
# Python 2.7
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
# Doc build requires Python 3
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 11
|
||||
python-version: 2.7
|
||||
cxx-standard: 14
|
||||
python-version: '3.7'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/macos/install_docs_env.sh
|
||||
if: matrix.build-docs == 'ON'
|
||||
@@ -412,11 +412,12 @@ jobs:
|
||||
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_USE_SSE=${{ matrix.use-sse }} \
|
||||
-DOCIO_USE_SIMD=${{ matrix.use-simd }} \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }} \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
|
||||
-DOCIO_WARNING_AS_ERROR=ON \
|
||||
-DPython_EXECUTABLE=$(which python)
|
||||
-DPython_EXECUTABLE=$(which python) \
|
||||
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.arch-type }}"
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -424,11 +425,12 @@ jobs:
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }} \
|
||||
-- -j$(sysctl -n hw.ncpu)
|
||||
echo "ocio_build_path=$(pwd)" >> $GITHUB_ENV
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
- name: Test CMake Consumer with shared OCIO
|
||||
if: matrix.build-shared == 'ON'
|
||||
run: |
|
||||
cmake . \
|
||||
@@ -438,6 +440,34 @@ jobs:
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
- name: Test CMake Consumer with static OCIO
|
||||
if: matrix.build-shared == 'OFF'
|
||||
# The yaml-cpp_VERSION is set below because Findyaml-cpp.cmake needs it but is unable to
|
||||
# extract it from the headers, like the other modules.
|
||||
#
|
||||
# Prefer the static version of each dependencies by using <pkg>_STATIC_LIBRARY.
|
||||
# Alternatively, this can be done by setting <pkg>_LIBRARY and <pkg>_INCLUDE_DIR to
|
||||
# the static version of the package.
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-Dexpat_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dexpat_STATIC_LIBRARY=ON \
|
||||
-DImath_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DImath_STATIC_LIBRARY=ON \
|
||||
-Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_STATIC_LIBRARY=ON \
|
||||
-Dyaml-cpp_VERSION=0.7.0 \
|
||||
-DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DZLIB_STATIC_LIBRARY=ON \
|
||||
-Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dminizip-ng_STATIC_LIBRARY=ON
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Windows
|
||||
@@ -447,10 +477,10 @@ jobs:
|
||||
|
||||
windows:
|
||||
name: 'Windows 2019
|
||||
<MSVC 16.4
|
||||
<MSVC
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
sse=${{ matrix.use-sse }},
|
||||
simd=${{ matrix.use-simd }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
python=${{ matrix.python-version }},
|
||||
docs=${{ matrix.build-docs }},
|
||||
@@ -462,78 +492,57 @@ jobs:
|
||||
runs-on: windows-2019
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5, 6]
|
||||
build: [1, 2, 3, 4]
|
||||
include:
|
||||
# C++17, OpenFX
|
||||
- build: 6
|
||||
- build: 4
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'OFF'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 17
|
||||
python-version: 3.9
|
||||
# C++11, Python 3.7
|
||||
- build: 5
|
||||
python-version: '3.11'
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
python-version: 3.7
|
||||
# Debug
|
||||
- build: 4
|
||||
python-version: '3.9'
|
||||
- build: 2
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
python-version: 3.7
|
||||
python-version: '3.8'
|
||||
# C++14, OpenEXR, OpenFX
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 14
|
||||
python-version: 3.7
|
||||
# Static, no SSE, OpenFX
|
||||
- build: 2
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'ON'
|
||||
use-sse: 'OFF'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 11
|
||||
python-version: 3.7
|
||||
# Python 2.7
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
# Doc build requires Python 3
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
use-sse: 'ON'
|
||||
use-oiio: 'ON'
|
||||
cxx-standard: 11
|
||||
python-version: 2.7
|
||||
build-openfx: 'ON'
|
||||
use-simd: 'ON'
|
||||
use-oiio: 'OFF'
|
||||
cxx-standard: 14
|
||||
python-version: '3.7'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/windows/install_docs_env.sh
|
||||
run: |
|
||||
DOXYGEN_PATH=$GITHUB_WORKSPACE/doxygen
|
||||
share/ci/scripts/windows/install_docs_env.sh "$DOXYGEN_PATH"
|
||||
echo "$DOXYGEN_PATH" >> $GITHUB_PATH
|
||||
shell: bash
|
||||
if: matrix.build-docs == 'ON'
|
||||
- name: Install tests env
|
||||
@@ -555,7 +564,7 @@ jobs:
|
||||
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_USE_SSE=${{ matrix.use-sse }} \
|
||||
-DOCIO_USE_SIMD=${{ matrix.use-simd }} \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }} \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
|
||||
-DOCIO_WARNING_AS_ERROR=ON \
|
||||
@@ -567,13 +576,14 @@ jobs:
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
echo "ocio_build_path=$(pwd)" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C ${{ matrix.build-type }}
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
- name: Test CMake Consumer with shared OCIO
|
||||
if: matrix.build-shared == 'ON'
|
||||
run: |
|
||||
cmake . \
|
||||
@@ -585,3 +595,33 @@ jobs:
|
||||
./${{ matrix.build-type }}/consumer
|
||||
shell: bash
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
- name: Test CMake Consumer with static OCIO
|
||||
if: matrix.build-shared == 'OFF'
|
||||
# The yaml-cpp_VERSION is set below because Findyaml-cpp.cmake needs it but is unable to
|
||||
# extract it from the headers, like the other modules.
|
||||
#
|
||||
# Prefer the static version of each dependencies by using <pkg>_STATIC_LIBRARY.
|
||||
# Alternatively, this can be done by setting <pkg>_LIBRARY and <pkg>_INCLUDE_DIR to
|
||||
# the static version of the package.
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-Dexpat_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dexpat_STATIC_LIBRARY=ON \
|
||||
-DImath_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DImath_STATIC_LIBRARY=ON \
|
||||
-Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_STATIC_LIBRARY=ON \
|
||||
-Dyaml-cpp_VERSION=0.7.0 \
|
||||
-DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DZLIB_STATIC_LIBRARY=ON \
|
||||
-Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dminizip-ng_STATIC_LIBRARY=ON
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
export PATH=../../../_install/bin:$PATH
|
||||
./${{ matrix.build-type }}/consumer
|
||||
shell: bash
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
@@ -0,0 +1,399 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: Dependencies latest
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-0.*
|
||||
- RB-1.*
|
||||
- gh-pages
|
||||
tags-ignore:
|
||||
- v0.*
|
||||
- v1.*
|
||||
paths:
|
||||
- .github/workflows/dependencies_latest.yml
|
||||
schedule:
|
||||
# Nightly build
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------------------------------------------
|
||||
# Linux latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
linux_latest:
|
||||
name: 'Linux CentOS 7 VFX CY${{ matrix.vfx-cy }} latest
|
||||
<${{ matrix.compiler-desc }}
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
docs=${{ matrix.build-docs }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-base:${{ matrix.vfx-cy }}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# GCC
|
||||
# -------------------------------------------------------------------
|
||||
- build: 1
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2022
|
||||
use-oiio: 'ON'
|
||||
- build: 2
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC
|
||||
vfx-cy: 2021
|
||||
use-oiio: 'OFF'
|
||||
# -------------------------------------------------------------------
|
||||
# Clang
|
||||
# -------------------------------------------------------------------
|
||||
- build: 3
|
||||
build-docs: 'OFF'
|
||||
build-openfx: 'OFF'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang
|
||||
vfx-cy: 2022
|
||||
use-oiio: 'OFF'
|
||||
- build: 4
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang
|
||||
vfx-cy: 2021
|
||||
use-oiio: 'ON'
|
||||
env:
|
||||
CXX: ${{ matrix.cxx-compiler }}
|
||||
CC: ${{ matrix.cc-compiler }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/linux/yum/install_docs_env.sh
|
||||
if: matrix.build-docs == 'ON'
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/linux/yum/install_tests_env.sh
|
||||
- name: Setup ext environment
|
||||
run: |
|
||||
EXT_PATH=/usr/local
|
||||
echo "EXT_PATH=$EXT_PATH" >> $GITHUB_ENV
|
||||
- name: Install indirect dependencies
|
||||
run: |
|
||||
share/ci/scripts/multi/install_pugixml.sh latest
|
||||
- name: Install fixed ext package versions
|
||||
# Minizip-ng depends on ZLIB. ZLIB must be installed first.
|
||||
run: |
|
||||
share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH
|
||||
share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_zlib.sh 1.2.12 $EXT_PATH
|
||||
share/ci/scripts/multi/install_minizip-ng.sh 3.0.6 $EXT_PATH
|
||||
- name: Install latest ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_imath.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openexr.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_oiio.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_osl.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openfx.sh latest $EXT_PATH
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=NONE \
|
||||
-DOCIO_WARNING_AS_ERROR=OFF \
|
||||
-DPython_EXECUTABLE=$(which python) \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }}
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
-- -j$(nproc)
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C Release
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . \
|
||||
--config Release
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# MacOS latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
macos-latest:
|
||||
name: 'macOS latest
|
||||
<AppleClang
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
docs=${{ matrix.build-docs }},
|
||||
python=${{ matrix.python-version }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
include:
|
||||
- build: 1
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 17
|
||||
python-version: '3.11'
|
||||
use-oiio: 'ON'
|
||||
- build: 2
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 14
|
||||
python-version: '3.9'
|
||||
use-oiio: 'OFF'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install docs env
|
||||
run: share/ci/scripts/macos/install_docs_env.sh
|
||||
if: matrix.build-docs == 'ON'
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/macos/install_tests_env.sh
|
||||
- name: Setup ext environment
|
||||
run: |
|
||||
EXT_PATH=/usr/local
|
||||
echo "EXT_PATH=$EXT_PATH" >> $GITHUB_ENV
|
||||
- name: Install indirect dependencies
|
||||
run: |
|
||||
share/ci/scripts/macos/install_bison.sh latest
|
||||
share/ci/scripts/macos/install_boost.sh latest
|
||||
share/ci/scripts/multi/install_pugixml.sh latest $EXT_PATH
|
||||
- name: Install fixed ext package versions
|
||||
# Minizip-ng depends on ZLIB. ZLIB must be installed first.
|
||||
run: |
|
||||
share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH
|
||||
share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_zlib.sh 1.2.12 $EXT_PATH
|
||||
share/ci/scripts/multi/install_minizip-ng.sh 3.0.6 $EXT_PATH
|
||||
- name: Install latest ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_imath.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openexr.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_oiio.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_osl.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openfx.sh latest $EXT_PATH
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DOCIO_BUILD_DOCS=${{ matrix.build-docs }} \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=NONE \
|
||||
-DOCIO_WARNING_AS_ERROR=OFF \
|
||||
-DPython_EXECUTABLE=$(which python) \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }}
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
-- -j$(sysctl -n hw.ncpu)
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C Release
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . \
|
||||
--config Release
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Windows latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
windows-latest:
|
||||
name: 'Windows latest
|
||||
<MSVC
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
docs=${{ matrix.build-docs }},
|
||||
python=${{ matrix.python-version }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
include:
|
||||
- build: 1
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 17
|
||||
python-version: '3.11'
|
||||
use-oiio: 'ON'
|
||||
- build: 2
|
||||
build-docs: 'ON'
|
||||
build-openfx: 'ON'
|
||||
cxx-standard: 14
|
||||
python-version: '3.9'
|
||||
use-oiio: 'OFF'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install docs env
|
||||
run: |
|
||||
DOXYGEN_PATH=$GITHUB_WORKSPACE/doxygen
|
||||
share/ci/scripts/windows/install_docs_env.sh "$DOXYGEN_PATH"
|
||||
echo "$DOXYGEN_PATH" >> $GITHUB_PATH
|
||||
shell: bash
|
||||
if: matrix.build-docs == 'ON'
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/windows/install_tests_env.sh
|
||||
shell: bash
|
||||
- name: Setup ext environment
|
||||
run: |
|
||||
EXT_PATH=$GITHUB_WORKSPACE/_ext
|
||||
VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT/installed/x64-windows
|
||||
echo "EXT_PATH=$EXT_PATH" >> $GITHUB_ENV
|
||||
echo "CMAKE_PREFIX_PATH=$VCPKG_ROOT;$EXT_PATH" >> $GITHUB_ENV
|
||||
echo "$VCPKG_ROOT/bin" >> $GITHUB_PATH
|
||||
echo "$EXT_PATH/bin" >> $GITHUB_PATH
|
||||
mkdir $EXT_PATH
|
||||
shell: bash
|
||||
- name: Install indirect dependencies
|
||||
run: |
|
||||
vcpkg install zlib:x64-windows
|
||||
vcpkg install tiff:x64-windows
|
||||
vcpkg install boost-asio:x64-windows
|
||||
vcpkg install boost-container:x64-windows
|
||||
vcpkg install boost-filesystem:x64-windows
|
||||
vcpkg install boost-math:x64-windows
|
||||
vcpkg install boost-stacktrace:x64-windows
|
||||
vcpkg install boost-system:x64-windows
|
||||
vcpkg install boost-thread:x64-windows
|
||||
share/ci/scripts/multi/install_pugixml.sh latest $EXT_PATH
|
||||
shell: bash
|
||||
- name: Install fixed ext package versions
|
||||
# Minizip-ng depends on ZLIB. ZLIB must be installed first.
|
||||
run: |
|
||||
share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH
|
||||
share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH
|
||||
share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH
|
||||
share/ci/scripts/multi/install_zlib.sh 1.2.12 $EXT_PATH
|
||||
share/ci/scripts/multi/install_minizip-ng.sh 3.0.6 $EXT_PATH
|
||||
shell: bash
|
||||
# OSL not installed due to LLVM compilation time.
|
||||
- name: Install latest ext package versions
|
||||
run: |
|
||||
share/ci/scripts/multi/install_imath.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openexr.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_oiio.sh latest $EXT_PATH
|
||||
share/ci/scripts/multi/install_openfx.sh latest $EXT_PATH
|
||||
shell: bash
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
shell: bash
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_GENERATOR_PLATFORM=x64 \
|
||||
-DOCIO_BUILD_DOCS=OFF \
|
||||
-DOCIO_BUILD_OPENFX=${{ matrix.build-openfx }} \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=NONE \
|
||||
-DOCIO_WARNING_AS_ERROR=OFF \
|
||||
-DPython_EXECUTABLE=$(which python) \
|
||||
-DOCIO_BUILD_PYTHON=OFF \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=${{ matrix.use-oiio }}
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
--parallel
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -V -C Release
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . \
|
||||
--config Release
|
||||
export PATH=../../../_install/bin:$PATH
|
||||
./Release/consumer
|
||||
shell: bash
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
@@ -33,13 +33,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Configure AWS Credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
uses: aws-actions/configure-aws-credentials@v2
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.CODEBUILD_ID }}
|
||||
aws-secret-access-key: ${{ secrets.CODEBUILD_SECRET }}
|
||||
aws-region: us-west-2
|
||||
- name: Run CodeBuild
|
||||
uses: aws-actions/aws-codebuild-run-project@v1.0.0
|
||||
uses: aws-actions/aws-codebuild-run-build@v1
|
||||
with:
|
||||
project-name: OpenColorIO
|
||||
buildspec-override: buildspec.yml
|
||||
|
||||
@@ -0,0 +1,396 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: Platform latest
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-0.*
|
||||
- RB-1.*
|
||||
- gh-pages
|
||||
tags-ignore:
|
||||
- v0.*
|
||||
- v1.*
|
||||
paths:
|
||||
- .github/workflows/platform_latest.yml
|
||||
schedule:
|
||||
# Nightly build
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
# ---------------------------------------------------------------------------
|
||||
# Linux latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
linux_latest:
|
||||
name: 'Linux Ubuntu latest
|
||||
<${{ matrix.compiler-desc }}
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
cxx=${{ matrix.cxx-standard }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# GCC
|
||||
# -------------------------------------------------------------------
|
||||
- build: 1
|
||||
build-python: ON
|
||||
build-type: Release
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC
|
||||
enable-sanitizer: OFF
|
||||
- build: 2
|
||||
build-python: OFF
|
||||
build-type: Debug
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: GCC
|
||||
enable-sanitizer: ON
|
||||
# -------------------------------------------------------------------
|
||||
# Clang
|
||||
# -------------------------------------------------------------------
|
||||
- build: 3
|
||||
build-python: ON
|
||||
build-type: Release
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang
|
||||
enable-sanitizer: OFF
|
||||
- build: 4
|
||||
build-python: OFF
|
||||
build-type: Debug
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: Clang
|
||||
enable-sanitizer: ON
|
||||
env:
|
||||
CXX: ${{ matrix.cxx-compiler }}
|
||||
CC: ${{ matrix.cc-compiler }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/linux/yum/install_tests_env.sh
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOCIO_BUILD_DOCS=OFF \
|
||||
-DOCIO_BUILD_OPENFX=ON \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_BUILD_PYTHON=${{ matrix.build-python}} \
|
||||
-DOCIO_USE_SIMD=ON \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
|
||||
-DOCIO_WARNING_AS_ERROR=ON \
|
||||
-DOCIO_ENABLE_SANITIZER=${{ matrix.enable-sanitizer }} \
|
||||
-DPython_EXECUTABLE=$(which python)
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }} \
|
||||
-v \
|
||||
-- -j$(nproc)
|
||||
echo "ocio_build_path=$(pwd)" >> $GITHUB_ENV
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer with shared OCIO
|
||||
if: matrix.build-shared == 'ON'
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DOCIO_ENABLE_SANITIZER=${{ matrix.enable-sanitizer }}
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
- name: Test CMake Consumer with static OCIO
|
||||
if: matrix.build-shared == 'OFF'
|
||||
# The yaml-cpp_VERSION is set below because Findyaml-cpp.cmake needs it but is unable to
|
||||
# extract it from the headers, like the other modules.
|
||||
#
|
||||
# Prefer the static version of each dependencies by using <pkg>_STATIC_LIBRARY.
|
||||
# Alternatively, this can be done by setting <pkg>_LIBRARY and <pkg>_INCLUDE_DIR to
|
||||
# the static version of the package.
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-Dexpat_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dexpat_STATIC_LIBRARY=ON \
|
||||
-DImath_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DImath_STATIC_LIBRARY=ON \
|
||||
-Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_STATIC_LIBRARY=ON \
|
||||
-Dyaml-cpp_VERSION=0.7.0 \
|
||||
-DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DZLIB_STATIC_LIBRARY=ON \
|
||||
-Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dminizip-ng_STATIC_LIBRARY=ON
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# MacOS latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
macos-latest:
|
||||
name: 'macOS latest
|
||||
<AppleClang
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
python=${{ matrix.python-version }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
include:
|
||||
- build: 1
|
||||
build-python: ON
|
||||
build-type: Release
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
enable-sanitizer: OFF
|
||||
python-version: '3.11'
|
||||
- build: 2
|
||||
build-python: OFF
|
||||
build-type: Debug
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
enable-sanitizer: ON
|
||||
python-version: '3.11'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/macos/install_tests_env.sh
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOCIO_BUILD_DOCS=OFF \
|
||||
-DOCIO_BUILD_OPENFX=ON \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_BUILD_PYTHON=${{ matrix.build-python}} \
|
||||
-DOCIO_USE_SIMD=ON \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
|
||||
-DOCIO_WARNING_AS_ERROR=ON \
|
||||
-DOCIO_ENABLE_SANITIZER=${{ matrix.enable-sanitizer }} \
|
||||
-DPython_EXECUTABLE=$(which python)
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }} \
|
||||
-- -j$(sysctl -n hw.ncpu)
|
||||
echo "ocio_build_path=$(pwd)" >> $GITHUB_ENV
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer with shared OCIO
|
||||
if: matrix.build-shared == 'ON'
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
- name: Test CMake Consumer with static OCIO
|
||||
if: matrix.build-shared == 'OFF'
|
||||
# The yaml-cpp_VERSION is set below because Findyaml-cpp.cmake needs it but is unable to
|
||||
# extract it from the headers, like the other modules.
|
||||
#
|
||||
# Prefer the static version of each dependencies by using <pkg>_STATIC_LIBRARY.
|
||||
# Alternatively, this can be done by setting <pkg>_LIBRARY and <pkg>_INCLUDE_DIR to
|
||||
# the static version of the package.
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-Dexpat_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dexpat_STATIC_LIBRARY=ON \
|
||||
-DImath_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DImath_STATIC_LIBRARY=ON \
|
||||
-Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_STATIC_LIBRARY=ON \
|
||||
-Dyaml-cpp_VERSION=0.7.0 \
|
||||
-DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DZLIB_STATIC_LIBRARY=ON \
|
||||
-Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dminizip-ng_STATIC_LIBRARY=ON
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
./consumer
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Windows latest ext packages
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
windows-latest:
|
||||
name: 'Windows latest
|
||||
<MSVC
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
python=${{ matrix.python-version }}>'
|
||||
# Don't run on OCIO forks
|
||||
if: github.repository == 'AcademySoftwareFoundation/OpenColorIO'
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
include:
|
||||
- build: 1
|
||||
build-python: ON
|
||||
build-type: Release
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
python-version: '3.11'
|
||||
- build: 2
|
||||
build-python: ON
|
||||
build-type: Debug
|
||||
build-shared: ON
|
||||
cxx-standard: 20
|
||||
python-version: '3.11'
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Install tests env
|
||||
run: share/ci/scripts/windows/install_tests_env.sh
|
||||
shell: bash
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
shell: bash
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake ../. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_GENERATOR_PLATFORM=x64 \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOCIO_BUILD_DOCS=OFF \
|
||||
-DOCIO_BUILD_OPENFX=ON \
|
||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||
-DOCIO_BUILD_PYTHON=${{ matrix.build-python}} \
|
||||
-DOCIO_USE_SIMD=ON \
|
||||
-DOCIO_USE_OIIO_FOR_APPS=OFF \
|
||||
-DOCIO_INSTALL_EXT_PACKAGES=ALL \
|
||||
-DOCIO_WARNING_AS_ERROR=ON \
|
||||
-DPython_EXECUTABLE=$(which python)
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
echo "ocio_build_path=$(pwd)" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test
|
||||
run: ctest -V -C ${{ matrix.build-type }}
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Test CMake Consumer with shared OCIO
|
||||
if: matrix.build-shared == 'ON'
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
export PATH=../../../_install/bin:$PATH
|
||||
./${{ matrix.build-type }}/consumer
|
||||
shell: bash
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
- name: Test CMake Consumer with static OCIO
|
||||
if: matrix.build-shared == 'OFF'
|
||||
# The yaml-cpp_VERSION is set below because Findyaml-cpp.cmake needs it but is unable to
|
||||
# extract it from the headers, like the other modules.
|
||||
#
|
||||
# Prefer the static version of each dependencies by using <pkg>_STATIC_LIBRARY.
|
||||
# Alternatively, this can be done by setting <pkg>_LIBRARY and <pkg>_INCLUDE_DIR to
|
||||
# the static version of the package.
|
||||
run: |
|
||||
cmake . \
|
||||
-DCMAKE_PREFIX_PATH=../../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-Dexpat_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dexpat_STATIC_LIBRARY=ON \
|
||||
-DImath_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DImath_STATIC_LIBRARY=ON \
|
||||
-Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dyaml-cpp_STATIC_LIBRARY=ON \
|
||||
-Dyaml-cpp_VERSION=0.7.0 \
|
||||
-DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-DZLIB_STATIC_LIBRARY=ON \
|
||||
-Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \
|
||||
-Dminizip-ng_STATIC_LIBRARY=ON
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
export PATH=../../../_install/bin:$PATH
|
||||
./${{ matrix.build-type }}/consumer
|
||||
shell: bash
|
||||
working-directory: _build/tests/cmake-consumer-dist
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Build SDist
|
||||
run: pipx run build --sdist
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
- name: Check metadata
|
||||
run: pipx run twine check dist/*
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: dist/*.tar.gz
|
||||
|
||||
@@ -78,62 +78,109 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# CPython 64 bits
|
||||
# CPython 64 bits manylinux_2_28
|
||||
# -------------------------------------------------------------------
|
||||
- build: CPython 3.7 64 bits
|
||||
- build: CPython 3.7 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp37-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.8 64 bits
|
||||
- build: CPython 3.8 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp38-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.9 64 bits
|
||||
- build: CPython 3.9 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp39-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.10 64 bits
|
||||
- build: CPython 3.10 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp310-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.11 64 bits
|
||||
- build: CPython 3.11 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp311-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.12 64 bits manylinux_2_28
|
||||
manylinux: manylinux_2_28
|
||||
python: cp312-manylinux*
|
||||
arch: x86_64
|
||||
# -------------------------------------------------------------------
|
||||
# CPython ARM 64 bits
|
||||
# CPython 64 bits manylinux2014
|
||||
# -------------------------------------------------------------------
|
||||
- build: CPython 3.7 ARM 64 bits
|
||||
- build: CPython 3.7 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp37-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.8 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp38-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.9 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp39-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.10 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp310-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.11 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp311-manylinux*
|
||||
arch: x86_64
|
||||
- build: CPython 3.12 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp312-manylinux*
|
||||
arch: x86_64
|
||||
# -------------------------------------------------------------------
|
||||
# CPython ARM 64 bits manylinux2014
|
||||
# -------------------------------------------------------------------
|
||||
- build: CPython 3.7 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp37-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.8 ARM 64 bits
|
||||
- build: CPython 3.8 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp38-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.9 ARM 64 bits
|
||||
- build: CPython 3.9 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp39-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.10 ARM 64 bits
|
||||
- build: CPython 3.10 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp310-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.11 ARM 64 bits
|
||||
- build: CPython 3.11 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp311-manylinux*
|
||||
arch: aarch64
|
||||
- build: CPython 3.12 ARM 64 bits manylinux2014
|
||||
manylinux: manylinux2014
|
||||
python: cp312-manylinux*
|
||||
arch: aarch64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/setup-python@v4
|
||||
name: Install Python
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.11.2
|
||||
uses: pypa/cibuildwheel@v2.16.2
|
||||
env:
|
||||
CIBW_BUILD: ${{ matrix.python }}
|
||||
CIBW_ARCHS: ${{ matrix.arch }}
|
||||
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }}
|
||||
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux }}
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
@@ -143,7 +190,7 @@ jobs:
|
||||
|
||||
macos:
|
||||
name: Build wheels on macOS
|
||||
runs-on: macos-10.15
|
||||
runs-on: macos-12
|
||||
# Don't run on OCIO forks
|
||||
if: |
|
||||
github.event_name != 'schedule' ||
|
||||
@@ -169,6 +216,9 @@ jobs:
|
||||
- build: CPython 3.11 64 bits
|
||||
python: cp311-*
|
||||
arch: x86_64
|
||||
- build: CPython 3.12 64 bits
|
||||
python: cp312-*
|
||||
arch: x86_64
|
||||
# -------------------------------------------------------------------
|
||||
# CPython ARM 64 bits
|
||||
# -------------------------------------------------------------------
|
||||
@@ -184,22 +234,25 @@ jobs:
|
||||
- build: CPython 3.11 ARM 64 bits
|
||||
python: cp311-*
|
||||
arch: arm64
|
||||
- build: CPython 3.12 ARM 64 bits
|
||||
python: cp312-*
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/setup-python@v4
|
||||
name: Install Python
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.11.2
|
||||
uses: pypa/cibuildwheel@v2.16.2
|
||||
env:
|
||||
CIBW_BUILD: ${{ matrix.python }}
|
||||
CIBW_ARCHS: ${{ matrix.arch }}
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
@@ -209,7 +262,7 @@ jobs:
|
||||
|
||||
windows:
|
||||
name: Build wheels on Windows
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
# Don't run on OCIO forks
|
||||
if: |
|
||||
github.event_name != 'schedule' ||
|
||||
@@ -235,22 +288,25 @@ jobs:
|
||||
- build: CPython 3.11 64 bits
|
||||
python: cp311-*
|
||||
arch: AMD64
|
||||
- build: CPython 3.12 64 bits
|
||||
python: cp312-*
|
||||
arch: AMD64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/setup-python@v4
|
||||
name: Install Python
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Build wheels
|
||||
uses: pypa/cibuildwheel@v2.11.2
|
||||
uses: pypa/cibuildwheel@v2.16.2
|
||||
env:
|
||||
CIBW_BUILD: ${{ matrix.python }}
|
||||
CIBW_ARCHS: ${{ matrix.arch }}
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
@@ -260,9 +316,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/setup-python@v4
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: artifact
|
||||
path: dist
|
||||
|
||||
@@ -3,8 +3,13 @@
|
||||
|
||||
This file documents releases up to 1.1.1. For a description of version 2.0 and later
|
||||
please refer to the Releases page on GitHub:
|
||||
|
||||
https://github.com/AcademySoftwareFoundation/OpenColorIO/releases
|
||||
|
||||
and for more details please see the release notes in latest documentation pages:
|
||||
|
||||
https://opencolorio.readthedocs.io/en/latest/releases/_index.html#releases
|
||||
|
||||
**Version 1.1.1 (April 2 2019):**
|
||||
* Added optional compatibility for building apps with OpenImageIO 1.9+
|
||||
* Added USE_SSE checks to fix Linux build failure
|
||||
|
||||
+226
-18
@@ -5,13 +5,14 @@
|
||||
###############################################################################
|
||||
# CMake definition.
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(CMAKE_MODULE_PATH
|
||||
${CMAKE_MODULE_PATH}
|
||||
${CMAKE_SOURCE_DIR}/share/cmake/utils
|
||||
${CMAKE_SOURCE_DIR}/share/cmake/macros
|
||||
${CMAKE_SOURCE_DIR}/share/cmake/modules
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/utils
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/macros
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/modules
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/share/cmake/modules/install
|
||||
)
|
||||
|
||||
set(CMAKE_WARN_DEPRECATED ON)
|
||||
@@ -28,13 +29,13 @@ endif()
|
||||
# Project definition.
|
||||
|
||||
project(OpenColorIO
|
||||
VERSION 2.2.0
|
||||
VERSION 2.3.2
|
||||
DESCRIPTION "OpenColorIO (OCIO) is a complete color management solution"
|
||||
HOMEPAGE_URL https://github.com/AcademySoftwareFoundation/OpenColorIO
|
||||
LANGUAGES CXX C)
|
||||
|
||||
# "dev", "beta1", rc1", etc or "" for an official release.
|
||||
set(OpenColorIO_VERSION_RELEASE_TYPE "dev")
|
||||
set(OpenColorIO_VERSION_RELEASE_TYPE "")
|
||||
|
||||
|
||||
###############################################################################
|
||||
@@ -55,7 +56,7 @@ include(GNUInstallDirs)
|
||||
###############################################################################
|
||||
# Forbid in-source build.
|
||||
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||
if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
|
||||
message(FATAL_ERROR
|
||||
"In-source build not allowed. Please make a new sub-directory and run cmake from there.")
|
||||
endif()
|
||||
@@ -94,11 +95,26 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeR
|
||||
|
||||
# Is that a valid build type?
|
||||
|
||||
if(NOT "${CMAKE_BUILD_TYPE}" IN_LIST CMAKE_CONFIGURATION_TYPES)
|
||||
set(_build_type_valid_ false)
|
||||
foreach (_build_type_ ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOLOWER ${_build_type_} _lowercase_build_type_)
|
||||
string(TOLOWER ${CMAKE_BUILD_TYPE} _lowercase_cmake_build_type_)
|
||||
|
||||
if (_lowercase_cmake_build_type_ STREQUAL _lowercase_build_type_)
|
||||
# Build type is supported.
|
||||
set(_build_type_valid_ true)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_lowercase_build_type_)
|
||||
unset(_lowercase_cmake_build_type_)
|
||||
|
||||
if (NOT _build_type_valid_)
|
||||
string(REPLACE ";" ", " _CMAKE_CONFIGURATION_TYPES_STR "${CMAKE_CONFIGURATION_TYPES}")
|
||||
message(FATAL_ERROR
|
||||
"CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} is unsupported. Supported values are: ${_CMAKE_CONFIGURATION_TYPES_STR}.")
|
||||
endif()
|
||||
unset(_build_type_valid_)
|
||||
|
||||
# Is that in debug mode?
|
||||
|
||||
@@ -137,33 +153,196 @@ set (OCIO_PYTHON_VERSION "" CACHE STRING
|
||||
|
||||
option(OCIO_BUILD_JAVA "Specify whether to build java bindings" OFF)
|
||||
|
||||
option(OCIO_WARNING_AS_ERROR "Set build error level for CI testing" OFF)
|
||||
|
||||
if (WIN32)
|
||||
option(OCIO_USE_WINDOWS_UNICODE "Compile with Windows Unicode support" ON)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# Other preferences
|
||||
|
||||
option(OCIO_VERBOSE "Display more information when searching or installing dependencies" OFF)
|
||||
option(OCIO_USE_SOVERSION "Enable versioning in OCIO shared library name" ON)
|
||||
|
||||
###############################################################################
|
||||
# Warnings / debugging settings
|
||||
|
||||
option(OCIO_WARNING_AS_ERROR "Set build error level for CI testing" OFF)
|
||||
|
||||
if (NOT WIN32)
|
||||
option(OCIO_ENABLE_SANITIZER "Specify whether to enable compiler sanitizers (address)" OFF)
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Optimization / internal linking preferences
|
||||
|
||||
option(OCIO_USE_SSE "Specify whether to enable SSE CPU performance optimizations" ON)
|
||||
option(OCIO_USE_OIIO_CMAKE_CONFIG "Specify whether to look for OIIO using the generated CMake Config script instead of the custom FindOpenImageIO.cmake script" OFF)
|
||||
option(OCIO_USE_SIMD "Specify whether to enable SIMD CPU performance optimizations" ON)
|
||||
option(OCIO_USE_OIIO_FOR_APPS "Request OIIO to build apps (ociolutimage, ocioconvert and ociodisplay), the default uses OpenEXR." OFF)
|
||||
|
||||
|
||||
if (NOT APPLE)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(AMD64|IA64|EM64T|x86_64|X86|i386|i686)")
|
||||
# Intel-based architecture (not APPLE)
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(X86|i386|i686)")
|
||||
set(OCIO_ARCH_X86_32 1)
|
||||
endif()
|
||||
set(OCIO_ARCH_X86 1)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE ON)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX ON)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C ON)
|
||||
else()
|
||||
set(OCIO_ARCH_X86 0)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE OFF)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX OFF)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C OFF)
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
# Multiple possible scenarios:
|
||||
# A. Building on an Apple arm64 architecture for the native architecture (arm64).
|
||||
# B. Building on an Apple arm64 architecture for x86_64.
|
||||
# C. Building on an Apple arm64 architecture for universal binaries (x86_64 + arm64).
|
||||
#
|
||||
# D. Building on an Apple Intel architecture for the native architecture (x86_64).
|
||||
# E. Building on an Apple Intel architecture for arm64.
|
||||
# F. Building on an Apple Intel architecture for universal binaries (x86_64 + arm64).
|
||||
|
||||
# Check if we are NOT cross-compiling to another Apple architecture.
|
||||
if (NOT DEFINED CMAKE_OSX_ARCHITECTURES OR CMAKE_OSX_ARCHITECTURES STREQUAL "")
|
||||
# Building for the native architectures.
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
|
||||
# Apple Intel-based computer or Rosetta. (covers case D)
|
||||
|
||||
set(OCIO_ARCH_X86 1)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE ON)
|
||||
# The AVX and F16C will be compiled, but it won't used at runtime by Rosetta.
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX ON)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C ON)
|
||||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
|
||||
# Apple arm64. (covers case A)
|
||||
|
||||
set(OCIO_ARCH_X86 0)
|
||||
# OCIO translates the SSE instructions into ARM Neon with the library SSE2NEON.
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE ON)
|
||||
# OCIO does not translate AVX to ARM Neon.
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX OFF)
|
||||
# Turn F16C off since they are x86_64 instructions.
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C OFF)
|
||||
endif()
|
||||
else()
|
||||
# Cross-compiling to another Apple architecture (x86_64, arm64, or both (universal))
|
||||
if ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
|
||||
# Compiling for x86_64 regardless of native architecture.
|
||||
# Covers case B assuming CMAKE_SYSTEM_PROCESSOR is arm64.
|
||||
# Covers case D if CMAKE_OSX_ARCHITECTURES is set to x86_64 on x86_64 architecture.
|
||||
|
||||
set(OCIO_ARCH_X86 1)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE ON)
|
||||
# The AVX and F16C will be compiled, but they won't used at runtime by Rosetta.
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX ON)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C ON)
|
||||
elseif ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
|
||||
# Compiling for arm64 regardless of native architecture.
|
||||
# Covers case E assuming CMAKE_SYSTEM_PROCESSOR is x86_64.
|
||||
# Covers case A if CMAKE_OSX_ARCHITECTURES is set arm64 on arm64 architecture.
|
||||
|
||||
set(OCIO_ARCH_X86 0)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE ON)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX OFF)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C OFF)
|
||||
elseif ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "(arm64;x86_64|x86_64;arm64)")
|
||||
# Universal build (covers case C and F).
|
||||
|
||||
set(OCIO_ARCH_X86 1)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE ON)
|
||||
# The AVX and F16C will be compiled, but they won't used at runtime by Rosetta.
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX ON)
|
||||
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C ON)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(OCIO_USE_SSE2 "Specify whether to enable SSE2 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE})
|
||||
option(OCIO_USE_SSE3 "Specify whether to enable SSE3 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE})
|
||||
option(OCIO_USE_SSSE3 "Specify whether to enable SSSE3 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE})
|
||||
option(OCIO_USE_SSE4 "Specify whether to enable SSE4 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE})
|
||||
option(OCIO_USE_SSE42 "Specify whether to enable SSE4.2 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE})
|
||||
option(OCIO_USE_AVX "Specify whether to enable AVX CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX})
|
||||
option(OCIO_USE_AVX2 "Specify whether to enable AVX2 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX})
|
||||
option(OCIO_USE_AVX512 "Specify whether to enable AVX512 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX})
|
||||
option(OCIO_USE_F16C "Specify whether to enable F16C CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C})
|
||||
|
||||
if (APPLE)
|
||||
# TODO: Revisit whether that option is necessary.
|
||||
option(OCIO_USE_SSE2NEON "Specify whether to enable SSE CPU performance optimizations using SSE2NEON for Apple ARM architecture" ON)
|
||||
mark_as_advanced(OCIO_USE_SSE2NEON)
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# GPU configuration
|
||||
|
||||
message(STATUS "")
|
||||
message(STATUS "Checking for GPU configuration...")
|
||||
include(CheckSupportGL)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Check for ARM neon here because we need to know if ARM NEON is supported
|
||||
# quickly. Once we know that ARM NEON is supported, we can add sse2neon library
|
||||
# to the build.
|
||||
|
||||
if(OCIO_USE_SIMD)
|
||||
include(CheckSupportARMNeon)
|
||||
|
||||
if (NOT COMPILER_SUPPORTS_ARM_NEON)
|
||||
# Force it to OFF since ARM Neon is not supported.
|
||||
set(OCIO_USE_SSE2NEON OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Add sse2neon to the build if ARM NEON intrinsics are supported.
|
||||
|
||||
if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_ARM_NEON)
|
||||
# Install sse2neon. Please note that sse2neon is downloaded during the configure step as it is
|
||||
# needed for CompilerFlags.cmake and CheckSupportSSEUsingSSE2NEON.cmake.
|
||||
|
||||
# Sse2neon is not treated like an imported target. The logic to find sse2neon is here because
|
||||
# a find module is not suitable for sse2neon's use case.
|
||||
find_path(sse2neon_INCLUDE_DIR
|
||||
NAMES
|
||||
sse2neon.h
|
||||
HINTS
|
||||
${sse2neon_ROOT}
|
||||
PATH_SUFFIXES
|
||||
sse2neon
|
||||
include
|
||||
sse2neon/include
|
||||
)
|
||||
|
||||
# As per instructions on sse2neon's GitHub page, the following compiler flags should be used:
|
||||
# "-march=armv8-a+fp+simd+crypto+crc". These flags are required for some ARM platforms that do
|
||||
# not enable floating point calculations or SIMD instructions by default. However, for ARM64
|
||||
# (Apple ARM platform) and x86_64 platforms, these features are already enabled by default.
|
||||
# Therefore, no additional compiler flags are needed.
|
||||
if (NOT sse2neon_INCLUDE_DIR)
|
||||
include(Installsse2neon)
|
||||
else()
|
||||
# Any changes to the following lines must be replicated in Installsse2neon.cmake as well.
|
||||
# Create a target for sse2neon (non-imported)
|
||||
add_library(sse2neon INTERFACE)
|
||||
# Add the include directories to the target.
|
||||
target_include_directories(sse2neon INTERFACE "${sse2neon_INCLUDE_DIR}")
|
||||
# Ignore the warnings coming from sse2neon.h as they are false positives.
|
||||
target_compile_options(sse2neon INTERFACE -Wno-unused-parameter)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Define compilation and link flags
|
||||
|
||||
include(CompilerFlags)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# External linking options
|
||||
|
||||
@@ -251,6 +430,15 @@ if(OCIO_BUILD_STATIC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
message(STATUS "Note that building the static version of OpenColorIO does not embed the dependencies\
|
||||
into the library file. The needed dependencies must be linked to the consumer
|
||||
application or shared library that uses static OpenColorIO.
|
||||
|
||||
The following mandatory dependencies MUST be linked to the consumer application or shared library:
|
||||
expat, yaml-cpp, Imath, pystring, minizip-ng and ZLIB")
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Find or install external dependencies
|
||||
@@ -282,7 +470,7 @@ else()
|
||||
set(OCIO_SETUP_NAME setup_ocio.sh)
|
||||
endif()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/share/ocio/${OCIO_SETUP_NAME}.in
|
||||
configure_file(${PROJECT_SOURCE_DIR}/share/ocio/${OCIO_SETUP_NAME}.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} @ONLY)
|
||||
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} DESTINATION ${CMAKE_INSTALL_DATADIR}/ocio/)
|
||||
@@ -296,9 +484,11 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ocio/${OCIO_SETUP_NAME} DESTINAT
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
set(OCIO_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets.cmake")
|
||||
set(OCIO_VERSION_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(OCIO_PROJECT_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
|
||||
set(OCIO_VERSION_CONFIG "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
set(OCIO_PROJECT_CONFIG "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
|
||||
set(OCIO_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||
set(OCIO_CUSTOM_FIND_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/share/OpenColorIO/cmake/modules")
|
||||
set(OCIO_CUSTOM_MACROS_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/share/OpenColorIO/cmake/macros")
|
||||
|
||||
# Version fetched from the top level project()
|
||||
write_basic_package_version_file(
|
||||
@@ -321,6 +511,24 @@ install(
|
||||
FILE ${OCIO_TARGETS_EXPORT_NAME}
|
||||
)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
# Install custom macros used in the find modules.
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/share/cmake/macros/VersionUtils.cmake
|
||||
DESTINATION ${OCIO_CUSTOM_MACROS_MODULE_DIR}
|
||||
)
|
||||
|
||||
# Install custom Find modules.
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/share/cmake/modules/Findexpat.cmake
|
||||
${CMAKE_CURRENT_LIST_DIR}/share/cmake/modules/FindImath.cmake
|
||||
${CMAKE_CURRENT_LIST_DIR}/share/cmake/modules/Findpystring.cmake
|
||||
${CMAKE_CURRENT_LIST_DIR}/share/cmake/modules/Findminizip-ng.cmake
|
||||
${CMAKE_CURRENT_LIST_DIR}/share/cmake/modules/Findyaml-cpp.cmake
|
||||
DESTINATION ${OCIO_CUSTOM_FIND_MODULE_DIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
install(
|
||||
FILES "${OCIO_PROJECT_CONFIG}" "${OCIO_VERSION_CONFIG}"
|
||||
DESTINATION "${OCIO_CONFIG_INSTALL_DIR}"
|
||||
|
||||
@@ -20,3 +20,4 @@ The current OpenColorIO Committers are:
|
||||
| Doug Walker | @doug-walker |
|
||||
| Kevin Wheatley | @KevinJW |
|
||||
| Rémi Achard | @remia |
|
||||
| Cédrik Fuoco | @cedrik-fuoco-adsk |
|
||||
|
||||
+13
-30
@@ -19,7 +19,7 @@ explains our contribution process and procedures, so please review it first:
|
||||
For a description of the roles and responsibilities of the various
|
||||
members of the OpenColorIO community, see [GOVERNANCE](GOVERNANCE.md), and
|
||||
for further details, see the project's
|
||||
[Technical Charter](docs/aswf/Charter.md). Briefly, Contributors are anyone
|
||||
[Technical Charter](ASWF/Charter.md). Briefly, Contributors are anyone
|
||||
who submits content to the project, Committers review and approve such
|
||||
submissions, and the Technical Steering Committee provides general project
|
||||
oversight.
|
||||
@@ -214,18 +214,20 @@ the work.
|
||||
a Committer other than the PR contributor may squash and merge changes into the
|
||||
main branch.
|
||||
|
||||
See also (from the OCIO Developer Guide):
|
||||
* [Getting started](http://opencolorio.org/developers/getting_started.html)
|
||||
* [Submitting Changes](http://opencolorio.org/developers/submitting_changes.html)
|
||||
For a more detailed description of the contribution process, please see the
|
||||
Contributing Guide in the main OCIO documentation:
|
||||
|
||||
* [Getting Started](https://opencolorio.readthedocs.io/en/latest/guides/contributing/contributing.html#getting-started)
|
||||
* [Submitting Changes](https://opencolorio.readthedocs.io/en/latest/guides/contributing/contributing.html#submitting-changes)
|
||||
|
||||
## Coding Standards
|
||||
|
||||
Please see the OpenColorIO
|
||||
[Coding guidelines](http://opencolorio.org/developers/coding_guidelines.html)
|
||||
[Coding guidelines](https://opencolorio.readthedocs.io/en/latest/guides/contributing/contributing.html#coding-style-guide)
|
||||
for a reference on project code style and best practices.
|
||||
|
||||
For standards on contributing to documentation, see the
|
||||
[Documentation guidelines](http://opencolorio.org/developers/documentation_guidelines.html).
|
||||
[Documentation guidelines](https://opencolorio.readthedocs.io/en/latest/guides/contributing/contributing.html#documentation-guidelines).
|
||||
|
||||
## Test Policy
|
||||
|
||||
@@ -241,31 +243,12 @@ expected to validate the behavior of every part of OCIO:
|
||||
* Any change to existing functionality should have tests added if they
|
||||
don't already exist.
|
||||
|
||||
The test should should be run, via ``ctest``, before submitting a pull request.
|
||||
The test should be run, via ``ctest``, before submitting a pull request.
|
||||
|
||||
## Versioning Policy
|
||||
|
||||
OpenColorIO uses [semantic versioning](https://semver.org), which labels each
|
||||
version with three numbers: Major.Minor.Patch, where:
|
||||
OpenColorIO labels each version with three numbers: Major.Minor.Patch, where:
|
||||
|
||||
* **MAJOR** indicates incompatible API changes
|
||||
* **MINOR** indicates functionality added in a backwards-compatible manner
|
||||
* **PATCH** indicates backwards-compatible bug fixes
|
||||
|
||||
## Creating a Release
|
||||
|
||||
To create a new release from the main branch:
|
||||
|
||||
1. Update the release notes in ``CHANGELOG.md`` with a high-level summary of
|
||||
the features and improvements. Also include the summary in the Release
|
||||
comments.
|
||||
|
||||
2. Create a new release on the GitHub Releases page.
|
||||
|
||||
3. Tag the release with name beginning with '``v``', e.g. '``v2.1.0``'.
|
||||
|
||||
4. Download and sign the release tarball, as described
|
||||
[here](https://wiki.debian.org/Creating%20signed%20GitHub%20releases),
|
||||
|
||||
5. Attach the detached ``.asc`` signature file to the GitHub release as a
|
||||
binary file.
|
||||
* **MAJOR** indicates major architectural changes
|
||||
* **MINOR** indicates an introduction of significant new features
|
||||
* **PATCH** indicates ABI-compatible bug fixes and minor enhancements
|
||||
|
||||
@@ -119,6 +119,8 @@ project at all ASWF TAC meetings.
|
||||
* Sean Cooper - ARRI
|
||||
* Michael Dolan - Epic Games
|
||||
* Patrick Hodoul - Autodesk
|
||||
* Zach Lewis - Method Studios
|
||||
* Thomas Mansencal - WetaFX
|
||||
* Carol Payne - Netflix
|
||||
* Carl Rand - Weta Digital
|
||||
* Mark Titchener - Foundry
|
||||
|
||||
@@ -6,3 +6,6 @@ graft share
|
||||
graft src
|
||||
graft tests
|
||||
global-include CMakeLists.txt *.cmake *.md
|
||||
global-exclude */__pycache__/*
|
||||
global-exclude *.pyc
|
||||
global-exclude .DS_Store
|
||||
|
||||
@@ -38,7 +38,7 @@ Houdini, Silhouette FX, and
|
||||
[others](https://opencolorio.org/#supported_apps).
|
||||
|
||||
OpenColorIO is free and open source software ([LICENSE](LICENSE)), and
|
||||
one of several projects actvively sponsored by the ASWF
|
||||
one of several projects actively sponsored by the ASWF
|
||||
([Academy Software Foundation](https://www.aswf.io/)).
|
||||
|
||||
OpenColorIO Project Mission
|
||||
@@ -50,12 +50,12 @@ content creation applications and pipelines.
|
||||
|
||||
OpenColorIO aims to:
|
||||
|
||||
* be stable, secure, and thouroughly tested on Linux, macOS, and Windows
|
||||
* be stable, secure, and thoroughly tested on Linux, macOS, and Windows
|
||||
* be performant on modern CPUs and GPUs
|
||||
* be simple, scalable, and well documented
|
||||
* be compatible with critical color and imaging standards
|
||||
* provide lossless color processing wherever possible
|
||||
* maintain config backwards compatability across major versions
|
||||
* maintain config backwards compatibility across major versions
|
||||
* have every new feature carefully reviewed by leaders from the motion picture,
|
||||
VFX, animation, and video game industries
|
||||
* have a healthy and active community
|
||||
@@ -65,13 +65,14 @@ OpenColorIO Project Governance
|
||||
------------------------------
|
||||
|
||||
OpenColorIO is governed by the Academy Software Foundation (ASWF). See
|
||||
[GOVERNANCE.md](GOVERNANCE.md) for detailed infomation about how the project
|
||||
[GOVERNANCE.md](GOVERNANCE.md) for detailed information about how the project
|
||||
operates.
|
||||
|
||||
Web Resources
|
||||
-------------
|
||||
|
||||
* Website: <http://opencolorio.org>
|
||||
* Documentation: <https://opencolorio.readthedocs.io/en/latest/>
|
||||
* Mailing lists:
|
||||
* Developer: <ocio-dev@lists.aswf.io>
|
||||
* User: <ocio-user@lists.aswf.io>
|
||||
@@ -99,6 +100,11 @@ The following reference implementations are provided:
|
||||
* Other
|
||||
* nuke-default
|
||||
|
||||
Sources for the newer builtin ACES configuration files can be found in the releases section of the
|
||||
[OpenColorIO-Config-ACES](https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES)
|
||||
repository.
|
||||
|
||||
|
||||
Acknowledgements
|
||||
----------------
|
||||
|
||||
|
||||
+20
-20
@@ -61,11 +61,11 @@ if(${Python_VERSION_MAJOR} GREATER_EQUAL 3)
|
||||
# configuration, but omits *.in to work in RTD builds.
|
||||
message(STATUS "Substitute documentation variables")
|
||||
file(GLOB_RECURSE DOC_IN_FILES
|
||||
"${CMAKE_SOURCE_DIR}/docs/**.in"
|
||||
"${CMAKE_SOURCE_DIR}/docs/conf.py"
|
||||
"${PROJECT_SOURCE_DIR}/docs/**.in"
|
||||
"${PROJECT_SOURCE_DIR}/docs/conf.py"
|
||||
)
|
||||
foreach(in_file ${DOC_IN_FILES})
|
||||
string(REPLACE "${CMAKE_SOURCE_DIR}/" "${CMAKE_BINARY_DIR}/"
|
||||
string(REPLACE "${PROJECT_SOURCE_DIR}/" "${PROJECT_BINARY_DIR}/"
|
||||
out_file ${in_file})
|
||||
string(REPLACE ".in" ""
|
||||
out_file ${out_file})
|
||||
@@ -73,15 +73,15 @@ if(${Python_VERSION_MAJOR} GREATER_EQUAL 3)
|
||||
endforeach()
|
||||
|
||||
# Copy documentation source to build location
|
||||
file(GLOB_RECURSE DOC_SOURCES "${CMAKE_SOURCE_DIR}/docs/*")
|
||||
file(GLOB_RECURSE DOC_SOURCES "${PROJECT_SOURCE_DIR}/docs/*")
|
||||
list(APPEND DOC_SOURCES
|
||||
${CMAKE_SOURCE_DIR}/README.md
|
||||
${CMAKE_SOURCE_DIR}/INSTALL.md
|
||||
${CMAKE_SOURCE_DIR}/CHANGELOG.md
|
||||
${CMAKE_SOURCE_DIR}/LICENSE
|
||||
${PROJECT_SOURCE_DIR}/README.md
|
||||
${PROJECT_SOURCE_DIR}/INSTALL.md
|
||||
${PROJECT_SOURCE_DIR}/CHANGELOG.md
|
||||
${PROJECT_SOURCE_DIR}/LICENSE
|
||||
)
|
||||
if(OCIO_BUILD_NUKE)
|
||||
list(APPEND DOC_SOURCES ${CMAKE_SOURCE_DIR}/share/nuke/ocionuke/viewer.py)
|
||||
list(APPEND DOC_SOURCES ${PROJECT_SOURCE_DIR}/share/nuke/ocionuke/viewer.py)
|
||||
endif()
|
||||
|
||||
# Don't copy configured files. In particular this prevents overwriting conf.py,
|
||||
@@ -93,15 +93,15 @@ if(${Python_VERSION_MAJOR} GREATER_EQUAL 3)
|
||||
)
|
||||
|
||||
foreach(f ${DOC_SOURCES})
|
||||
string(REGEX REPLACE "^${CMAKE_SOURCE_DIR}/" "" relpath ${f})
|
||||
string(REGEX REPLACE "^${PROJECT_SOURCE_DIR}/" "" relpath ${f})
|
||||
string(REGEX REPLACE "[/. ]" "_" tgtname ${relpath})
|
||||
string(REGEX MATCH "^docs" IN_DOCS ${relpath})
|
||||
|
||||
set(SRC_PATH ${CMAKE_SOURCE_DIR}/${relpath})
|
||||
set(DST_PATH ${CMAKE_BINARY_DIR}/${relpath})
|
||||
set(SRC_PATH ${PROJECT_SOURCE_DIR}/${relpath})
|
||||
set(DST_PATH ${PROJECT_BINARY_DIR}/${relpath})
|
||||
if(NOT IN_DOCS)
|
||||
get_filename_component(F_NAME ${relpath} NAME)
|
||||
set(DST_PATH "${CMAKE_BINARY_DIR}/docs/${F_NAME}")
|
||||
set(DST_PATH "${PROJECT_BINARY_DIR}/docs/${F_NAME}")
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${DST_PATH}
|
||||
@@ -118,16 +118,16 @@ if(${Python_VERSION_MAJOR} GREATER_EQUAL 3)
|
||||
get_target_property(DOXYGEN_EXECUTABLE Doxygen::doxygen IMPORTED_LOCATION)
|
||||
|
||||
file(GLOB_RECURSE DOXYGEN_SOURCES
|
||||
"${CMAKE_SOURCE_DIR}/include/*.h"
|
||||
"${CMAKE_BINARY_DIR}/include/*.h"
|
||||
"${PROJECT_SOURCE_DIR}/include/*.h"
|
||||
"${PROJECT_BINARY_DIR}/include/*.h"
|
||||
)
|
||||
set(DOXYGEN_INDEX_XML "${CMAKE_BINARY_DIR}/docs/_doxygen/xml/index.xml")
|
||||
set(DOXYGEN_INDEX_XML "${PROJECT_BINARY_DIR}/docs/_doxygen/xml/index.xml")
|
||||
|
||||
# Run doxygen if index.xml is behind OCIO headers or doxygen config
|
||||
add_custom_command(OUTPUT ${DOXYGEN_INDEX_XML}
|
||||
COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_BINARY_DIR}/docs/Doxyfile"
|
||||
COMMAND "${DOXYGEN_EXECUTABLE}" "${PROJECT_BINARY_DIR}/docs/Doxyfile"
|
||||
DEPENDS
|
||||
${CMAKE_BINARY_DIR}/docs/Doxyfile
|
||||
${PROJECT_BINARY_DIR}/docs/Doxyfile
|
||||
${DOXYGEN_SOURCES}
|
||||
COMMENT "Extracting XML files from C++ headers"
|
||||
)
|
||||
@@ -140,7 +140,7 @@ if(${Python_VERSION_MAJOR} GREATER_EQUAL 3)
|
||||
### HTML doc target ###
|
||||
|
||||
file(GLOB_RECURSE SPHINX_EXTENSIONS
|
||||
"${CMAKE_SOURCE_DIR}/share/docs/*.py"
|
||||
"${PROJECT_SOURCE_DIR}/share/docs/*.py"
|
||||
)
|
||||
|
||||
# Run Sphinx
|
||||
@@ -148,7 +148,7 @@ if(${Python_VERSION_MAJOR} GREATER_EQUAL 3)
|
||||
COMMAND
|
||||
${Python_PRE_CMD} "${Sphinx_EXECUTABLE}" -b html . "${CMAKE_CURRENT_BINARY_DIR}/build-html"
|
||||
DEPENDS
|
||||
${CMAKE_BINARY_DIR}/docs/conf.py
|
||||
${PROJECT_BINARY_DIR}/docs/conf.py
|
||||
${SPHINX_EXTENSIONS}
|
||||
${DOXYGEN_INDEX_XML}
|
||||
COMMENT "Building html docs"
|
||||
|
||||
+2
-2
@@ -792,7 +792,7 @@ WARN_LOGFILE =
|
||||
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = "@CMAKE_SOURCE_DIR@/include/@CMAKE_PROJECT_NAME@"
|
||||
INPUT = "@PROJECT_SOURCE_DIR@/include/@CMAKE_PROJECT_NAME@"
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
@@ -2040,7 +2040,7 @@ SEARCH_INCLUDES = YES
|
||||
# preprocessor.
|
||||
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
|
||||
|
||||
INCLUDE_PATH = "@CMAKE_BINARY_DIR@/include/@CMAKE_PROJECT_NAME@"
|
||||
INCLUDE_PATH = "@PROJECT_BINARY_DIR@/include/@CMAKE_PROJECT_NAME@"
|
||||
|
||||
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
||||
# patterns (like *.h and *.hpp) to filter out the header-files in the
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
# OCIO v2 Documentation Effort
|
||||
|
||||
Since the API autodoc effort is happening simultaneously it will be easier for
|
||||
a lot of contributors to do a light-weight build of the Sphinx docs, which
|
||||
doesn't require building OCIO in its entirety.
|
||||
|
||||
## How to Build HTML Docs
|
||||
|
||||
In addition to the general OCIO v2 dependencies, install Doxygen, Sphinx, and
|
||||
the Python packages listed in the `docs/requirements.txt` file.
|
||||
|
||||
Doxygen can be installed with a package manager, or by downloading a binary
|
||||
distribution from [Doxygen's website](https://www.doxygen.nl/download.html).
|
||||
Use one of the following commands to install Doxygen with a platform-specific
|
||||
package manager:
|
||||
|
||||
Linux (Debian, etc.):
|
||||
|
||||
```
|
||||
apt-get install doxygen
|
||||
```
|
||||
|
||||
Linux (Fedora, etc.):
|
||||
|
||||
```
|
||||
yum install doxygen
|
||||
```
|
||||
|
||||
macOS ([Homebrew](https://brew.sh/)):
|
||||
|
||||
```
|
||||
brew install doxygen
|
||||
```
|
||||
|
||||
Windows ([Chocolatey](https://chocolatey.org/)):
|
||||
|
||||
```
|
||||
choco install doxygen.install
|
||||
```
|
||||
|
||||
Sphinx and the other Python dependencies can be installed with a single `pip`
|
||||
command on all platforms:
|
||||
|
||||
```
|
||||
pip install -r docs/requirements.txt
|
||||
```
|
||||
|
||||
To build only the RST docs (excluding API) locally:
|
||||
|
||||
```
|
||||
cd docs
|
||||
mkdir _build
|
||||
sphinx-build -b html . _build
|
||||
<your web browser name> _build/index.html
|
||||
```
|
||||
|
||||
To build all HTML docs (including API) locally:
|
||||
|
||||
```
|
||||
mkdir _build
|
||||
cd _build
|
||||
cmake ../. -DOCIO_BUILD_DOCS=ON -DCMAKE_INSTALL_PREFIX=../_install
|
||||
make -j<your thread count> docs
|
||||
<your web browser name> docs/build-html/index.html
|
||||
```
|
||||
|
||||
Python 3 is required to build the documentation. If you have multiple Python
|
||||
installs you'll need to make sure pip and CMake find the correct version. You
|
||||
can manually inform cmake of which to use by adding this option to the above
|
||||
`cmake` command, which configures the documentation build:
|
||||
|
||||
```
|
||||
-DPython_ROOT=<Path to Python 3 root directory>
|
||||
```
|
||||
|
||||
To ease the documentation build and test on macOS one could also add these
|
||||
three lines in the ~/.zshrc file:
|
||||
|
||||
```
|
||||
alias python=/usr/local/bin/python3
|
||||
alias pip=/usr/local/bin/pip3
|
||||
alias <your web browser name>=open -a "<your web browser application name>"
|
||||
```
|
||||
|
||||
## Quirks
|
||||
|
||||
The vuepress theme that we've migrated to has some quirks to its design. For
|
||||
example it only allows two nested table of contents (TOC). So things have to be
|
||||
organized in a slightly different way than other sphinx projects.
|
||||
|
||||
The root-level `toc_redirect.rst` points to where to find the different section
|
||||
TOCs. The name and contents of each sections TOC is defined in that
|
||||
sub-directory's `_index.rst` file.
|
||||
|
||||
In this TOC the `:caption:` directive determines what the name of the section
|
||||
will be in the side-bar, and in the header of the website. The *H1* header
|
||||
determines the name of the page in the right/left arrows navigation bar. In a
|
||||
lot of cases this ends up doubling up the name on the page, but this seems
|
||||
unavoidable at the present time. If additional explanatory text is put in the
|
||||
`_index.rst` files then it shouldn't be as problematic.
|
||||
|
||||
The site will show all *H1* headers in the side panel by default, these then
|
||||
expand when selected to show all *H2* headers.
|
||||
|
||||
Due to the limited TOC and side-bar depth, we shouldn't be afraid of looong
|
||||
pages with many *H2* headings to break down the page into logical quadrants.
|
||||
@@ -50,6 +50,47 @@
|
||||
} //
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderCreator.TEXTURE_1D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_1D: 1>
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderCreator.TEXTURE_2D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_2D: 2>
|
||||
|
||||
|
||||
.. py:class:: GpuShaderCreator.TextureDimensions
|
||||
:module: PyOpenColorIO
|
||||
:canonical: PyOpenColorIO.GpuShaderCreator.TextureDimensions
|
||||
|
||||
Dimension enum used to differentiate between 1D and 2D object/resource types.
|
||||
|
||||
Members:
|
||||
|
||||
TEXTURE_1D
|
||||
|
||||
TEXTURE_2D
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderCreator.TextureDimensions.TEXTURE_1D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_1D: 1>
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderCreator.TextureDimensions.TEXTURE_2D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_2D: 2>
|
||||
|
||||
|
||||
.. py:property:: GpuShaderCreator.TextureDimensions.name
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:property:: GpuShaderCreator.TextureDimensions.value
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderCreator.addToDeclareShaderCode(self: PyOpenColorIO.GpuShaderCreator, shaderCode: str) -> None
|
||||
:module: PyOpenColorIO
|
||||
|
||||
@@ -99,6 +140,10 @@
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderCreator.getAllowTexture1D(self: PyOpenColorIO.GpuShaderCreator) -> bool
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderCreator.getCacheID(self: PyOpenColorIO.GpuShaderCreator) -> str
|
||||
:module: PyOpenColorIO
|
||||
|
||||
@@ -148,6 +193,12 @@
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderCreator.setAllowTexture1D(self: PyOpenColorIO.GpuShaderCreator, allowed: bool) -> None
|
||||
:module: PyOpenColorIO
|
||||
|
||||
Allow 1D GPU resource type, otherwise always using 2D resources for 1D LUTs.
|
||||
|
||||
|
||||
.. py:method:: GpuShaderCreator.setFunctionName(self: PyOpenColorIO.GpuShaderCreator, name: str) -> None
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
@@ -146,6 +146,51 @@
|
||||
Create the default shader description.
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderDesc.TEXTURE_1D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_1D: 1>
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderDesc.TEXTURE_2D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_2D: 2>
|
||||
|
||||
|
||||
.. py:class:: GpuShaderDesc.TextureDimensions
|
||||
:module: PyOpenColorIO
|
||||
:canonical: PyOpenColorIO.GpuShaderCreator.TextureDimensions
|
||||
|
||||
Dimension enum used to differentiate between 1D and 2D object/resource types.
|
||||
|
||||
Members:
|
||||
|
||||
TEXTURE_1D
|
||||
|
||||
TEXTURE_2D
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderDesc.TextureDimensions.TEXTURE_1D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_1D: 1>
|
||||
|
||||
|
||||
.. py:attribute:: GpuShaderDesc.TextureDimensions.TEXTURE_2D
|
||||
:module: PyOpenColorIO
|
||||
:value: <TextureDimensions.TEXTURE_2D: 2>
|
||||
|
||||
|
||||
.. py:method:: GpuShaderDesc.TextureDimensions.__init__(self: PyOpenColorIO.GpuShaderCreator.TextureDimensions, value: int) -> None
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:property:: GpuShaderDesc.TextureDimensions.name
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:property:: GpuShaderDesc.TextureDimensions.value
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderDesc.__init__(*args, **kwargs)
|
||||
:module: PyOpenColorIO
|
||||
|
||||
@@ -159,10 +204,10 @@
|
||||
The 'values' parameter contains the 3D LUT data which must be used as-is as the dimension and origin are hard-coded in the fragment shader program. So, it means one GPU 3D texture per entry.
|
||||
|
||||
|
||||
.. py:method:: GpuShaderDesc.addTexture(self: PyOpenColorIO.GpuShaderDesc, textureName: str, samplerName: str, width: int, height: int, channel: PyOpenColorIO.GpuShaderCreator.TextureType, interpolation: PyOpenColorIO.Interpolation, values: buffer) -> None
|
||||
.. py:method:: GpuShaderDesc.addTexture(self: PyOpenColorIO.GpuShaderDesc, textureName: str, samplerName: str, width: int, height: int, channel: PyOpenColorIO.GpuShaderCreator.TextureType, dimensions: PyOpenColorIO.GpuShaderCreator.TextureDimensions, interpolation: PyOpenColorIO.Interpolation, values: buffer) -> None
|
||||
:module: PyOpenColorIO
|
||||
|
||||
Add a 2D texture (1D texture if height equals 1).
|
||||
Add a 1D or 2D texture
|
||||
|
||||
.. note::
|
||||
The 'values' parameter contains the LUT data which must be used as-is as the dimensions and origin are hard-coded in the fragment shader program. So, it means one GPU texture per entry.
|
||||
@@ -221,6 +266,10 @@
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderDesc.getAllowTexture1D(self: PyOpenColorIO.GpuShaderCreator) -> bool
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderDesc.getCacheID(self: PyOpenColorIO.GpuShaderCreator) -> str
|
||||
:module: PyOpenColorIO
|
||||
|
||||
@@ -284,6 +333,12 @@
|
||||
:module: PyOpenColorIO
|
||||
|
||||
|
||||
.. py:method:: GpuShaderDesc.setAllowTexture1D(self: PyOpenColorIO.GpuShaderCreator, allowed: bool) -> None
|
||||
:module: PyOpenColorIO
|
||||
|
||||
Allow 1D GPU resource type, otherwise always using 2D resources for 1D LUTs.
|
||||
|
||||
|
||||
.. py:method:: GpuShaderDesc.setFunctionName(self: PyOpenColorIO.GpuShaderCreator, name: str) -> None
|
||||
:module: PyOpenColorIO
|
||||
|
||||
@@ -379,6 +434,10 @@
|
||||
:module: PyOpenColorIO.GpuShaderDesc
|
||||
|
||||
|
||||
.. py:property:: Texture.dimensions
|
||||
:module: PyOpenColorIO.GpuShaderDesc
|
||||
|
||||
|
||||
.. py:method:: Texture.getValues(self: PyOpenColorIO.GpuShaderDesc.Texture) -> numpy.ndarray
|
||||
:module: PyOpenColorIO.GpuShaderDesc
|
||||
|
||||
|
||||
@@ -4,11 +4,30 @@
|
||||
|
||||
.. _publications:
|
||||
|
||||
Publications
|
||||
============
|
||||
Presentations & Publications
|
||||
============================
|
||||
|
||||
DigiPro 2020 **paper** `"The ASWF takes OpenColorIO to the Next Level" <https://drive.google.com/file/d/1y_0ZEftivHH0zoKwvKZx3gH_u_cDm1bD/view?usp=sharing>`_
|
||||
* ASWF Open Source Days 2023 `video <https://www.youtube.com/watch?v=y-oq693Wl8g>`_
|
||||
|
||||
DigiPro 2020 **video** `"The ASWF takes OpenColorIO to the Next Level" <https://vimeo.com/458011669>`_
|
||||
* OCIO wins the Pipeline Tool award at DigiPro 2022! `video <https://vimeo.com/742052701>`_
|
||||
|
||||
`Cinematic Color <http://cinematiccolor.org/>`_
|
||||
* ASWF Open Source Days 2022 `video <https://www.youtube.com/watch?v=WzFlz1HeNdI>`_
|
||||
|
||||
* HPA Tech Retreat 2022 "Color Processing with OCIO v2 and the Academy/ASC Common LUT Format"
|
||||
`Slides & Tutorial <https://drive.google.com/drive/folders/1ZRTIYE6kFb-7sTUtYIYFNJndhY6tmJee?usp=share_link>`_
|
||||
|
||||
* OCIO v2 wins an Engineering Excellence award from the Hollywood Post Alliance!
|
||||
`article <https://www.hollywoodreporter.com/movies/movie-news/hpa-engineering-excellence-award-recipients-announced-1234995410/>`_
|
||||
|
||||
* SIGGRAPH 2021 course "Color management with OpenColorIO V2"
|
||||
`video <https://vimeo.com/689093714>`__ `PDF <https://drive.google.com/file/d/1v37Bz7s1wbJNg-ULsBqnGPA9h7pWNfhU/view?usp=share_link>`__ `ACM <https://dl.acm.org/doi/10.1145/3450508.3464600>`_
|
||||
|
||||
* ASWF Open Source Days 2021 `video <https://youtu.be/FSzLwSTJjWo>`_
|
||||
|
||||
* DigiPro 2020 "The ASWF takes OpenColorIO to the Next Level" `video <https://vimeo.com/458011669>`__ `PDF <https://drive.google.com/file/d/1y_0ZEftivHH0zoKwvKZx3gH_u_cDm1bD/view?usp=sharing>`__ `ACM <https://dl.acm.org/doi/abs/10.1145/3403736.3403942>`_
|
||||
|
||||
* ASWF Open Source Days 2020 `video <https://www.youtube.com/watch?v=7e0SSka8Ar8>`_
|
||||
|
||||
* ASWF Open Source Days 2019 `video <https://youtu.be/L5dpFtgZuhQ>`_
|
||||
|
||||
* `Cinematic Color <http://cinematiccolor.org/>`_
|
||||
|
||||
@@ -10,8 +10,10 @@ Configurations
|
||||
.. toctree::
|
||||
:caption: Configurations
|
||||
|
||||
aces_studio
|
||||
aces_cg
|
||||
ocio_v2_demo
|
||||
aces_1.0.3
|
||||
nuke_default
|
||||
spi_anim
|
||||
spi_vfx
|
||||
ocio_v2_demo
|
||||
nuke_default
|
||||
|
||||
@@ -2,17 +2,21 @@
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
.. _aces_1.0.3:
|
||||
|
||||
aces_1.0.3
|
||||
==========
|
||||
|
||||
This section describes the ACES 1.0.3 OpenColorIO configuration.
|
||||
|
||||
.. note::
|
||||
There is a more recent version of the ACES config for ACES 1.2 available here:
|
||||
There is a more recent version of the ACES 1.0.3 config for ACES 1.2 available here:
|
||||
|
||||
- https://github.com/colour-science/OpenColorIO-Configs/tree/feature/aces-1.2-config
|
||||
|
||||
An ACES config that takes advantage of the new OCIO v2 features is under development.
|
||||
.. note::
|
||||
Please note that both of these configurations have been supplanted by the new
|
||||
:ref:`aces_studio` for OCIO v2.
|
||||
|
||||
|
||||
Information about ACES
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
..
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
.. _aces_cg:
|
||||
|
||||
OCIO CG Config for ACES
|
||||
=======================
|
||||
|
||||
The OCIO Computer Graphics (CG) config for ACES is a simple, lightweight config intended for use
|
||||
in typical digital content creation (DCC) apps that need robust choices for texture and
|
||||
rendering spaces and a basic selection of display and view transforms.
|
||||
|
||||
Users who need a more extensive set of color spaces, including digital cinema camera
|
||||
color spaces and a wider set of displays and view should look at the :ref:`aces_studio`.
|
||||
|
||||
Please note that some of the color spaces (e.g. for texturing) are not officially part of the
|
||||
ACES specifications but are included because they are widely used in VFX, animation, and games.
|
||||
|
||||
The latest version of this config may be downloaded from the Releases page of its GitHub
|
||||
`repo. <https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/releases>`_
|
||||
|
||||
The CG Config leverages the high quality ACES implementation built into OCIO itself
|
||||
and so requires no external LUT files. In fact, even the config file is built into OCIO
|
||||
and users may access it from any application that uses OCIO 2.2 or higher by using one of the
|
||||
following strings in place of the config path:
|
||||
|
||||
``ocio://studio-config-v2.1.0_aces-v1.3_ocio-v2.3`` (for OCIO 2.3 or higher)
|
||||
|
||||
``ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1`` (for OCIO 2.2 or higher)
|
||||
|
||||
These new configs adopt an advanced naming convention so that they can be uniquely identified:
|
||||
|
||||
``studio-config-v1.0.0_aces-v1.3_ocio-v2.1.ocio``
|
||||
|
||||
``|-----|-------------|---------|---------|---|``
|
||||
|
||||
``|Type | Colorspaces | ACES | Profile | |``
|
||||
|
||||
Where:
|
||||
|
||||
* Type: The type of the config, e.g., CG or Studio
|
||||
* Colorspaces: The version for the color spaces and other config features
|
||||
* ACES: The aces-dev version being used
|
||||
* Profile: Minimum required OCIO version
|
||||
|
||||
The OCIO Configs Working Group collected input from the community and simplified the
|
||||
naming scheme relative to the earlier OCIO v1 ACES configs. However, aliases have been
|
||||
added so that the original color space names continue to work (if there is an equivalent
|
||||
space in the new config).
|
||||
|
||||
Please note that with OCIO v2 we are trying to be more rigorous about what constitutes a
|
||||
"color space". For this reason, the new configs do not bake view transforms or looks into
|
||||
the display color spaces. Therefore, it is necessary to use a DisplayViewTransform rather
|
||||
than a ColorSpaceTransform if you want to bake in an ACES Output Transform. This is not
|
||||
only more rigorous from a color management point of view, it also helps clarify to end-users
|
||||
the important role of a view transform in the process. Baking in a view transform is a
|
||||
fundamentally different process than just converting between color space encodings, and it
|
||||
should be perceived as such by users.
|
||||
@@ -0,0 +1,59 @@
|
||||
..
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
.. _aces_studio:
|
||||
|
||||
OCIO Studio Config for ACES
|
||||
===========================
|
||||
|
||||
The OCIO Studio Config for ACES is the successor to the widely used :ref:`ACES config <aces_1.0.3>`
|
||||
for OCIO v1.
|
||||
|
||||
It contains the complete set of ACES color spaces, displays, and views. In addition, it
|
||||
contains some extra color spaces that are not officially part of ACES but that are widely
|
||||
used in the VFX, animation, games, and post-production industries.
|
||||
|
||||
Users who need a simpler config that contains just the basics needed to use ACES color
|
||||
management in common DCC tools are encouraged to check out the :ref:`aces_cg`.
|
||||
|
||||
The latest version of this config may be downloaded from the Releases page of its GitHub
|
||||
`repo. <https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/releases>`_
|
||||
|
||||
The Studio Config leverages the high quality ACES implementation built into OCIO itself
|
||||
and so requires no external LUT files. In fact, even the config file is built into OCIO
|
||||
and users may access it from any application that uses OCIO 2.2 or higher by using one of the
|
||||
following strings in place of the config path:
|
||||
|
||||
``ocio://studio-config-v2.1.0_aces-v1.3_ocio-v2.3`` (for OCIO 2.3 or higher)
|
||||
|
||||
``ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1`` (for OCIO 2.2 or higher)
|
||||
|
||||
These new configs adopt an advanced naming convention so that they can be uniquely identified:
|
||||
|
||||
``studio-config-v1.0.0_aces-v1.3_ocio-v2.1.ocio``
|
||||
|
||||
``|-----|-------------|---------|---------|---|``
|
||||
|
||||
``|Type | Colorspaces | ACES | Profile | |``
|
||||
|
||||
Where:
|
||||
|
||||
* Type: The type of the config, e.g., CG or Studio
|
||||
* Colorspaces: The version for the color spaces and other config features
|
||||
* ACES: The aces-dev version being used
|
||||
* Profile: Minimum required OCIO version
|
||||
|
||||
The OCIO Configs Working Group collected input from the community and simplified the
|
||||
naming scheme relative to the earlier OCIO v1 ACES configs. However, aliases have been
|
||||
added so that the original color space names continue to work (if there is an equivalent
|
||||
space in the new config).
|
||||
|
||||
Please note that with OCIO v2 we are trying to be more rigorous about what constitutes a
|
||||
"color space". For this reason, the new configs do not bake view transforms or looks into
|
||||
the display color spaces. Therefore, it is necessary to use a DisplayViewTransform rather
|
||||
than a ColorSpaceTransform if you want to bake in an ACES Output Transform. This is not
|
||||
only more rigorous from a color management point of view, it also helps clarify to end-users
|
||||
the important role of a view transform in the process. Baking in a view transform is a
|
||||
fundamentally different process than just converting between color space encodings, and it
|
||||
should be perceived as such by users.
|
||||
@@ -10,6 +10,10 @@ ocio-v2_demo
|
||||
Note: this is not intended to be a complete production-ready config, its purpose
|
||||
is to introduce many of the new features in OCIO v2.
|
||||
|
||||
Due to the limitations of the web template, it may be easier for you to read this
|
||||
config in a text editor. The config file is located
|
||||
`here. <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/docs/configurations/ocio-v2_demo.ocio>`_
|
||||
|
||||
|
||||
.. literalinclude:: ocio-v2_demo.ocio
|
||||
:language: yaml
|
||||
|
||||
@@ -15,19 +15,19 @@ Colorspaces
|
||||
|
||||
Required.
|
||||
|
||||
This section is a list of all the colorspaces known to OCIO. A
|
||||
colorspace can be referred to elsewhere within the config (including
|
||||
This section is a list of the scene-referred colorspaces in the config.
|
||||
A colorspace may be referred to elsewhere within the config (including
|
||||
other colorspace definitions), and are used within OCIO-supporting
|
||||
applications.
|
||||
|
||||
A color space may use the following keys:
|
||||
A colorspace may use the following keys:
|
||||
|
||||
|
||||
``to_scene_reference`` and ``from_scene_reference``
|
||||
---------------------------------------------------
|
||||
|
||||
These keys specify the transforms that define the relationship between
|
||||
the color space and the scene-referred reference space.
|
||||
the colorspace and the scene-referred reference space.
|
||||
|
||||
Note: In OCIO v1, the keys ``to_reference`` and ``from_reference`` were
|
||||
used (since there was only one reference space). These are still supported
|
||||
@@ -404,10 +404,10 @@ compatibility.
|
||||
|
||||
Optional.
|
||||
|
||||
These two options are used when OCIO transforms are applied on the
|
||||
GPU.
|
||||
These two options were used in OCIO v1 when transforms were applied on the
|
||||
GPU. However, the new GPU renderer in OCIO v2 does not need these.
|
||||
|
||||
It is also used to automatically generate a "shaper LUT" when
|
||||
However, they may still be used to automatically generate a "shaper LUT" when
|
||||
:ref:`baking LUT's <userguide-bakelut>` unless one is explicitly
|
||||
specified (not all output formats utilise this)
|
||||
|
||||
@@ -469,6 +469,8 @@ It's common to use literal ``|`` block syntax to preserve all newlines:
|
||||
This is the second.
|
||||
|
||||
|
||||
.. _config-display-colorspaces:
|
||||
|
||||
Display Colorspaces
|
||||
*******************
|
||||
|
||||
@@ -477,7 +479,7 @@ Display Colorspaces
|
||||
|
||||
Optional.
|
||||
|
||||
This section is a list of all the display colorspaces known to OCIO.
|
||||
This section is a list of all the display-referred colorspaces in the config.
|
||||
A display colorspace is very similar to a colorspace except its transforms
|
||||
go from or to the display-referred reference space rather than the
|
||||
scene-referred reference space.
|
||||
|
||||
@@ -18,6 +18,12 @@ This page alone will not help you to write a useful config file! See
|
||||
the :ref:`configurations` section for examples of complete, practical
|
||||
configs, and discussion of how they fit within a facilities workflow.
|
||||
|
||||
Please note that you should use the OCIO Python or C++ API to generate
|
||||
the config.ocio file rather than writing the YAML by hand in a text editor.
|
||||
However, if you do ever modify YAML by hand rather than via the API, you
|
||||
should run :ref:`overview-ociocheck` on it to ensure that the syntax is
|
||||
correct.
|
||||
|
||||
YAML basics
|
||||
***********
|
||||
|
||||
@@ -29,7 +35,7 @@ has a good overview.
|
||||
|
||||
OCIO configs typically use a small subset of YAML, so looking at
|
||||
existing configs is probably the quickest way to familiarise yourself
|
||||
(just remember the indentation is important!)
|
||||
(just remember the indentation is important!).
|
||||
|
||||
Checking for errors
|
||||
*******************
|
||||
@@ -59,8 +65,12 @@ An OCIO config has the following sections:
|
||||
* :ref:`config-displays-views` -- This section defines how color spaces should be viewed.
|
||||
* :ref:`config-looks` -- Looks are transforms used to adjust colors, such as to apply a
|
||||
creative effect.
|
||||
* :ref:`config-colorspaces` -- This section defines the universe of color space encodings
|
||||
* :ref:`config-colorspaces` -- This section defines the scene-referred color space encodings
|
||||
available within the config.
|
||||
* :ref:`config-display-colorspaces` -- This section defines the display-referred color space
|
||||
encodings available within the config.
|
||||
* :ref:`config-named-transforms` -- Named Transforms are a way to provide transforms that
|
||||
do not have a fixed relationship to a specific reference space, such as a utility curve.
|
||||
|
||||
A collection of :ref:`config-transforms` is provided for use in the various sections
|
||||
of the config file.
|
||||
@@ -99,11 +109,12 @@ Optional. A brief description of the configuration.
|
||||
``name``
|
||||
^^^^^^^^
|
||||
|
||||
Optional. A unique name for the config.
|
||||
Optional. A unique name for the config. Future versions of OCIO might use this as a
|
||||
sort of "namespace" for the color spaces defined in the rest of the config.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
name: foo_2021-02-01
|
||||
name: studio-config-v1.0.0_aces-v1.3_ocio-v2.1
|
||||
|
||||
|
||||
``search_path``
|
||||
|
||||
@@ -16,7 +16,9 @@ File & Viewing rules
|
||||
``file_rules``
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
Either file_rules or the default role are Required.
|
||||
.. warning::
|
||||
Either the file_rules section or the default role are Required for configs of
|
||||
version 2 or higher.
|
||||
|
||||
Use the File Rules to assign a default color space to files based on their path.
|
||||
|
||||
@@ -24,10 +26,10 @@ Here is example showing the various types of rules that may be defined:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
files_rules:
|
||||
file_rules:
|
||||
- !<Rule> {name: LogC, extension: "*", pattern: "*LogC*", colorspace: ARRI LogC}
|
||||
- !<Rule> {name: OpenEXR, extension: "exr", pattern: "*", colorspace: ACEScg}
|
||||
- !<Rule> {name: TIFF, regex: ".*\.TIF?F$", colorspace: sRGB}
|
||||
- !<Rule> {name: TIFF, regex: ".*\\.TIF?F", colorspace: sRGB}
|
||||
- !<Rule> {name: ColorSpaceNamePathSearch}
|
||||
- !<Rule> {name: Default, colorspace: default}
|
||||
|
||||
@@ -42,36 +44,41 @@ other keys depend on the rule type.
|
||||
This is the basic rule type that uses Unix glob style pattern matching and is
|
||||
thus very easy to use. It contains the keys:
|
||||
|
||||
* ``name``: Name of the rule
|
||||
* ``name``: Name of the rule.
|
||||
* ``pattern``: Glob pattern to be used for the main part of the name/path.
|
||||
This is case-sensitive.
|
||||
This is case-sensitive. It must be in double-quotes. Set it to "*" if you only
|
||||
want the rule to consider the extension.
|
||||
* ``extension``: Glob pattern or string to be used for the file extension. Note that
|
||||
if glob tokens are not used, the extension will be used in a non-case-sensitive
|
||||
way by default. For example the simple string "exr" would match "exr" and "EXR".
|
||||
If you only want to match "exr", use the glob pattern "[e][x][r]".
|
||||
If you only want to match "exr", use the glob pattern "[e][x][r]". It must be
|
||||
in double-quotes. Set it to "*" if you only want the rule to consider the pattern.
|
||||
* ``colorspace``: ColorSpace name to be returned.
|
||||
|
||||
2. Regex Rules --
|
||||
2. RegEx Rules --
|
||||
This is similar to the basic rule but allows additional capabilities for
|
||||
power-users. It contains the keys:
|
||||
|
||||
* ``name``: Name of the rule
|
||||
* ``regex``: Regular expression to be evaluated.
|
||||
* ``name``: Name of the rule.
|
||||
* ``regex``: Regular expression to be evaluated. It must be in double-quotes.
|
||||
* ``colorspace``: ColorSpace name to be returned.
|
||||
|
||||
Note that a backslash character in a RegEx expression needs to be doubled up as ``\\``
|
||||
(as shown in the example above for the TIFF rule) to make it through the Yaml parsing.
|
||||
|
||||
3. OCIO v1 style Rule --
|
||||
This rule allows the use of the OCIO v1 style, where the string is searched for
|
||||
ColorSpace names from the config. This rule may occur 0 or 1 times in the list.
|
||||
The position in the list prioritizes it with respect to the other rules. It has
|
||||
the key:
|
||||
|
||||
* ``name``: Must be "ColorSpaceNamePathSearch".
|
||||
* ``name``: Must be ``ColorSpaceNamePathSearch``.
|
||||
|
||||
4. Default Rule --
|
||||
The file_rules must always end with this rule. If no prior rules match, this
|
||||
The file_rules section must always end with this rule. If no prior rules match, this
|
||||
rule specifies the ColorSpace applications will use. It has the keys:
|
||||
|
||||
* ``name``: must be "Default".
|
||||
* ``name``: must be ``Default``.
|
||||
* ``colorspace``: ColorSpace name to be returned.
|
||||
|
||||
Note: OCIO v1 defined a ``default`` role intended to specify a default color space
|
||||
@@ -84,19 +91,24 @@ missing, an exception will be thrown when loading the config.
|
||||
|
||||
Note that the strictparsing token does not affect the behavior of the File Rules
|
||||
API. In other words, evaluating the rules will always result in a ColorSpace being
|
||||
available to an application. However, the API alsos allow the application to know
|
||||
available to an application. However, the API also allows the application to know
|
||||
which rule was the matching one. So apps that want to work in "strict" mode should
|
||||
first check if strictparsing is true and if so check to see if the matching rule
|
||||
was the Default Rule. If so, it could then notify the user and take whatever action
|
||||
is appropriate.
|
||||
is appropriate. (As an alternative to checking which rule number was matched, the
|
||||
API call ``filepathOnlyMatchesDefaultRule`` may be used instead.)
|
||||
|
||||
Roles may be used rather than ColorSpace names in the rules.
|
||||
|
||||
It is also legal for rules to have additional key:value pairs where the value
|
||||
It is also legal for rules to have additional key:value pairs where the value
|
||||
may be an arbitrary string. The API provides access to getting/setting these
|
||||
additional pairs and will preserve them on a Config read/write. These may be
|
||||
used to define application-specific behavior.
|
||||
|
||||
Note to developers: The older ``parseColorSpaceFromString`` API call is now deprecated
|
||||
and should be replaced with ``getColorSpaceFromFilepath``.
|
||||
|
||||
|
||||
``strictparsing``
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -107,12 +119,21 @@ Optional. Valid values are ``true`` and ``false``. Default is ``true``
|
||||
|
||||
strictparsing: true
|
||||
|
||||
OCIO provides a mechanism for applications to extract the colorspace
|
||||
from a filename (the ``parseColorSpaceFromString`` API method)
|
||||
.. warning::
|
||||
This attribute is from OCIO v1. In OCIO v2, the FileRules system was
|
||||
introduced and so the ``strictparsing`` attribute is less relevant now.
|
||||
The ``parseColorSpaceFromString`` API call is now deprecated and the
|
||||
proper way to obtain this information is ``getColorSpaceFromFilepath``.
|
||||
The FileRules always return a default color space but the API
|
||||
``filepathOnlyMatchesDefaultRule`` may be used by applications that
|
||||
want to take some special action if ``strictparsing`` is true.
|
||||
|
||||
OCIO v1 provided a mechanism for applications to extract the colorspace
|
||||
from a filename (the ``parseColorSpaceFromString`` API method).
|
||||
|
||||
So for a file like ``example_render_v001_lnf.0001.exr`` it will
|
||||
determine the colorspace ``lnf`` (it being the right-most substring
|
||||
containing a colorspace name)
|
||||
containing a colorspace name).
|
||||
|
||||
However, if the colorspace cannot be determined and ``strictparsing:
|
||||
true``, it will return an empty string.
|
||||
|
||||
@@ -344,6 +344,7 @@ Keys:
|
||||
must also be present and the result is clamped at the high end.
|
||||
|
||||
|
||||
.. _config-named-transforms:
|
||||
|
||||
Named Transforms
|
||||
****************
|
||||
|
||||
@@ -14,18 +14,39 @@ The documentation primarily lives in the ``docs/`` folder, within the
|
||||
main OpenColorIO repository.
|
||||
|
||||
The rST source for the C++ API documentation is extracted from
|
||||
comments in the public header files in ``export/``
|
||||
comments in the public header files in ``include/``
|
||||
|
||||
The Python API documentation is extracted from dummy .py files within
|
||||
the ``src/pyglue/DocStrings/`` folder
|
||||
Installation of requirements
|
||||
****************************
|
||||
|
||||
Scripts are available, for each platform, to install the documentation
|
||||
requirements.
|
||||
|
||||
The ``install_docs_env.sh`` script in the share/ci/scripts/<Platform> directory
|
||||
will install the Python-related requirements for building the documentation
|
||||
(Sphinx, six, testresources, recommonmark, sphinx-press-theme, sphinx-tabs,
|
||||
and breathe) and Doxygen.
|
||||
|
||||
Use GitBash (`provided with Git for Windows <https://gitforwindows.org/>`_) to
|
||||
execute the script on Windows.
|
||||
|
||||
Python 3 is required to build the documentation. If you have multiple Python
|
||||
installs you'll need to make sure pip and CMake find the correct version. You
|
||||
can manually inform CMake of which to use by adding this option to the below
|
||||
`cmake` command, which configures the documentation build:
|
||||
|
||||
-DPython_ROOT=<Path to Python 3 root directory>
|
||||
|
||||
For the Python packages, ensure their locations are in your ``PYTHONPATH``
|
||||
environment variable prior to configuring the build.
|
||||
|
||||
Building the docs
|
||||
*****************
|
||||
|
||||
Just like a :ref:`regular build from source <building-from-source>`,
|
||||
but specify the ``-D OCIO_BUILD_DOCS=yes`` argument to CMake.
|
||||
The build is just like a :ref:`regular build from source <building-from-source>`,
|
||||
but specify the ``-D OCIO_BUILD_DOCS=ON`` argument to CMake.
|
||||
|
||||
Then run the ``make doc`` target. The default HTML output will be
|
||||
Then run the ``make docs`` target. The default HTML output will be
|
||||
created in ``build_dir/docs/build-html/``
|
||||
|
||||
Note that CMake must be run before each invocation of ``make`` to copy
|
||||
@@ -37,7 +58,50 @@ Initial run::
|
||||
|
||||
Then after each change you wish to preview::
|
||||
|
||||
$ cmake -D OCIO_BUILD_DOCS=yes .. && make doc
|
||||
$ cmake -D OCIO_BUILD_DOCS=ON .. && make docs
|
||||
|
||||
Updating the Python docs
|
||||
************************
|
||||
|
||||
If a contributor makes changes to any part of OCIO which affects the Python API docs
|
||||
(so, public headers, Python bindings, any documentation process code, etc.) they should
|
||||
do a local build with the new CMake option -DOCIO_BUILD_FROZEN_DOCS=ON, and add the
|
||||
modified rST files under docs/api/python/frozen to their PR.
|
||||
|
||||
Note: If you run the scripts on Linux, the freezing process should work well. On other
|
||||
platforms, the process may sometimes make spurious deltas to rST files unrelated to your
|
||||
changes. Please don't add these files to your PR.
|
||||
|
||||
The OCIO conf.py module has a switch that detects when docs are being built on GH Actions
|
||||
(CI env var == true) it will backup the frozen folder to a sibling backup folder on Sphinx
|
||||
init, and following Sphinx build completion will do a file-by-file comparison of the new
|
||||
frozen and the backup folders. If there are differences, the CI job may fail with an error
|
||||
explaining where the differences were found and with instructions on how to fix them.
|
||||
|
||||
The conf.py also has a switch that detects when it is being run on RTD, and in that case
|
||||
will itself run Doxygen to generate the XML needed by breathe prior to building the docs,
|
||||
and will also facilitate a CMake configure_file-like process (via Python) to handle
|
||||
substitutions in headers and docs source files that CMake would usually handle, but can't
|
||||
in this case. One potential plus to all of this is that if someone wants to just build
|
||||
OCIO docs, they can technically do so by running sphinx-build in the docs directory, and
|
||||
nothing more. Right now that only works when the READTHEDOCS env var == True, but it could
|
||||
be easily exposed another way if needed.
|
||||
|
||||
These features required several custom Sphinx extensions tuned for our project which are
|
||||
located under share/docs.
|
||||
|
||||
Building the docs -- Excluding the API docs
|
||||
*******************************************
|
||||
|
||||
If you don't need to build the API documentation, there is a quick and dirty way to
|
||||
do a docs build. This approach does not need to compile the C++ code but is not ideal
|
||||
since it modifies files in the source directory rather than the build directory:
|
||||
|
||||
export READTHEDOCS=True
|
||||
cd docs (in the source directory)
|
||||
mkdir _build
|
||||
sphinx-build -b html . _build
|
||||
<your web browser name> _build/index.html
|
||||
|
||||
Basics
|
||||
******
|
||||
@@ -79,6 +143,30 @@ Basics
|
||||
|
||||
In order to bake a LUT, ...
|
||||
|
||||
Quirks
|
||||
******
|
||||
|
||||
The vuepress theme that we've migrated to has some quirks to its design. For
|
||||
example, it only allows two nested table of contents (TOC). So things have to be
|
||||
organized in a slightly different way than other sphinx projects.
|
||||
|
||||
The root-level `toc_redirect.rst` points to where to find the different section
|
||||
TOCs. The name and contents of each sections TOC is defined in that
|
||||
sub-directory's `_index.rst` file.
|
||||
|
||||
In this TOC the `:caption:` directive determines what the name of the section
|
||||
will be in the sidebar, and in the header of the website. The *H1* header
|
||||
determines the name of the page in the right/left arrows navigation bar. In a
|
||||
lot of cases this ends up doubling up the name on the page, but this seems
|
||||
unavoidable at the present time. If additional explanatory text is put in the
|
||||
`_index.rst` files then it shouldn't be as problematic.
|
||||
|
||||
The site will show all *H1* headers in the side panel by default, these then
|
||||
expand when selected to show all *H2* headers.
|
||||
|
||||
Due to the limited TOC and sidebar depth, we shouldn't be afraid of looong
|
||||
pages with many *H2* headings to break down the page into logical quadrants.
|
||||
|
||||
Emacs rST mode
|
||||
**************
|
||||
|
||||
|
||||
@@ -45,32 +45,32 @@ continuous integration (CI) workflows for all supported platforms. Each .yml
|
||||
file defines one GHA workflow, which can contain one or more jobs and the
|
||||
repository events that trigger the workflow.
|
||||
|
||||
ASWF
|
||||
****
|
||||
|
||||
This subdirectory contains important ASWF governance documents like the
|
||||
OpenColorIO charter, CLAs and DCO reference.
|
||||
|
||||
The ``meetings`` subdirectory contains historical meeting minutes for
|
||||
TSC (Technical Steering Committee) and working group meetings. More
|
||||
recent TSC and working group meeting notes are stored on the
|
||||
`ASWF Wiki. <https://wiki.aswf.io/display/OCIO/Meetings>`_
|
||||
|
||||
docs
|
||||
****
|
||||
|
||||
This directory contains the OpenColorIO documentation source and build
|
||||
configuration.
|
||||
|
||||
The ``guides/contributing/tsc`` subdirectory contains meeting minutes for all
|
||||
recorded TSC (Technical Steering Committee) and working group meetings. The
|
||||
``guides/contributing/aswf`` subdirectory contains important ASWF governance
|
||||
documents like the OpenColorIO charter, CLAs and DCO reference.
|
||||
|
||||
See :ref:`documentation-guidelines` for information on contributing to OCIO
|
||||
documentation.
|
||||
|
||||
ext
|
||||
***
|
||||
|
||||
This directory serves two purposes:
|
||||
|
||||
1. House modified external dependencies which are permissible to store within
|
||||
the OpenColorIO repository. Permissible dependencies have compatible FOSS
|
||||
licenses which have documented approval by the ASWF governing board.
|
||||
|
||||
2. Location for external dependencies temporarily installed and statically
|
||||
linked by OpenColorIO when using the CMake ``OCIO_INSTALL_EXT_PACKAGES``
|
||||
option with the value ``MISSING`` or ``ALL``.
|
||||
Houses modified external dependencies which are permissible to store within
|
||||
the OpenColorIO repository. Permissible dependencies have compatible FOSS
|
||||
licenses which have documented approval by the ASWF governing board.
|
||||
|
||||
include
|
||||
*******
|
||||
|
||||
@@ -13,8 +13,8 @@ Code Review
|
||||
Ask early, and ask often!
|
||||
|
||||
All new contributors are highly encouraged to post development ideas, questions,
|
||||
or any other thoughts to the :ref:`mailing_lists` before starting to code. This
|
||||
greatly improves the process and quality of the resulting library. Code
|
||||
or any other thoughts to :ref:`slack` or the :ref:`mailing_lists` before starting to
|
||||
code. This greatly improves the process and quality of the resulting library. Code
|
||||
reviews (particularly for non-trivial changes) are typically far simpler if the
|
||||
reviewers are aware of a development task beforehand. (And, who knows? Maybe they
|
||||
will have implementation suggestions as well!)
|
||||
@@ -73,6 +73,12 @@ assistance.
|
||||
git add .
|
||||
git commit -s -m 'Implement my feature'
|
||||
|
||||
* If your PR changes anything that appears in the public API documentation,
|
||||
you should follow the directions below in "Updating the Python docs".
|
||||
If this proves problematic for you, please reach out for help on Slack.
|
||||
One of the other developers will probably be able to make the updates
|
||||
for you in another PR.
|
||||
|
||||
* Push your changes back to origin (your fork)::
|
||||
|
||||
git push -u origin myFeature
|
||||
|
||||
@@ -16,6 +16,18 @@ If you are a developer and would like assistance integrating OCIO into your
|
||||
application, please contact ocio-dev as well.
|
||||
|
||||
|
||||
3ds Max (Autodesk)
|
||||
******************
|
||||
|
||||
Website : `<https://www.autodesk.com/products/3ds-max/overview>`__
|
||||
|
||||
Supported Version: >= 2024
|
||||
|
||||
Documentation :
|
||||
|
||||
- `Color Management <https://help.autodesk.com/view/3DSMAX/2024/ENU/?guid=GUID-AF6FB34D-5453-4AE2-A987-388A4BB5AAFD>`__
|
||||
|
||||
|
||||
After Effects
|
||||
*************
|
||||
|
||||
@@ -231,9 +243,17 @@ Supported Version: >= 2016
|
||||
|
||||
Documentation:
|
||||
|
||||
- `Use an OCIO configuration file for color management <https://knowledge.autodesk.com/support/maya-lt/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/MayaLT/files/GUID-4AE9AABC-A900-4276-AFE4-F9DCD96BA03D-htm.html>`__
|
||||
- `Get Started with Color Management <https://help.autodesk.com/view/MAYAUL/2024/ENU/?guid=GUID-B260195C-A0FE-4F51-9EA2-099B61B7725A>`__
|
||||
|
||||
- `What's New in Rendering <https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Maya/files/GUID-C22F815A-8390-405B-BA50-74FEC42C75E0-htm.html>`__
|
||||
- `Color Management in Maya: Setting up a scene <https://youtu.be/bVYg8ZyljLs>`__
|
||||
|
||||
- `Color Management in Maya: Input Spaces <https://youtu.be/biGWwdqaimY>`__
|
||||
|
||||
- `Color Management in Maya: Previewing and Rendering <https://youtu.be/Pvxqc5NC_b4>`__
|
||||
|
||||
- `Color Management in Maya: Color Picking <https://youtu.be/mgKHMrJ8DIY>`__
|
||||
|
||||
- `Color Management in Maya: ACES default <https://youtu.be/FODVxXOIrvM>`__
|
||||
|
||||
|
||||
Mocha Pro (Boris FX)
|
||||
|
||||
@@ -24,6 +24,26 @@ Note that some tools depend on OpenEXR or OpenImageIO and other libraries:
|
||||
.. TODO: check app lib dependencies
|
||||
.. TODO: make a pretty table in RST.
|
||||
|
||||
.. _overview-ocioarchive:
|
||||
|
||||
ocioarchive
|
||||
***********
|
||||
|
||||
This command-line tool allows you to convert a config and its external LUT files
|
||||
into an OCIOZ archive file. A .ocioz file may be supplied to any command that
|
||||
takes the path to a config or set as the OCIO environment variable.
|
||||
|
||||
This example creates a file called myarchive.ocioz::
|
||||
|
||||
$ ocioarchive myarchive --iconfig myconfig/config.ocio
|
||||
|
||||
This command will expand it back out::
|
||||
|
||||
$ ocioarchive --extract myarchive.ocioz
|
||||
|
||||
The --list option may be used to see the contents of a .ocioz file.
|
||||
|
||||
|
||||
.. _overview-ociocheck:
|
||||
|
||||
ociocheck
|
||||
@@ -33,7 +53,7 @@ This is a command-line tool which shows an overview of an OCIO config
|
||||
file, and checks for obvious errors.
|
||||
|
||||
For example, the following shows the output of a config with a typo -
|
||||
the colorspace used for ``compositing_log`` is not incorrect::
|
||||
the colorspace used for ``compositing_log`` is incorrect::
|
||||
|
||||
$ ociocheck --iconfig example.ocio
|
||||
|
||||
@@ -189,6 +209,17 @@ not the case. Also, it does not leverage any of the new OCIO v2 features.
|
||||
.. TODO: Link to discussion of OpenImageIO source?
|
||||
|
||||
|
||||
.. _overview-pyociodisplay:
|
||||
|
||||
pyociodisplay
|
||||
*************
|
||||
|
||||
The pyociodisplay tool is a minimal image viewer implementation demonstrating use of
|
||||
the OCIO GPU renderer in a Python application. It requires downloading a few dependencies
|
||||
before use. For more information, please see the
|
||||
`README. <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/src/apps/pyociodisplay>`_
|
||||
|
||||
|
||||
.. _overview-ociolutimage:
|
||||
|
||||
ociolutimage
|
||||
@@ -240,6 +271,7 @@ ACES2065-1::
|
||||
The --list argument will print out all of the standard ACES color spaces that are
|
||||
supported as --csc arguments.
|
||||
|
||||
|
||||
.. _overview-ocioperf:
|
||||
|
||||
ocioperf
|
||||
@@ -272,6 +304,17 @@ Examples::
|
||||
|
||||
.. TODO: examples formatting
|
||||
|
||||
|
||||
.. _overview-ocioview:
|
||||
|
||||
ocioview
|
||||
********
|
||||
|
||||
This is a new GUI tool for inspecting and editing config files. It is currently an
|
||||
alpha release and we are looking for contributors to extend it or provide tutorials.
|
||||
Please see the README in apps/ocioview for details about installation.
|
||||
|
||||
|
||||
.. _overview-ociowrite:
|
||||
|
||||
ociowrite
|
||||
@@ -298,3 +341,16 @@ Here is an example::
|
||||
|
||||
$ export OCIO=/path/to/the/config.ocio
|
||||
$ ociowrite --colorspaces acescct aces2065-1 --file mytransform.ctf
|
||||
|
||||
|
||||
.. _overview-pyocioamf:
|
||||
|
||||
pyocioamf
|
||||
*********
|
||||
|
||||
The pyocioamf tool is an initial attempt to support the ACES Metadata File (AMF)
|
||||
`format. <https://docs.acescentral.com/guides/amf/>`_
|
||||
This Python script will take an AMF file and produce an OCIO CTF file that implements its color
|
||||
pipeline. The CTF file may be applied to images using tools such as :ref:`overview-ocioconvert`.
|
||||
For more information, please see the
|
||||
`README. <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/src/apps/pyocioamf>`_
|
||||
|
||||
+13
-14
@@ -20,31 +20,30 @@ OCIO v1 represented the culmination of years of production experience earned on
|
||||
films as SpiderMan 2 (2004), Surf's Up (2007), Cloudy with a Chance of Meatballs
|
||||
(2009), Alice in Wonderland (2010), and many more.
|
||||
|
||||
OpenColorIO v2 has been in development since 2017 and was feature complete as of
|
||||
OpenColorIO v2 was in development from 2017 to 2020 and was feature complete as of
|
||||
SIGGRAPH 2020. After a stabilization and bug-fixing period, an official 2.0.0
|
||||
release was made in January 2021. OCIO v2 is in the VFX Reference Platform for
|
||||
calendar year 2021. The OCIO v2 code is in the RB-2.0 branch on
|
||||
`GitHub <https://github.com/AcademySoftwareFoundation/OpenColorIO>`_
|
||||
and we encourage developers to start integrating and providing feedback.
|
||||
See :ref:`upgrading_to_v2` for more.
|
||||
release was made in January 2021. Development has continued to be active since
|
||||
then with the 2.1 release in 2021, the 2.2 release in 2022, and the 2.3 release
|
||||
in 2023 adding even more capabilities. Here is more information about our :ref:`upgrading_to_v2`.
|
||||
|
||||
|
||||
About the Documentation
|
||||
=======================
|
||||
|
||||
The documentation is a work-in-progress and we would love to have your help to
|
||||
improve it! An easy way to get involved is to join the #docs channel on
|
||||
:ref:`slack`.
|
||||
|
||||
The documentation has been updated to include most of the new OCIO v2 features
|
||||
The documentation has been updated to include basic coverage of the new OCIO v2 features
|
||||
but additional work is needed to provide more detail and tutorials about how to
|
||||
best leverage them. We will be working on that over the coming weeks.
|
||||
best leverage them. We have an OCIO User Experience (UX) working group that is
|
||||
gradually working on more coverage.
|
||||
|
||||
The documentation is a work-in-progress and we would love to have your help to
|
||||
improve it! An easy way to get involved is to join the #docs or #ux channel on
|
||||
:ref:`slack`.
|
||||
|
||||
Accessing Other Versions
|
||||
************************
|
||||
|
||||
You are reading the documentation for OCIO v2. The documentation for the the previous
|
||||
stable release (1.1.1) is available `here <https://opencolorio.org/old/index.html>`_.
|
||||
You are reading the documentation for OCIO v2. The documentation for the earlier
|
||||
1.x series of releases is available `here <https://opencolorio.org/old/index.html>`_.
|
||||
|
||||
|
||||
Community
|
||||
|
||||
@@ -7,44 +7,13 @@
|
||||
Downloads
|
||||
=========
|
||||
|
||||
* Sample OCIO Configurations -- `.zip <https://github.com/imageworks/OpenColorIO-Configs/zipball/master>`__ `.tar.gz <https://github.com/imageworks/OpenColorIO-Configs/tarball/master>`__
|
||||
* `OCIO v2 ACES Configurations <https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/releases>`_
|
||||
* OCIO v1 Legacy Configurations -- `.zip <https://github.com/imageworks/OpenColorIO-Configs/zipball/master>`__ `.tar.gz <https://github.com/imageworks/OpenColorIO-Configs/tarball/master>`__
|
||||
* Reference Images v1.0v4 -- `.tgz <https://code.google.com/p/opencolorio/downloads/detail?name=ocio-images.1.0v4.tgz>`__
|
||||
* Core Library v2.0.0 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.0.0.zip>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v2.0.0.tar.gz>`__
|
||||
* Core Library dev -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/main>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/main>`__
|
||||
|
||||
Per-version updates: :ref:`changelog-main`.
|
||||
|
||||
Build instructions: :ref:`building-from-source`.
|
||||
* `OCIO Library source code <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases>`_
|
||||
|
||||
.. _contributor-license-agreements:
|
||||
|
||||
Contributor License Agreements
|
||||
******************************
|
||||
Please see the `OCIO GitHub repository <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/docs/aswf>`__
|
||||
|
||||
Deprecated Downloads
|
||||
********************
|
||||
* Reference Images v1.0v3 `tgz <https://code.google.com/p/opencolorio/downloads/detail?name=ocio-images.1.0v3.tgz>`__
|
||||
* Reference Images v1.0v2 `tgz <https://code.google.com/p/opencolorio/downloads/detail?name=ocio-images.1.0v2.tgz>`__
|
||||
* Reference Images v1.0v1 `tgz <https://code.google.com/p/opencolorio/downloads/detail?name=ocio-images.1.0v1.tgz>`__
|
||||
|
||||
* Core Library v1.1.1 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v1.1.1.zip>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v1.1.1.tar.gz>`__
|
||||
* Core Library v1.1.0 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.1.0>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.1.0>`__
|
||||
* Core Library v1.0.9 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.9>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.9>`__
|
||||
* Core Library v1.0.8 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.8>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.8>`__
|
||||
* Core Library v1.0.7 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.7>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.7>`__
|
||||
* Core Library v1.0.6 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.6>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.6>`__
|
||||
* Core Library v1.0.5 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.5>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.5>`__
|
||||
* Core Library v1.0.4 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.4>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.4>`__
|
||||
* Core Library v1.0.3 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.3>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.3>`__
|
||||
* Core Library v1.0.2 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.2>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.2>`__
|
||||
* Core Library v1.0.1 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.1>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.1>`__
|
||||
* Core Library v1.0.0 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v1.0.0>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v1.0.0>`__
|
||||
|
||||
* Color Config v0.7v4 `tgz <https://code.google.com/p/opencolorio/downloads/detail?name=ocio-configs.0.7v4.tgz>`__ (OCIO v0.7.6+)
|
||||
* Core Library v0.8.7 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v0.8.7>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v0.8.7>`__
|
||||
* Core Library v0.7.9 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v0.7.9>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v0.7.9>`__
|
||||
* Core Library v0.6.1 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v0.6.1>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v0.6.1>`__
|
||||
* Core Library v0.5.16 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v0.5.16>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v0.5.16>`__
|
||||
* Core Library v0.5.8 -- `.zip <https://github.com/AcademySoftwareFoundation/OpenColorIO/zipball/v0.5.8>`__ `.tar.gz <https://github.com/AcademySoftwareFoundation/OpenColorIO/tarball/v0.5.8>`__
|
||||
|
||||
Please see the `OCIO GitHub repository <https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/main/docs/aswf/cla_dco.rst>`__
|
||||
|
||||
@@ -14,7 +14,12 @@ each application.
|
||||
Note that OCIO configurations are required to do any 'real' work, and are
|
||||
available separately on the :ref:`downloads` section of this site. Example
|
||||
images are also available. For assistance customizing .ocio configurations,
|
||||
contact `ocio-user <https://lists.aswf.io/g/ocio-user>`__\.
|
||||
contact `ocio-user <https://lists.aswf.io/g/ocio-user>`_ or the #configs
|
||||
channel on :ref:`slack`
|
||||
|
||||
If your application supports OCIO 2.2 or later, you may take advantage of the
|
||||
configurations built into OCIO itself. For example, by setting the config path to:
|
||||
``ocio://default``.
|
||||
|
||||
- Step 1: set the ``$OCIO`` environment-variable to ``/path/to/your/config.ocio``
|
||||
- Step 2: Launch supported application.
|
||||
@@ -23,6 +28,6 @@ If you are on a platform that is not envvar friendly, most applications also
|
||||
provide a menu option to select a different OCIO configuration after launch.
|
||||
|
||||
Please be sure to select a configuration that matches your color workflow (VFX
|
||||
work typically requires a different profile than animated features). If you need
|
||||
work sometimes requires a different profile than animated features). If you need
|
||||
assistance picking a profile, email
|
||||
`ocio-user <https://lists.aswf.io/g/ocio-user>`__\.
|
||||
|
||||
@@ -7,11 +7,10 @@
|
||||
Quick Start for Config Authors
|
||||
==============================
|
||||
|
||||
Get started by following the :ref:`installation` instructions. Note that if
|
||||
you want to try out the new OpenColorIO v2 features, you'll need to build
|
||||
from source. You will want to make sure to build the command-line tools as
|
||||
well as the library itself, so you should install OpenImageIO or OpenEXR before
|
||||
building (OCIO is now able to build the latter itself).
|
||||
As a config author, you'll want access to the OCIO command-line tools such as
|
||||
``ociocheck``. Please see the :ref:`installation` instructions for the various
|
||||
options, for example Homebrew on macOS and Vcpkg on Windows. On Linux you may
|
||||
need to build from source.
|
||||
|
||||
Grab the available configuration files (and the sample images, if you want) from
|
||||
:ref:`downloads` so you'll have some examples to study.
|
||||
|
||||
@@ -15,9 +15,10 @@ testing, example configs, and documentation as well as actual coding.
|
||||
issues with the ``good first issue`` label.
|
||||
|
||||
* If you want to help develop config files, start by looking at :ref:`quick_start_config_authors`
|
||||
and join the #configs channel on :ref:`slack`.
|
||||
and join the #configs channel on :ref:`slack`. From there, you may want to join the
|
||||
OCIO Configs working group.
|
||||
|
||||
* If you want to help with documentation, join the #docs channel on :ref:`slack`.
|
||||
* If you want to help with documentation, join the #docs and #ux channel on :ref:`slack`.
|
||||
|
||||
* If you want to help test, join the #general channel on :ref:`slack` and
|
||||
let us know you want to help test.
|
||||
|
||||
@@ -8,10 +8,12 @@ Quick Start for Developers
|
||||
==========================
|
||||
|
||||
Get started by following the :ref:`installation` instructions to build OCIO from
|
||||
source. You will want to make sure to build the command-line tools as well as the
|
||||
library itself, so you should install OpenImageIO or OpenEXR before building
|
||||
(OCIO is now able to build the latter itself). Note that active development of
|
||||
OCIO v2 is happening in the main branch.
|
||||
source. In addition to the library itself, you will want to make sure to build the
|
||||
command-line tools, including ``ocioconvert``.
|
||||
|
||||
Note that active development of OCIO v2 is happening in the main branch.
|
||||
|
||||
Watch the OCIO SIGGRAPH course listed in :ref:`publications`.
|
||||
|
||||
Grab the available configuration files (and the sample images, if you want) from
|
||||
:ref:`downloads`.
|
||||
@@ -22,12 +24,16 @@ the :ref:`overview-ocioconvert` tool to process an image from one color space to
|
||||
Try using :ref:`overview-ociodisplay` to view an image through a color space conversion.
|
||||
|
||||
Take a look at the example code in the :ref:`developers-usageexamples` and then study
|
||||
the code for the command-line tools, which is under src/apps.
|
||||
the code for the command-line tools, which is under ``src/apps``.
|
||||
|
||||
There are helper classes under src/libutils/apphelpers for common application tasks
|
||||
There are helper classes under ``src/libutils/apphelpers`` for common application tasks
|
||||
such as generating color space menus, building a viewing pipeline for a viewport,
|
||||
and writing a color picker for scene-linear color spaces.
|
||||
|
||||
Look through the :ref:`concepts_overview` to get a sense of the big picture.
|
||||
|
||||
Check out :ref:`upgrading_to_v2` for an overview of the new features in OCIO v2.
|
||||
|
||||
Join the #dev and #ux channel on :ref:`slack`. From the #ux channel, you may want to
|
||||
get involved with the OCIO User Experience (UX) working group which discusses best
|
||||
practices for implementing OCIO support in applications.
|
||||
|
||||
+282
-136
@@ -5,30 +5,46 @@
|
||||
.. _installation:
|
||||
|
||||
Installation
|
||||
************
|
||||
============
|
||||
|
||||
Although OpenColorIO is available through a variety of package managers, please note that the
|
||||
version available through a given package manager may be significantly outdated when compared to
|
||||
the current official OCIO release. Even two years after the introduction of OpenColorIO v2, several
|
||||
package managers continue to install OCIO 1.1.1.
|
||||
Installation may be done either by installing pre-built binaries from various package
|
||||
managers or by building from source. (The OCIO project currently does not provide
|
||||
pre-built libraries as downloadable artifacts other than through package managers.)
|
||||
|
||||
Please note that the version available through a given package manager may be significantly
|
||||
outdated when compared to the current official OCIO release, so please verify the version
|
||||
you install is current. (Unfortunately, even two years after the introduction of
|
||||
OpenColorIO v2, several package managers continue to install OCIO 1.1.1.)
|
||||
|
||||
Alternatives
|
||||
************
|
||||
|
||||
.. _Python:
|
||||
|
||||
Python
|
||||
^^^^^^
|
||||
++++++
|
||||
|
||||
If you only need the Python bindings, the simplest solution is to take advantage of the pre-built
|
||||
wheels in the Python Package Installer (PyPi) `here <https://pypi.org/project/opencolorio>`__. It
|
||||
can be installed by using this command::
|
||||
If you only need the Python binding and command-line tools, the simplest solution is to
|
||||
take advantage of the pre-built wheels in the Python Package Index (PyPI)
|
||||
`here <https://pypi.org/project/opencolorio>`_. It can be installed as follows, once you
|
||||
have Python installed.
|
||||
|
||||
**PyPI**::
|
||||
|
||||
pip install opencolorio
|
||||
|
||||
OpenImageIO
|
||||
^^^^^^^^^^^
|
||||
The pre-built wheels are listed `here <https://pypi.org/project/opencolorio/#files>`_. Note that
|
||||
source code is provided, so it may be possible for ``pip`` to compile the binding on your machine if
|
||||
the matrix of Python version and platform version does not have the combination you need. More
|
||||
detailed instructions are available for how to use
|
||||
`pip. <https://packaging.python.org/en/latest/tutorials/installing-packages/>`_
|
||||
|
||||
If you only need to apply color conversions to images, please note that OpenImageIO's oiiotool has
|
||||
most of the functionality of the ocioconvert command-line tool (although not everything, such as
|
||||
GPU processing). OpenImageIO is available via several package managers (including brew and vcpkg).
|
||||
OpenImageIO
|
||||
+++++++++++
|
||||
|
||||
If you only need to apply color conversions to images, please note that OpenImageIO's ``oiiotool`` has
|
||||
most of the functionality of the ``ocioconvert`` command-line tool (although not everything, such as
|
||||
GPU processing). OpenImageIO is available via several package managers (including Homebrew and Vcpkg).
|
||||
|
||||
**Homebrew**::
|
||||
|
||||
@@ -38,16 +54,17 @@ GPU processing). OpenImageIO is available via several package managers (includin
|
||||
|
||||
vcpkg install openimageio[opencolorio,tools]:x64-windows --recurse
|
||||
|
||||
Installing OpenColorIO using existing packages
|
||||
**********************************************
|
||||
|
||||
Installing OpenColorIO using Package Managers
|
||||
=============================================
|
||||
|
||||
Linux
|
||||
^^^^^
|
||||
*****
|
||||
|
||||
When it comes to Linux distributions, relatively few of the Linux distribution repositories have been
|
||||
updated to OCIO v2. The **latest Fedora** is one good option as it offers the most
|
||||
recent release of OpenColorIO v2. Information about the package can be found on
|
||||
`fedoraproject website <https://packages.fedoraproject.org/pkgs/OpenColorIO/OpenColorIO/index.html>`__.
|
||||
When it comes to Linux distributions, relatively few of the Linux distribution repositories
|
||||
have been updated to OCIO v2. The **latest Fedora** is one good option as it offers a
|
||||
recent release of OpenColorIO v2. Information about the package can be found on the
|
||||
`Fedora project website <https://packages.fedoraproject.org/pkgs/OpenColorIO/OpenColorIO/index.html>`__.
|
||||
|
||||
For the other distributions, information about which release of OpenColorIO is available can be
|
||||
verified on `pkgs.org <https://pkgs.org/search/?q=OpenColorIO>`__.
|
||||
@@ -55,72 +72,88 @@ verified on `pkgs.org <https://pkgs.org/search/?q=OpenColorIO>`__.
|
||||
**The recommendation is to build OpenColorIO from source**. You may build from source using the
|
||||
instructions below. See :ref:`building-from-source`.
|
||||
|
||||
Windows 7 or newer using vcpkg
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Windows using Vcpkg
|
||||
*******************
|
||||
|
||||
Vcpkg can be used to install OpenColorIO on Windows. In order to do that, Vcpkg must be installed
|
||||
Vcpkg can be used to install OpenColorIO on Windows 7 or higher. To do that, Vcpkg must be installed
|
||||
by following the `official instructions <https://vcpkg.io/en/getting-started.html>`__. Once Vcpkg
|
||||
is installed, OpenColorIO and some of the tools can be installed with the following command::
|
||||
|
||||
vcpkg install opencolorio[tools]:x64-windows
|
||||
|
||||
Note that this package **does not** install ocioconvert, ociodisplay, ociolutimage and the Python
|
||||
bindings.
|
||||
Note that this package **does not** install ``ocioconvert``, ``ociodisplay``, ``ociolutimage``,
|
||||
and the Python binding.
|
||||
|
||||
The three missing tools can be built from source by following the steps in the :ref:`Windows 7 or newer`
|
||||
section while the Python bindings can be install using the pip command in the :ref:`Python` section.
|
||||
If you need the extra command-line tools, you'll need to install :ref:`from source. <Windows>`
|
||||
However, the Python binding can be installed as described in the :ref:`Python` section.
|
||||
|
||||
OS X using Homebrew
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
MacOS using Homebrew
|
||||
*******************
|
||||
|
||||
You can use the Homebrew package manager to install OpenColorIO on OS X.
|
||||
You can use the Homebrew package manager to install OpenColorIO on macOS.
|
||||
|
||||
First install Homebrew as per the instructions on the `Homebrew
|
||||
homepage <http://mxcl.github.com/homebrew/>`__ (or see the `Homebrew wiki
|
||||
<https://github.com/mxcl/homebrew/wiki/Installation>`__ for more
|
||||
detailed instructions)
|
||||
homepage <https://brew.sh/>`__ (or see the `Homebrew documentation
|
||||
<https://docs.brew.sh/>`__ for more detailed instructions).
|
||||
|
||||
Then simply run the following command to install::
|
||||
|
||||
brew install opencolorio
|
||||
|
||||
Homebrew does not install the Python binding or the command-line tools that depend on OpenImageIO
|
||||
such as ocioconvert, ociodisplay and ociolutimage.
|
||||
Homebrew does not install the Python binding or the command-line tools that depend on either
|
||||
OpenImageIO or OpenEXR such as ``ocioconvert``, ``ociodisplay``, and ``ociolutimage``.
|
||||
|
||||
.. _building-from-source:
|
||||
|
||||
Building from source
|
||||
********************
|
||||
Building from Source
|
||||
====================
|
||||
|
||||
The basic requirements to build OCIO from source on Linux, macOS, and Windows are a
|
||||
supported C++ compiler, CMake, and an internet connection. The OCIO Cmake scripts are
|
||||
able to download, build, and install all other required components. However, more
|
||||
advanced users are also able to have the build use their own version of dependencies.
|
||||
|
||||
Dependencies
|
||||
^^^^^^^^^^^^
|
||||
************
|
||||
|
||||
The basic requirements for building OCIO are the following. Note that, by
|
||||
default, cmake will try to install all of the items labelled with * and so
|
||||
it is not necessary to install those items manually:
|
||||
OCIO depends on the following components. By default, the OCIO CMake scripts will
|
||||
download and build the items labelled with a \*, so it is not necessary to install those
|
||||
items manually:
|
||||
|
||||
- cmake >= 3.12
|
||||
Required components:
|
||||
|
||||
- C++ 11-17 compiler (gcc, clang, msvc)
|
||||
- CMake >= 3.13
|
||||
- \*Expat >= 2.4.1 (XML parser for CDL/CLF/CTF)
|
||||
- \*yaml-cpp >= 0.7.0 (YAML parser for Configs)
|
||||
- \*Imath >= 3.0 (for half domain LUTs)
|
||||
- \*pystring >= 1.1.3
|
||||
- \*minizip-ng >= 3.0.7 (for config archiving)
|
||||
- \*ZLIB >= 1.2.13 (for config archiving)
|
||||
|
||||
Some optional components also depend on:
|
||||
Optional OCIO functionality also depends on:
|
||||
|
||||
- \*Little CMS >= 2.2 (for ociobakelut ICC profile baking)
|
||||
- \*pybind11 >= 2.9.2 (for the Python bindings)
|
||||
- Python >= 2.7 (for the Python bindings)
|
||||
- Python 3.7 or 3.8 (for the docs, with the following PyPi packages)
|
||||
- Sphinx
|
||||
- six
|
||||
- testresources
|
||||
- recommonmark
|
||||
- sphinx-press-theme
|
||||
- sphinx-tabs
|
||||
- breathe
|
||||
- NumPy (for complete Python test suite)
|
||||
- \*OpenGL GLUT & GLEW (for ociodisplay)
|
||||
- \*OpenEXR >= 3.0 (for apps including ocioconvert)
|
||||
- OpenImageIO >= 2.1.9 (for apps including ocioconvert)
|
||||
- \*OpenFX >= 1.4 (for the OpenFX plug-ins)
|
||||
- OpenShadingLanguage >= 1.11 (for the OSL unit tests)
|
||||
- Doxygen (for the docs)
|
||||
- OpenImageIO >= 2.1.9 or OpenEXR >= 3.0 (for apps including ocioconvert)
|
||||
- NumPy (optionally used in the Python test suite)
|
||||
- \*pybind11 >= 2.9.2 (for the Python binding)
|
||||
- Python >= 2.7 (for the Python binding only)
|
||||
- Python 3.7 - 3.9 (for building the documentation)
|
||||
|
||||
Building the documentation requires the following packages, available via PyPI:
|
||||
|
||||
- Sphinx
|
||||
- six
|
||||
- testresources
|
||||
- recommonmark
|
||||
- sphinx-press-theme
|
||||
- sphinx-tabs
|
||||
- breathe
|
||||
|
||||
Example bash scripts are provided in
|
||||
`share/ci/scripts <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/share/ci/scripts>`_
|
||||
@@ -132,14 +165,14 @@ available for all supported platforms. Use GitBash
|
||||
this script on Windows.
|
||||
|
||||
Automated Installation
|
||||
----------------------
|
||||
++++++++++++++++++++++
|
||||
|
||||
Listed dependencies with a preceeding * can be automatically installed at
|
||||
build time using the ``OCIO_INSTALL_EXT_PACKAGES`` option in your cmake
|
||||
command (requires an internet connection). This is the default. C/C++
|
||||
libraries are pulled from external repositories, built, and statically-linked
|
||||
into libOpenColorIO. Python packages are installed with ``pip``. All installs
|
||||
of these components are fully contained within your build directory.
|
||||
Dependencies listed above with a preceeding * can be automatically installed at
|
||||
build time using the ``OCIO_INSTALL_EXT_PACKAGES`` option in your ``cmake``
|
||||
command (requires an internet connection). The C/C++ libraries are pulled from
|
||||
external repositories, built, and are (typically) statically-linked into an OCIO
|
||||
dynamic library. All installs of these components are fully contained within your
|
||||
build directory.
|
||||
|
||||
Three ``OCIO_INSTALL_EXT_PACKAGES`` options are available::
|
||||
|
||||
@@ -153,37 +186,151 @@ Three ``OCIO_INSTALL_EXT_PACKAGES`` options are available::
|
||||
current system.
|
||||
|
||||
Existing Install Hints
|
||||
----------------------
|
||||
++++++++++++++++++++++
|
||||
|
||||
When using existing system libraries, the following CMake variables can be
|
||||
defined to hint at non-standard install locations and preference of shared
|
||||
or static linking:
|
||||
If the library is not installed in a typical location where CMake will find it,
|
||||
you may specify the location using one of the following methods:
|
||||
|
||||
- ``-Dexpat_ROOT=<path>`` (include and/or library root dir)
|
||||
- ``-Dexpat_STATIC_LIBRARY=ON`` (prefer static lib)
|
||||
- ``-Dyaml-cpp_ROOT=<path>`` (include and/or library root dir)
|
||||
- ``-Dyaml-cpp_STATIC_LIBRARY=ON`` (prefer static lib)
|
||||
- ``-DImath_ROOT=<path>`` (include and/or library root dir)
|
||||
- ``-DImath_STATIC_LIBRARY=ON`` (prefer static lib)
|
||||
- ``-DHalf_ROOT=<path>`` (include and/or library root dir)
|
||||
- ``-DHalf_STATIC_LIBRARY=ON`` (prefer static lib)
|
||||
- ``-Dpystring_ROOT=<path>`` (include and/or library root dir)
|
||||
- ``-Dpystring_STATIC_LIBRARY=ON`` (prefer static lib)
|
||||
- ``-Dlcms2_ROOT=<path>`` (include and/or library root dir)
|
||||
- ``-Dlcms2_STATIC_LIBRARY=ON`` (prefer static lib)
|
||||
- ``-Dpybind11_ROOT=<path>`` (include and/or library root dir)
|
||||
- ``-DPython_EXECUTABLE=<path>`` (Python executable)
|
||||
- Set ``-D<package_name>_DIR`` to point to the directory containing the CMake configuration file for the package.
|
||||
|
||||
- Set ``-D<package_name>_ROOT`` to point to the directory containing the lib and include directories.
|
||||
|
||||
- Set ``-D<package_name>_LIBRARY`` and ``-D<package_name>_INCLUDE_DIR`` to point to the lib and include directories.
|
||||
|
||||
Not all packages support all of the above options. Please refer the
|
||||
OCIO CMake `find modules <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/share/cmake/modules>`_ for the package that you are having trouble with to see the options it supports.
|
||||
|
||||
Usually CMake will use the dynamic library rather than static, if both are present. In this case,
|
||||
you may set <package_name>_STATIC_LIBRARY to ON to request use of the static one. If only the
|
||||
static library is present (such as when OCIO builds the dependency), then the option is not needed.
|
||||
The following packages support this option:
|
||||
``expat``, ``yaml-cpp``, ``Imath``, ``lcms2``, and ``minizip-ng``. Using CMake 3.24+, it is
|
||||
possible to prefer the static version of ``ZLIB`` with ``-DZLIB_USE_STATIC_LIBS=ON``.
|
||||
|
||||
The package names used by OCIO are as follows (note that these are case-sensitive):
|
||||
|
||||
Required:
|
||||
|
||||
- ``expat``
|
||||
- ``yaml-cpp``
|
||||
- ``Imath``
|
||||
- ``pystring``
|
||||
- ``ZLIB``
|
||||
- ``minizip-ng``
|
||||
|
||||
Optional:
|
||||
|
||||
- ``OpenEXR``
|
||||
- ``OpenImageIO``
|
||||
- ``lcms2``
|
||||
- ``pybind11``
|
||||
- ``openfx``
|
||||
- ``OSL``
|
||||
- ``Sphinx``
|
||||
- ``GLEW``
|
||||
- ``GLUT``
|
||||
- ``Python``
|
||||
|
||||
|
||||
Please note that if you provide your own ``minizip-ng``, rather than having OCIO's CMake
|
||||
download and build it, you will likely need to set its CMake variables the same way
|
||||
that OCIO does (e.g., enable ZLib and turn off most other options). Using a ``minizip-ng``
|
||||
from various package managers (e.g., Homebrew) probably won't work. Please see the
|
||||
settings that begin with ``-DMZ_`` that are used in the OCIO
|
||||
`minizip-ng find module. <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/share/cmake/modules/Findminizip-ng.cmake>`_
|
||||
|
||||
Please note that if you build a static OCIO library, it will not contain the libraries
|
||||
for the external packages and so you will need to list those separately when linking your
|
||||
client application. If you had OCIO download and build these packages, you will
|
||||
find them under your build directory in ``ext/dist/lib``. The libraries that are
|
||||
needed are: ``expat``, ``yaml-cpp``, ``Imath``, ``pystring``, ``ZLIB``, and ``minizip-ng``.
|
||||
|
||||
The OCIO ``make install`` step will install CMake configuration files that may be used
|
||||
by applications that consume OCIO to find and utilize OCIO during their own build process.
|
||||
|
||||
For the Python packages required for the documentation, ensure that their locations
|
||||
are in your ``PYTHONPATH`` environment variable prior to configuring the build.
|
||||
|
||||
This custom variable is also available:
|
||||
|
||||
- ``-DPython_EXECUTABLE=<path>`` (Python executable for pybind11)
|
||||
|
||||
|
||||
.. _enabling-optional-components:
|
||||
|
||||
Enabling optional components
|
||||
****************************
|
||||
|
||||
CMake Options
|
||||
+++++++++++++
|
||||
|
||||
There are many options available in `CMake.
|
||||
|
||||
<https://cmake.org/cmake/help/latest/guide/user-interaction/index.html#guide:User%20Interaction%20Guide>`_
|
||||
|
||||
Several of the most common ones are:
|
||||
|
||||
- ``-DCMAKE_BUILD_TYPE=Release`` (Set to Debug, if necessary)
|
||||
- ``-DBUILD_SHARED_LIBS=ON`` (Set to OFF to build OCIO as a static library)
|
||||
|
||||
Here are the most common OCIO-specific CMake options (the default values are shown):
|
||||
|
||||
- ``-DOCIO_BUILD_APPS=ON`` (Set to OFF to not build command-line tools)
|
||||
- ``-DOCIO_USE_OIIO_FOR_APPS=OFF`` (Set ON to build tools with OpenImageIO rather than OpenEXR)
|
||||
- ``-DOCIO_BUILD_PYTHON=ON`` (Set to OFF to not build the Python binding)
|
||||
- ``-DOCIO_BUILD_OPENFX=OFF`` (Set to ON to build the OpenFX plug-ins)
|
||||
- ``-DOCIO_USE_SIMD=ON`` (Set to OFF to turn off SIMD CPU performance optimizations, such as SSE and NEON)
|
||||
- ``-DOCIO_USE_SSE2`` (Set to OFF to turn off SSE2 CPU performance optimizations)
|
||||
- ``-DOCIO_USE_AVX`` (Set to OFF to turn off AVX CPU performance optimizations)
|
||||
- ``-DOCIO_USE_AVX2`` (Set to OFF to turn off AVX2 CPU performance optimizations)
|
||||
- ``-DOCIO_USE_F16C`` (Set to OFF to turn off F16C CPU performance optimizations)
|
||||
- ``-DOCIO_BUILD_TESTS=ON`` (Set to OFF to not build the unit tests)
|
||||
- ``-DOCIO_BUILD_GPU_TESTS=ON`` (Set to OFF to not build the GPU unit tests)
|
||||
- ``-DOCIO_USE_HEADLESS=OFF`` (Set to ON to do headless GPU rendering)
|
||||
- ``-DOCIO_WARNING_AS_ERROR=ON`` (Set to OFF to turn off warnings as errors)
|
||||
- ``-DOCIO_BUILD_DOCS=OFF`` (Set to ON to build the documentation)
|
||||
- ``-DOCIO_BUILD_FROZEN_DOCS=OFF`` (Set to ON to update the Python documentation)
|
||||
|
||||
Note that OCIO will turn off any specific SIMD CPU performance optimizations if they are not supported
|
||||
by the build target architecture. The default for ``OCIO_USE_SSE2``, ``OCIO_USE_AVX``, ``OCIO_USE_AVX2`` and
|
||||
``OCIO_USE_F16C`` depends on the architecture, but will be ON where supported.
|
||||
|
||||
On MacOS, the default is to build for the native architecture that CMake is running under.
|
||||
For example, if a x86_64 version of CMake is running under Rosetta, the native architecture will
|
||||
be x86_64, rather then arm64. You can use the ``CMAKE_OSX_ARCHITECTURES`` option to override that.
|
||||
To build universal binaries, use the following option: ``-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"``.
|
||||
|
||||
When doing a universal build, note that the OCIO dependencies must be built as universal libraries
|
||||
too. If you are running in OCIO_INSTALL_EXT_PACKAGES=MISSING or NONE mode, your build will fail if
|
||||
any of your installed libraries are not universal. The easiest way to address this is to set
|
||||
OCIO_INSTALL_EXT_PACKAGES=ALL in order to let OCIO build everything. Alternatively, you may set
|
||||
CMAKE_OSX_ARCHITECTURES to just the platform you are targeting.
|
||||
|
||||
Several command-line tools (such as ``ocioconvert``) require reading or writing image files.
|
||||
If ``OCIO_USE_OIIO_FOR_APPS=OFF``, these will be built using OpenEXR rather than OpenImageIO
|
||||
and therefore you will be limited to using OpenEXR files with these tools rather than the
|
||||
wider range of image file formats supported by OIIO. (Using OpenEXR for these tools works
|
||||
around the issue of a circular dependency between OCIO and OIIO that can complicate some
|
||||
build chains.)
|
||||
|
||||
The CMake output prints information regarding which image library will be used for the
|
||||
command-line tools (as well as a lot of other info about the build configuration).
|
||||
|
||||
|
||||
Documentation
|
||||
+++++++++++++
|
||||
|
||||
Instructions for installing the documentation pre-requisites and building the docs
|
||||
are in the section on :ref:`contributing documentation. <documentation-guidelines>`
|
||||
|
||||
To hint at Python package locations, add paths to the ``PYTHONPATH``
|
||||
environment variable prior to configuring the build.
|
||||
|
||||
.. _osx-and-linux:
|
||||
|
||||
OS X and Linux
|
||||
^^^^^^^^^^^^^^
|
||||
MacOS and Linux
|
||||
***************
|
||||
|
||||
While there is a huge range of possible setups, the following steps
|
||||
should work on OS X and most Linux distros. To keep things simple, this guide
|
||||
should work on macOS and most Linux distros. To keep things simple, this guide
|
||||
will use the following example paths - these will almost definitely be
|
||||
different for you:
|
||||
|
||||
@@ -196,12 +343,12 @@ First make the build directory and cd to it::
|
||||
$ mkdir /tmp/ociobuild
|
||||
$ cd /tmp/ociobuild
|
||||
|
||||
Next step is to run cmake, which looks for things such as the
|
||||
Next step is to run ``cmake``, which looks for things such as the
|
||||
compiler's required arguments, optional requirements like Python,
|
||||
OpenImageIO etc
|
||||
|
||||
For this example we will show how to install OCIO to a custom location
|
||||
(instead of the default ``/usr/local``), we will thus run cmake with
|
||||
(instead of the default ``/usr/local``), we will thus run ``cmake`` with
|
||||
``CMAKE_INSTALL_PREFIX``.
|
||||
|
||||
Still in ``/tmp/ociobuild``, run::
|
||||
@@ -209,8 +356,8 @@ Still in ``/tmp/ociobuild``, run::
|
||||
$ cmake -DCMAKE_INSTALL_PREFIX=/software/ocio /source/ocio
|
||||
|
||||
The last argument is the location of the OCIO source code (containing
|
||||
the main CMakeLists.txt file). You should see something along the
|
||||
lines of::
|
||||
the main CMakeLists.txt file). You should see it conclude with something
|
||||
along the lines of::
|
||||
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
@@ -231,27 +378,35 @@ the specified location::
|
||||
$ make install
|
||||
|
||||
If nothing went wrong, ``/software/ocio`` should look something like
|
||||
this::
|
||||
this (on Linux or macOS)::
|
||||
|
||||
$ cd /software/ocio
|
||||
$ ls
|
||||
bin/ include/ lib/
|
||||
bin/ include/ lib/ share/
|
||||
$ ls bin/
|
||||
ociobakelut ociocheck (and others ...)
|
||||
$ ls include/
|
||||
OpenColorIO/ PyOpenColorIO/ pkgconfig/
|
||||
OpenColorIO/
|
||||
$ ls lib/
|
||||
libOpenColorIO.a libOpenColorIO.dylib
|
||||
cmake/ libOpenColorIO.dylib (and some more specific versions ...)
|
||||
libOpenColorIOimageioapphelpers.a libOpenColorIOoglapphelpers.a
|
||||
pkgconfig/ python<version>/
|
||||
$ ls lib/pkgconfig
|
||||
OpenColorIO.pc
|
||||
$ ls lib/python<version>/site-packages
|
||||
PyOpenColorIO.so
|
||||
$ ls share/ocio
|
||||
setup_ocio.sh
|
||||
|
||||
.. _Windows 7 or newer:
|
||||
.. _Windows:
|
||||
|
||||
Windows 7 or newer
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Windows
|
||||
*******
|
||||
|
||||
While build environments may vary between users, the recommended way to build OCIO from source on
|
||||
Windows is to use the scripts provided in the Windows
|
||||
Windows 7 or newer is to use the scripts provided in the Windows
|
||||
`share <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/share/dev/windows>`_
|
||||
section of the OCIO repository. There are two scripts currently available.
|
||||
section of the OCIO repository. There are two scripts currently available.
|
||||
|
||||
The first script is called
|
||||
`ocio_deps.bat <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/share/dev/windows/ocio_deps.bat>`_
|
||||
@@ -263,14 +418,18 @@ and it provides some automation to install the most difficult dependencies. Thos
|
||||
- Glew
|
||||
- Python dependencies for documentation
|
||||
|
||||
Run this command to execute the ocio_deps.bat script::
|
||||
Run this command to execute the ocio_deps.bat script:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ocio_deps.bat --vcpkg <path to current vcpkg installation or where it should be installed>
|
||||
|
||||
The second script is called
|
||||
`ocio.bat <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/share/dev/windows/ocio.bat>`_
|
||||
and it provide a way to configure and build OCIO from source. Moreover, this script executes the
|
||||
install step of cmake as well as the unit tests. The main use case is the following::
|
||||
install step of ``cmake`` as well as the unit tests. The main use case is the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
ocio.bat --b <path to build folder> --i <path to install folder>
|
||||
--vcpkg <path to vcpkg installation> --ocio <path to ocio repository> --type Release
|
||||
@@ -282,46 +441,33 @@ For more information, please look at each script's documentation::
|
||||
|
||||
ocio_deps.bat --help
|
||||
|
||||
.. _enabling-optional-components:
|
||||
|
||||
Enabling optional components
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The OpenColorIO library is probably not all you want - the Python
|
||||
libraries bindings, the Nuke nodes and several applications are only
|
||||
built if their dependencies are found.
|
||||
|
||||
In the case of the Python bindings, the dependencies are the Python
|
||||
headers for the version you wish to use. These may be picked up by
|
||||
default - if so, when you run cmake you would see::
|
||||
|
||||
-- Python 2.6 okay, will build the Python bindings against .../include/python2.6
|
||||
|
||||
If not, you can point cmake to correct Python executable using the
|
||||
``-D PYTHON=...`` cmake flag::
|
||||
|
||||
$ cmake -D PYTHON=/my/custom/python2.6 /source/ocio
|
||||
|
||||
The applications included with OCIO have various dependencies - to
|
||||
determine these, look at the CMake output when first run::
|
||||
|
||||
-- Not building ocioconvert. Requirement(s) found: OIIO:FALSE
|
||||
|
||||
|
||||
.. _quick-env-config:
|
||||
|
||||
Quick environment configuration
|
||||
*******************************
|
||||
===============================
|
||||
|
||||
The quickest way to set the required :ref:`environment-setup` is to
|
||||
source the ``share/ocio/setup_ocio.sh`` script installed with OCIO.
|
||||
On Windows, use the corresponding setup_ocio.bat file. See OCIO's install directory under
|
||||
share/ocio.
|
||||
|
||||
For a simple single-user setup, add the following to ``~/.bashrc``
|
||||
For a temporary configuration of your terminal, you can run the following script:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Windows - Execute setup_ocio.bat
|
||||
[... path to OCIO install directory]/share/ocio/setup_ocio.bat
|
||||
# Unix - Execute setup_ocio.sh
|
||||
[... path to OCIO install directory]\share\ocio\setup_ocio.sh
|
||||
|
||||
For a more permanent option, add the following to ``~/.bashrc``
|
||||
(assuming you are using bash, and the example install directory of
|
||||
``/software/ocio``)::
|
||||
``/software/ocio``):
|
||||
|
||||
source /software/ocio/share/ocio/setup_ocio.sh
|
||||
.. code-block:: bash
|
||||
|
||||
source /software/ocio/share/ocio/setup_ocio.sh
|
||||
|
||||
The only environment variable you must configure manually is
|
||||
:envvar:`OCIO`, which points to the configuration file you wish to
|
||||
use. For prebuilt config files, see the
|
||||
@@ -336,7 +482,7 @@ configuration script etc), for example::
|
||||
.. _environment-setup:
|
||||
|
||||
Environment variables
|
||||
*********************
|
||||
=====================
|
||||
|
||||
Note: For other user facing environment variables, see :ref:`using_env_vars`.
|
||||
|
||||
@@ -345,7 +491,7 @@ Note: For other user facing environment variables, see :ref:`using_env_vars`.
|
||||
This variable needs to point to the global OCIO config file, e.g
|
||||
``config.ocio``
|
||||
|
||||
.. envvar:: DYLD_LIBRARY_PATH
|
||||
.. envvar:: DYLD_LIBRARY_PATH (macOS)
|
||||
|
||||
The ``lib/`` folder (containing ``libOpenColorIO.dylib``) must be
|
||||
on the ``DYLD_LIBRARY_PATH`` search path, or you will get an error
|
||||
@@ -356,11 +502,11 @@ Note: For other user facing environment variables, see :ref:`using_env_vars`.
|
||||
Reason: image not found
|
||||
|
||||
This applies to anything that links against OCIO, including the
|
||||
``PyOpenColorIO`` Python bindings.
|
||||
``PyOpenColorIO`` Python binding.
|
||||
|
||||
.. envvar:: LD_LIBRARY_PATH
|
||||
.. envvar:: LD_LIBRARY_PATH (Linux)
|
||||
|
||||
Equivalent to the ``DYLD_LIBRARY_PATH`` on Linux
|
||||
The Linux equivalent of the macOS ``DYLD_LIBRARY_PATH``.
|
||||
|
||||
.. envvar:: PYTHONPATH
|
||||
|
||||
|
||||
@@ -4,10 +4,13 @@
|
||||
|
||||
.. _upgrading_to_v2:
|
||||
|
||||
Upgrading to v2
|
||||
===============
|
||||
Releases
|
||||
========
|
||||
|
||||
.. toctree::
|
||||
:caption: Upgrading to v2
|
||||
|
||||
how_to
|
||||
ocio_2_3
|
||||
ocio_2_2
|
||||
ocio_2_1
|
||||
ocio_2_0
|
||||
@@ -3,15 +3,15 @@
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
OCIO 2.0 Release
|
||||
================
|
||||
|
||||
OpenColorIO v2 is a major update, three years in development, and contains a
|
||||
large number of new features. This section describes the new features and
|
||||
their relevance for both config authors and application developers.
|
||||
|
||||
Timeline
|
||||
========
|
||||
********
|
||||
|
||||
OpenColorIO v2 was proposed to the community at SIGGRAPH 2017 and reached
|
||||
"feature complete" at SIGGRAPH 2020. The official 2.0.0 release was made in
|
||||
@@ -19,14 +19,14 @@ January 2021 after a period of stabilization and refinement. OCIO v2 is in
|
||||
the VFX Reference Platform for calendar year 2021.
|
||||
|
||||
Demo Config
|
||||
===========
|
||||
***********
|
||||
There is a config file that illustrates many of the new OCIO v2 features
|
||||
described below. This is available in the configs section of the documentation
|
||||
as :ref:`ocio-v2_demo`.
|
||||
|
||||
|
||||
New Feature List
|
||||
================
|
||||
New Feature Guide
|
||||
=================
|
||||
|
||||
New GPU Renderer
|
||||
****************
|
||||
@@ -641,3 +641,21 @@ processed.
|
||||
|
||||
**Developers**: This may be useful, for example, when displaying data color spaces on
|
||||
an HDR monitor.
|
||||
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
For more detail, please see the GitHub release pages:
|
||||
|
||||
`OCIO 2.0.0 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.0.0>`_
|
||||
|
||||
`OCIO 2.0.1 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.0.1>`_
|
||||
|
||||
`OCIO 2.0.2 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.0.2>`_
|
||||
|
||||
`OCIO 2.0.3 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.0.3>`_
|
||||
|
||||
`OCIO 2.0.4 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.0.4>`_
|
||||
|
||||
`OCIO 2.0.5 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.0.5>`_
|
||||
@@ -0,0 +1,176 @@
|
||||
..
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
OCIO 2.1 Release
|
||||
================
|
||||
|
||||
Timeline
|
||||
********
|
||||
|
||||
OpenColorIO 2.1 was delivered in August 2021 and is in the VFX Reference Platform for
|
||||
calendar year 2022.
|
||||
|
||||
|
||||
New Feature Guide
|
||||
=================
|
||||
|
||||
ACES 1.3 Gamut Compression
|
||||
**************************
|
||||
|
||||
ACES 1.3 introduced a scene-referred gamut compression algorithm that compresses
|
||||
colors captured by a camera into the AP1 gamut. This avoids artifacts that may
|
||||
occur downstream (such as in the ACES Output Transforms) for scene elements such
|
||||
as colored lights. This supersedes the earlier "Blue Light Artifact Fix" LMT.
|
||||
|
||||
`ACES RGC User Guide
|
||||
<https://www.dropbox.com/scl/fi/acuu6e626s14zlitpu2w8/ACES-1.3-Reference-Gamut-Compression-User-Guide.paper?dl=0&rlkey=bbbhneq62f6r85cptpcywu08n>`_
|
||||
|
||||
`ACES RGC Implementation Guide
|
||||
<https://www.dropbox.com/scl/fi/cousf6tispmegu4fpmpr2/ACES-Gamut-Compression-Implementation-Guide.paper?dl=0&rlkey=ul38rayi7imiiy4wjo3cektb2>`_
|
||||
|
||||
The implementation includes a BuiltinTransform for the ACES Reference Gamut Compression.
|
||||
Here's what that looks like in Config YAML::
|
||||
|
||||
!<BuiltinTransform> {style: ACES-LMT - ACES 1.3 Reference Gamut Compression}
|
||||
|
||||
There is also a FixedFunctionTransform for the underlying gamut compression algorithm.
|
||||
As described in the links above, it takes seven parameter values::
|
||||
|
||||
[ Limit_Cyan, Limit_Magenta, Limit_Yellow, Threshold_Cyan, Threshold_Magenta, Threshold_Yellow, Roll-off ].
|
||||
|
||||
Here is how that looks in Config YAML with the parameters set for the ACES 1.3 Reference Gamut
|
||||
Compression::
|
||||
|
||||
!<FixedFunctionTransform> {style: ACES_GamutComp13, params: [1.147, 1.264, 1.312, 0.815, 0.803, 0.88, 1.2]}
|
||||
|
||||
And here's how it looks in a CTF file::
|
||||
|
||||
<FixedFunction inBitDepth="32f" outBitDepth="32f" style="GamutComp13Fwd" params="1.147 1.264 1.312 0.815 0.803 0.88 1.2" />
|
||||
|
||||
**Config authors**: These new transforms may be used in configs with version 2.1 or higher
|
||||
and CTF files with version 2.1 or higher.
|
||||
|
||||
|
||||
OpenFX OCIO plug-ins
|
||||
********************
|
||||
|
||||
A framework to support OpenFX plug-ins has been added and example source code may be found
|
||||
in the vendor/openfx directory. The initial set consists of two plug-ins, one for applying
|
||||
a ColorSpaceTransform and another for applying a DisplayViewTransform.
|
||||
|
||||
Some screenshots of the UI may be found in `PR #1371.
|
||||
<https://github.com/AcademySoftwareFoundation/OpenColorIO/pull/1371>`_
|
||||
|
||||
**End users**: There are currently no pre-built executables available, so you will need to
|
||||
compile these yourself.
|
||||
|
||||
**Developers**: Set the CMake variable ``-D OCIO_BUILD_OPENFX=ON`` to build the plug-ins.
|
||||
|
||||
|
||||
Support for PyPI (pip install)
|
||||
******************************
|
||||
|
||||
Python wheel generation has been added and support for the `Python Package Index (PyPI).
|
||||
<https://pypi.org/project/opencolorio/>`_
|
||||
This allows you to easily install the OCIO Python bindings without needing to build from
|
||||
source or use one of the OS-specific package managers. The command is simply::
|
||||
|
||||
pip install opencolorio
|
||||
|
||||
|
||||
Support for emitting Open Shading Language (OSL)
|
||||
************************************************
|
||||
|
||||
The OCIO GPU Renderer may now emit shaders in `Open Shading Language
|
||||
<https://github.com/AcademySoftwareFoundation/OpenShadingLanguage>`_ format. There is a
|
||||
new GpuLanguage enum: ``LANGUAGE_OSL_1``.
|
||||
|
||||
Note that the OCIO library does not need to be compiled against the OSL library but running
|
||||
the OSL unit tests does require OSL and OIIO. These will be built automatically if CMake is
|
||||
able to find them or you set ``-D OSL_ROOT`` to indicate the installed location.
|
||||
|
||||
Currently, Lut1D and Lut3D Transforms are not supported and will throw an exception if used.
|
||||
All other transforms are supported. However, dynamic properties are currently locked to
|
||||
their initial values and may not be adjusted.
|
||||
|
||||
|
||||
Support for Apple Metal Shading Language and OpenGL ES
|
||||
******************************************************
|
||||
|
||||
The OCIO GPU Renderer may now emit shaders in these other new languages. The new
|
||||
GpuLanguage enums are:
|
||||
|
||||
* ``GPU_LANGUAGE_MSL_2_0``
|
||||
* ``GPU_LANGUAGE_GLSL_ES_3_0``
|
||||
* ``GPU_LANGUAGE_GLSL_ES_1_0``
|
||||
|
||||
|
||||
Test suite for the Academy/ASC Common LUT Format (CLF)
|
||||
******************************************************
|
||||
|
||||
The set of CLF test files was expanded and a set of Python scripts was added under
|
||||
``share/clf`` which were developed by the ACES Common LUT Format Implementation Working Group.
|
||||
The scripts allow use of the OpenColorIO renderers to process a sample image through each
|
||||
CLF file in the test suite and then compare the reference images to a set of corresponding
|
||||
images from another CLF implementation to see if the differences are within the tolerance
|
||||
allowed by the `CLF Implementation Guide. <https://docs.acescentral.com/guides/clf/>`_
|
||||
|
||||
|
||||
Imath 3 support
|
||||
***************
|
||||
|
||||
OCIO and its CI system now support Imath 3 for the Half data type dependency.
|
||||
|
||||
|
||||
Noteworthy API updates
|
||||
**********************
|
||||
|
||||
getColorSpaceFromFilePath
|
||||
+++++++++++++++++++++++++
|
||||
|
||||
``Config::getColorSpaceFromFilepath()`` is now the proper way to extract a color space from
|
||||
a file path, regardless of whether the config is version 1, or version 2 or higher. It
|
||||
works regardless of whether the config has FileRules defined. Therefore, the older
|
||||
``Config::parseColorSpaceFromString()`` method (which does not work with FileRules) is
|
||||
officially deprecated.
|
||||
|
||||
Note that ``Config::getColorSpaceFromFilepath()`` always returns a color space, regardless
|
||||
of whether the config's ``strictparsing`` attribute is true or false. This was a request from
|
||||
app developers that always need a default (which is a common scenario). Please see
|
||||
`Issue #1398 <https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1398>`_
|
||||
for more details on how to take special action if ``strictparsing`` is true.
|
||||
|
||||
|
||||
getDefaultView
|
||||
++++++++++++++
|
||||
There is a new ``Config::getDefaultView(display, colorspaceName)`` method that takes
|
||||
advantage of the ViewingRules feature that was introduced in OCIO 2.0. It returns the
|
||||
default view that is most appropriate for a given color space. If the color space is
|
||||
known, developers should call this rather than ``Config::getDefaultView(display)``.
|
||||
|
||||
The motivation is that the best view transform to use varies with the color space. For
|
||||
example, a scene-referred color space typically wants some kind of tone-map such as an
|
||||
ACES Output Transform. However, a display-referred color space will look wrong with such
|
||||
a view transform since it has already been tone-mapped.
|
||||
|
||||
One scenario where this new method is ideal is when an application needs to generate
|
||||
thumbnails for a large number of images that are in a variety of color spaces. Note that
|
||||
the config must have the Viewing Rules set in order to return different views, but if the
|
||||
rules are not set, it will still return the same result as ``Config::getDefaultView(display)``,
|
||||
so it may be used with either v1 or v2 configs.
|
||||
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
For more detail, please see the GitHub release pages:
|
||||
|
||||
`OCIO 2.1.0 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.1.0>`_
|
||||
|
||||
`OCIO 2.1.1 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.1.1>`_
|
||||
|
||||
`OCIO 2.1.2 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.1.2>`_
|
||||
|
||||
`OCIO 2.1.3 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.1.3>`_
|
||||
@@ -0,0 +1,397 @@
|
||||
..
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
OCIO 2.2 Release
|
||||
================
|
||||
|
||||
Timeline
|
||||
********
|
||||
|
||||
OpenColorIO 2.2 was delivered in October 2022 and is in the VFX Reference Platform for
|
||||
calendar year 2023.
|
||||
|
||||
|
||||
New Feature Guide
|
||||
=================
|
||||
|
||||
Built-in Configs
|
||||
****************
|
||||
|
||||
The OCIO Configs Working Group has put a lot of effort into building new ACES configs that
|
||||
take advantage of the features of OCIO v2 and that are informed by the learnings from the
|
||||
previous ACES configs. The new configs are available from the project's GitHub repo:
|
||||
`OpenColorIO-Config-ACES
|
||||
<https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/releases/tag/v1.0.0>`_
|
||||
|
||||
To make them easily accessible, they are built in to the library itself and may be
|
||||
accessed directly from within applications that incorporate the OCIO 2.2 library.
|
||||
|
||||
For Users
|
||||
+++++++++
|
||||
|
||||
Wherever you are able to provide a file path to a config, you may now provide a URI-type
|
||||
string to instead use one of the built-in configs. For example, you may use these strings
|
||||
for the OCIO environment variable.
|
||||
|
||||
To use the :ref:`aces_cg`, use this string for the config path::
|
||||
ocio://cg-config-v1.0.0_aces-v1.3_ocio-v2.1
|
||||
|
||||
To use the :ref:`aces_studio`, use this string for the config path::
|
||||
ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1
|
||||
|
||||
This string will give you the current default config, which is currently the ACES CG Config::
|
||||
ocio://default
|
||||
|
||||
In future releases, it is expected that updated versions of these configs will be added,
|
||||
each with a unique name string. However, the previous strings will continue to be
|
||||
supported for backwards compatibility.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
The new URI-type strings may be passed into the existing APIs such as ``CreateFromEnv``
|
||||
and ``CreateFromFile``. There is also a new ``CreateFromBuiltinConfig``. No changes
|
||||
should be needed, but please test that users of your application may use a path containing
|
||||
a URI-type string rather than a path to a config.ocio file.
|
||||
|
||||
If you'd like to offer the built-in configs from your user interface, there is an API to
|
||||
access them through the new ``BuiltinConfigRegistry``. Here is basic Python code to
|
||||
access the registry and print the strings to present in a UI::
|
||||
|
||||
registry = ocio.BuiltinConfigRegistry().getBuiltinConfigs()
|
||||
for item in registry:
|
||||
# The short_name is the URI-style name.
|
||||
# The ui_name is the name to use in a user interface.
|
||||
short_name, ui_name, isRecommended, isDefault = item
|
||||
|
||||
# Don't present built-in configs to users if they are no longer recommended.
|
||||
if isRecommended:
|
||||
print(ui_name)
|
||||
|
||||
Prints:
|
||||
|
||||
Academy Color Encoding System - CG Config [COLORSPACES v1.0.0] [ACES v1.3] [OCIO v2.1]
|
||||
|
||||
Academy Color Encoding System - Studio Config [COLORSPACES v1.0.0] [ACES v1.3] [OCIO v2.1]
|
||||
|
||||
If your application saves the path to a config and the user enters ``ocio://default``, it
|
||||
is recommended that you don't save that as is. Instead, call
|
||||
``getDefaultBuiltinConfigName`` to get the name of the current default. This is
|
||||
guaranteed to give the same results, whereas the default config could change somewhat
|
||||
between releases. Prepend ``ocio://`` in order to save it as a valid config path. Here's
|
||||
the Python code::
|
||||
|
||||
"ocio://" + ocio.BuiltinConfigRegistry().getDefaultBuiltinConfigName()
|
||||
|
||||
|
||||
Config Archiving
|
||||
****************
|
||||
|
||||
An OCIO config, including its external LUT files, may now be packaged into a single file.
|
||||
This makes it easier to distribute configs and may slightly discourage tampering with the
|
||||
contents. An archived config may be created with the new ``ocioarchive`` command-line
|
||||
tool and is stored in a file with the extension ``.ocioz``. It is basically a compressed
|
||||
ZIP archive of the config and its LUTs.
|
||||
|
||||
To be archivable, the external LUT files must be contained within (or below) the config's
|
||||
working directory. (In OCIO terminology, the "working directory" is the directory that
|
||||
contains the config.ocio file.)
|
||||
|
||||
A config is not archivable if any of the following are true:
|
||||
|
||||
* It contains FileTransforms with a src outside the working directory
|
||||
* The search path contains paths outside the working directory
|
||||
* The search path contains paths that start with a context variable
|
||||
* The working directory is not set (if archiving a Config object)
|
||||
|
||||
Context variables are allowed but the intent is that they may only resolve to paths that
|
||||
are within or below the working directory. This is because the archiving function will
|
||||
only archive files that are within the working directory in order to ensure that if it is
|
||||
later expanded, that it will not create any files outside this directory.
|
||||
|
||||
For example, a context variable on the search path intended to contain the name of a
|
||||
sub-directory under the working directory must have the form ``./$DIR_NAME`` rather than
|
||||
just ``$DIR_NAME`` to be considered archivable. This is imperfect since there is no way to
|
||||
prevent the context variable from creating a path outside the working dir, but it should
|
||||
at least draw attention to the fact that the archive would fail if used with context vars
|
||||
that try to abuse the intended functionality.
|
||||
|
||||
All files within or below the working directory that end with an extension corresponding
|
||||
to a LUT type supported by OCIO are added to the archive. This approach was taken since
|
||||
the goal was for the archive to work with any combination of context variables that the
|
||||
original config works with. Files with other extensions or no extension are not archived.
|
||||
|
||||
|
||||
For Users
|
||||
+++++++++
|
||||
|
||||
Wherever you are able to provide a file path to a config, you may now provide a path to a
|
||||
.ocioz file. For example, you may use this for the OCIO environment variable.
|
||||
|
||||
The ``ocioarchive`` command-line tool will allow you to archive a config or to expand an
|
||||
existing archive. It will also allow you to list the contents of an archived config. Run
|
||||
``ocioarchive --help`` to get a print-out of the various options.
|
||||
|
||||
The print out from the ``ociocheck`` command-line tool now includes a new line-item
|
||||
indicating whether the config is archivable.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
The new .ocioz files may be passed into the existing APIs such as ``CreateFromEnv`` and
|
||||
``CreateFromFile``. No changes should be needed, but please test that users of your
|
||||
application may use a path containing a .ocioz file rather than a path to a config.ocio
|
||||
file.
|
||||
|
||||
The Config class has new ``isArchivable`` and ``archive`` methods. There is also an
|
||||
``ExtractOCIOZArchive`` function.
|
||||
|
||||
|
||||
Abstracting the Source of External LUT Files
|
||||
********************************************
|
||||
|
||||
The new ConfigIOProxy class allows the calling program to supply the config and any
|
||||
associated LUT files directly, without relying on the standard file system. This opens
|
||||
the door to expanded ways in which OCIO may be used.
|
||||
|
||||
The new config archiving feature was implemented using this mechanism.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
Please refer to the ``ConfigIOProxy`` class. By implementing the ``getLutData``,
|
||||
``getConfigData``, and ``getFastLutFileHash`` methods, you have control over how the
|
||||
config is provided to OCIO. No file system access to a config is required.
|
||||
|
||||
The ``CreateFromConfigIOProxy`` factory allows for the creation of a Config object from a
|
||||
ConfigIOProxy object.
|
||||
|
||||
|
||||
Converting To or From a Known Color Space
|
||||
*****************************************
|
||||
|
||||
An OCIO config defines its own self-contained universe of color spaces. But there are not
|
||||
any requirements for color spaces which must always be included or how they must be named.
|
||||
This poses difficulties for many applications which need to convert to or from certain
|
||||
known standard color spaces. For example, a renderer might have a physical sun and sky
|
||||
model which produces colors in a CIE space and it needs to convert those into the
|
||||
rendering space defined by a user's custom OCIO config. Or an application may use an SDK
|
||||
to debayer images from a digital cinema camera. The SDK produces images in a specific
|
||||
color space which then needs to be processed into something viewable through a user's
|
||||
custom OCIO config.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
OCIO v2 introduced the Interchange Roles to help address this problem but these had
|
||||
previously been optional and are unlikely to be included in OCIO v1 configs (although it
|
||||
would be perfectly legal to add them).
|
||||
|
||||
OCIO 2.2 introduces the new functions ``GetProcessorToBuiltinColorSpace`` and
|
||||
``GetProcessorFromBuiltinColorSpace`` that will allow you to convert to or from any of the
|
||||
color spaces in the built-in Default config (this is currently the ACES CG config
|
||||
described above). This built-in config includes common spaces such as "Linear Rec.709
|
||||
(sRGB)", "sRGB - Texture", "ACEScg", and "ACES2065-1".
|
||||
|
||||
If the source config defines the necessary Interchange Role (typically
|
||||
``aces_interchange``), then the conversion will be well-defined and equivalent to calling
|
||||
``GetProcessorFromConfigs`` with the source config and the Built-in config
|
||||
|
||||
However, if the Interchange Roles are not present, heuristics will be used to try and
|
||||
identify a common color space in the source config that may be used to allow the
|
||||
conversion to proceed. If the heuristics fail to find a suitable space, an exception is
|
||||
thrown. The heuristics may evolve, so the results returned by this function for a given
|
||||
source config and color space may change in future releases of the library. However, the
|
||||
Interchange Roles are required in config versions 2.2 and higher, so it is hoped that the
|
||||
need for the heuristics will decrease over time.
|
||||
|
||||
The current heuristics should work on any config (including an OCIO v1 config) that was
|
||||
generated by editing one of the ACES configs or any config that uses one of the following
|
||||
as its reference space:
|
||||
|
||||
* ACES2065-1
|
||||
* ACEScg
|
||||
* Scene-linear Rec.709 (sRGB)
|
||||
* Scene-linear Rec.2020
|
||||
* Scene-linear P3-D65
|
||||
|
||||
And that has a color space either for any of the above spaces or for an sRGB texture space
|
||||
that has "sRGB" (case-insensitive) in its color space name or one of its aliases.
|
||||
|
||||
Note that the heuristics create a Processor and evaluate color values that must match
|
||||
within a certain tolerance. No color space is selected purely based on its name alone.
|
||||
If the heuristics fail to find a recognized color space, an exception is thrown.
|
||||
|
||||
|
||||
Making the interchange roles required for config versions 2.2 or higher
|
||||
***********************************************************************
|
||||
|
||||
For Users
|
||||
+++++++++
|
||||
|
||||
Users were surveyed during the OCIO 2.2 development process as to whether the Interchange
|
||||
Roles should become mandatory. The response was overwhelmingly in favor of doing this,
|
||||
largely because it allows robust interchange of color spaces between configs or to
|
||||
external known standard color spaces.
|
||||
|
||||
Therefore, as described in the previous section, for config files of version 2.2 or
|
||||
higher, it is mandatory to define the ``aces_interchange`` role. If the config includes
|
||||
display color spaces, the ``cie_xyz_d65_interchange`` role is also required.
|
||||
|
||||
Note that the ``cie_xyz_d65_interchange`` is only used in connection with display color
|
||||
spaces (that is, with the display-referred connection space). It is not used for
|
||||
scene-referred color spaces, and indeed it is an error if a scene-referred space is
|
||||
assigned to that role.
|
||||
|
||||
The ``ociocheck`` command-line tool has been updated to make these checks. In addition,
|
||||
its reporting on other roles has been modified to be more lenient regarding roles which
|
||||
are no longer considered essential.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
The Config::validate method will log an error if the Config object does not meet these
|
||||
requirements. Note that an exception is not thrown since it was felt that the Config's
|
||||
``upgradeToLatestVersion`` method must always produce a valid config.
|
||||
|
||||
|
||||
Determining if a Color Space is Linear
|
||||
**************************************
|
||||
|
||||
There have been many requests from developers that would like a standard way to determine
|
||||
if a color space is linear, since this impacts what sort of processing is suitable. OCIO
|
||||
v2 introduced a new ``encoding`` attribute for color spaces which contains this
|
||||
information. However, this is optional and may not be set by all config authors. And it
|
||||
won't be present in OCIO v1 configs, which are still widely used.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
OCIO 2.2 adds a new ``isColorSpaceLinear`` method to the Config class which may be used
|
||||
for this purpose.
|
||||
|
||||
Note that since OCIO has both a scene-referred and a display-referred reference space, the
|
||||
method also takes a ReferenceSpaceType enum to indicate which reference space the
|
||||
linearity determination is with respect to. Typically developers will set this to
|
||||
``REFERENCE_SPACE_SCENE``.
|
||||
|
||||
The following algorithm is used to make the determination:
|
||||
|
||||
* If the color space ``isdata`` attribute is true, return false.
|
||||
* If the reference space type of the color space differs from the requested reference
|
||||
space type, return false.
|
||||
* If the color space's encoding attribute is present, return true if it matches the
|
||||
expected reference space type (i.e., "scene-linear" for ``REFERENCE_SPACE_SCENE`` or
|
||||
"display-linear" for ``REFERENCE_SPACE_DISPLAY``) and false otherwise.
|
||||
* If the color space has no ``to_reference`` or ``from_reference`` transform, return true.
|
||||
* Evaluate several points through the color space's transform and check if the output only
|
||||
differs by a scale factor (which may be different per channel, e.g. allowing an arbitrary
|
||||
matrix transform, with no offset).
|
||||
|
||||
Note that the last step is a heuristic that may or may not be accurate. However, note
|
||||
that the ``encoding`` attribute takes precedence and so config authors have the ultimate
|
||||
control over the linearity determination.
|
||||
|
||||
|
||||
Getting a Processor for a NamedTransform
|
||||
****************************************
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
A new config object was introduced in OCIO v2 called Named Transforms. These are used
|
||||
when there is a need to apply a mathematical function which is not a conversion between
|
||||
two specific color spaces. The most common example is applying a transfer function curve
|
||||
to convert linear data to non-linear, or vice-versa.
|
||||
|
||||
The new ACES configs include Named Transforms, so it is important for application
|
||||
developers to start supporting this type of config object. The preferred method for doing
|
||||
so is to add a new tool, similar to FileTransform that applies a Named Transform.
|
||||
|
||||
What is new in OCIO 2.2 is that the code for applying these is now simpler with the
|
||||
introduction of several new getProcessor methods on the Config class that will return a
|
||||
Processor directly from a NamedTransform object.
|
||||
|
||||
In addition, the NamedTransform class has a GetTransform method that returns a (regular)
|
||||
Transform object for a given direction. It will create the transform from the inverse
|
||||
direction if the transform for the requested direction is missing.
|
||||
|
||||
|
||||
Circular OCIO / OIIO Build Dependency Solution
|
||||
**********************************************
|
||||
|
||||
A long-standing complaint has been regarding the circular build dependency between OCIO
|
||||
and OpenImageIO. This is due to the fact that OIIO wants to use OCIO for color management
|
||||
and OCIO wants to use OIIO in its command-line tools ``ocioconvert``, ``ociolutimage``,
|
||||
and ``ociodisplay`` for reading and writing image files. These tools will not be built if
|
||||
OIIO is not available when configuring the build.
|
||||
|
||||
Furthermore, some package installers will not install these command-line tools due to the
|
||||
dependency on OIIO.
|
||||
|
||||
By default, OCIO will now build these tools with OpenEXR rather than relying on OIIO.
|
||||
|
||||
For Users
|
||||
+++++++++
|
||||
|
||||
If you have a version of OCIO that was not compiled with tools such as ``ocioconvert`` and
|
||||
you want to use OCIO to process images, you could try using OpenImageIO's ``oiiotool``.
|
||||
(Although note that ``ocioconvert`` has a few features that are not in ``oiiotool``, such
|
||||
as GPU processing support.) Similarly if you have ``ocioconvert``, but it is compiled
|
||||
with OpenEXR rather than OpenImageIO, you may use ``oiiotool`` to convert other image file
|
||||
formats to/from OpenEXR.
|
||||
|
||||
If you want to use ``oiiotool`` but it does not support a particular type of conversion,
|
||||
you may be able to use ``ociowrite`` to export a CTF file and then use that with the
|
||||
``--ociofiletransform`` option in ``oiiotool``.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
In OCIO 2.2, by default, the build will now use OpenEXR rather than OpenImageIO for the
|
||||
command-line tools that read or write images. This will limit the functionality of the
|
||||
aforementioned command-line tools to only working with OpenEXR files. If you want support
|
||||
for more file formats in these tools, you will still need to have OIIO available when
|
||||
building OCIO and set the CMake variable ``-D OCIO_USE_OIIO_FOR_APPS=ON``.
|
||||
|
||||
|
||||
Miscellaneous Improvements
|
||||
**************************
|
||||
|
||||
Here are some other improvements in OCIO 2.2:
|
||||
|
||||
* Support for more types of ICC Monitor Profiles -- All of the parametric curve types are
|
||||
now supported.
|
||||
|
||||
* New hash function for calculating cache IDs -- The md5 algorithm has been replaced with
|
||||
xxhash, which provides a considerable speed-up for various operations. The APIs that
|
||||
return cache ID strings will obviously return different strings now, but please note that
|
||||
these are not guaranteed to be unchanged across releases. (The 128-bit version of xxhash
|
||||
was used, which is the same length as for md5.)
|
||||
|
||||
* The command-line tools ``ocioconvert``, ``ociowrite``, and ``ocioperf`` now support
|
||||
using an inverse DisplayViewTransform.
|
||||
|
||||
* Add DisplayViewTransform and NamedTransform support to Baker.
|
||||
|
||||
* Several new Built-in Transforms are available for version 2.2 config files, including
|
||||
ARRI LogC4.
|
||||
|
||||
* Preliminary support for ACES Metadata File (AMF) -- A prototype Python tool has been
|
||||
added named ``pyocioamf`` that converts an AMF file into the OCIO native transform format
|
||||
CTF. It uses a prototype ACES Reference config file that is serving as a database of ACES
|
||||
Transform IDs for interpreting the AMF file.
|
||||
|
||||
* Support for PyPI installation from source rather than pre-built binaries.
|
||||
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
For more detail, please see the GitHub release pages:
|
||||
|
||||
`OCIO 2.2.0 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.2.0>`_
|
||||
|
||||
`OCIO 2.2.1 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.2.1>`_
|
||||
@@ -0,0 +1,215 @@
|
||||
..
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
OCIO 2.3 Release
|
||||
================
|
||||
|
||||
Timeline
|
||||
********
|
||||
|
||||
OpenColorIO 2.3 was delivered in August 2023 and is in the VFX Reference Platform for
|
||||
calendar year 2024.
|
||||
|
||||
|
||||
New Feature Guide
|
||||
=================
|
||||
|
||||
New config editor GUI app ``ocioview``
|
||||
**************************************
|
||||
|
||||
There is a new GUI app for inspecting and editing OCIO configs called ``ocioview``. As of
|
||||
the 2.3.0 release, ``ocioview`` is currently in an alpha release (please see the README in
|
||||
the apps/ocioview directory for details). Documentation and tutorials will be forthcoming
|
||||
and we are looking for contributors to help with this and other tasks.
|
||||
|
||||
|
||||
Built-in Configs
|
||||
****************
|
||||
|
||||
An updated set of built-in CG and Studio configs is included in the 2.3 release. These include
|
||||
the updates from the OCIO Configs Working Group over the past year. The updates include:
|
||||
|
||||
* Addition of Apple's Display P3 as both a texture space and a display
|
||||
* A ``texture`` category to allow filtering of color spaces typically used for textures
|
||||
* More appropriate color space assignments for the ``matte_paint`` and ``texture_paint`` roles
|
||||
|
||||
Additional updates for the Studio config include:
|
||||
|
||||
* Support for CanonLog2 CinemaGamut color space (in addition to the existing CanonLog3)
|
||||
* Addition of ACES Transform IDs to better support the ACES Metadata Format (AMF)
|
||||
|
||||
For Users
|
||||
+++++++++
|
||||
|
||||
The following URI strings may be provided anywhere you would normally provide a file path
|
||||
to a config (e.g. as the OCIO environment variable):
|
||||
|
||||
To use the updated :ref:`aces_cg`, use this string for the config path::
|
||||
ocio://cg-config-v2.1.0_aces-v1.3_ocio-v2.3
|
||||
|
||||
To use the updated :ref:`aces_studio`, use this string for the config path::
|
||||
ocio://studio-config-v2.1.0_aces-v1.3_ocio-v2.3
|
||||
|
||||
This string will give you the current default config, which is the latest ACES CG Config::
|
||||
ocio://default
|
||||
|
||||
Because there are now several built-in configs, there is now a short-cut to referring to
|
||||
the latest versions:
|
||||
|
||||
This string will always give you the latest CG config::
|
||||
ocio://cg-config-latest
|
||||
|
||||
This string will always give you the latest Studio config::
|
||||
ocio://studio-config-latest
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
As the built-in config collection evolves, special names such as ``ocio://default`` and
|
||||
``ocio://studio-config-latest`` will point to newer versions of those configs. Therefore, it is
|
||||
recommended that application developers not save those strings and instead save the string that
|
||||
refers to the current version of that config. That way, it's guaranteed that there will be no
|
||||
change of behavior in the future. For example, as of OCIO 2.3, ``ocio://default`` should be saved as
|
||||
``ocio://cg-config-v2.1.0_aces-v1.3_ocio-v2.3``.
|
||||
|
||||
The method for doing this is to use the new ResolveConfigPath function. For example:
|
||||
``ResolveConfigPath("ocio://default")``
|
||||
|
||||
And if you intend to present a list of built-in configs to users, be sure to filter
|
||||
the list of configs returned by the ``BuiltinConfigRegistry`` and only show the ones
|
||||
where ``isBuiltinConfigRecommended`` is True so that you are only presenting the most
|
||||
recent versions of each of the built-in configs.
|
||||
|
||||
|
||||
Improved Lut1D and Lut3D performance via AVX SIMD intrinsics
|
||||
************************************************************
|
||||
|
||||
In some cases, this gives more than a 2x speed-up in CPU Renderer performance.
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
The library now contains multiple Lut1D and Lut3D evaluation routines and the appropriate
|
||||
one is selected at runtime based on which SIMD instruction set is supported by the chip.
|
||||
Please let us know if you encounter any issues as you test on various flavors of x86 hardware.
|
||||
|
||||
|
||||
Improved support for macOS ARM chips
|
||||
************************************
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
SSE SIMD intrinsics are now converted to the equivalent Neon intrinsics when building for
|
||||
the ``arm64`` platform.
|
||||
|
||||
In addition, the build process for generating macOS Universal Binaries has been
|
||||
improved.
|
||||
|
||||
|
||||
OCIO command-line tools are now available via PyPI
|
||||
**************************************************
|
||||
|
||||
For Users
|
||||
+++++++++
|
||||
|
||||
Doing a ``pip install opencolorio`` now gives you the
|
||||
`command-line tools <https://opencolorio.readthedocs.io/en/latest/guides/using_ocio/using_ocio.html#tool-overview>`_
|
||||
such as ``ociocheck``, ``ociochecklut``, and ``ocioconvert``.
|
||||
|
||||
|
||||
Enhanced methods to find an equivalent color space between configs
|
||||
******************************************************************
|
||||
|
||||
In OCIO 2.2, several methods were introduced that used heuristics to identify a color space
|
||||
in a user's config that matches one of the known color spaces in the default built-in config.
|
||||
In OCIO 2.3, these methods were improved and extended as follows:
|
||||
|
||||
- ``IdentifyBuiltinColorSpace`` Searches a user config to find the name of an equivalent
|
||||
color space to a color space in one of the built-in configs. For example, "What is the
|
||||
name in this config for the ``sRGB - Texture`` color space from the default built-in config?"
|
||||
|
||||
- ``IdentifyInterchangeSpace`` Identifies the pair of color space names to be used as the
|
||||
interchange space to allow conversion between color spaces in a user config and one of the
|
||||
built-in configs. This is now the fundamental function that contains the heuristics for trying
|
||||
to identify known color spaces and is used by IdentifyBuiltinColorSpace and in the
|
||||
GetProcessorFrom/ToBuiltinColorSpace methods.
|
||||
|
||||
This improves upon and extends upon PR #1710. One piece of feedback on that PR is that it
|
||||
would be helpful to be able to use the heuristics to extract the names of the interchange
|
||||
color spaces rather than a Processor. This gives the application more flexibility in how
|
||||
that information is persisted and may reduce the number of times that any heuristics (that
|
||||
search through a config's color spaces) need to be run.
|
||||
|
||||
Finally, an issue was fixed in ``GetProcessorFromConfigs`` so that the returned Processor is
|
||||
a no-op if either of the color spaces in the two configs is a data space.
|
||||
|
||||
Note that if the official interchange role(s) are present (as is required in configs with
|
||||
``ocio_profile_version`` 2.2 or higher), the above methods simply use those rather than
|
||||
relying on any heuristics.
|
||||
|
||||
|
||||
Breaking API Change
|
||||
*******************
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
For developers that have customized their GPU Renderer by overriding the GpuShaderCreator
|
||||
class, there is a minor breaking change in the API. The addTexture and getTexture virtual
|
||||
methods now take a ``TextureDimensions`` parameter. This was necessary to give client apps full
|
||||
control over whether 1D or 2D textures are used for Lut1D ops. Please see
|
||||
`PR #1762 <https://github.com/AcademySoftwareFoundation/OpenColorIO/pull/1762>`_
|
||||
for an example of how to update your implementation of these modified virtual methods.
|
||||
|
||||
|
||||
API Enhancements
|
||||
****************
|
||||
|
||||
For Developers
|
||||
++++++++++++++
|
||||
|
||||
You may find the following additions to the OCIO API useful:
|
||||
|
||||
- There is now a ``clearProcessorCache`` method to clear the Processor, CPUProcessor, and
|
||||
GPUProcessor contents from the cache present in a Config instance. This is useful if a
|
||||
LUT file on disk has changed since the Config instance was created.
|
||||
|
||||
- The ``setAllowTexture1D`` method on the GpuShaderCreator/GpuShaderDesc class allows your
|
||||
GPU Renderer implementation to always use 2D textures rather than 1D textures for Lut1D ops.
|
||||
|
||||
- The Config class now has ``GetProcessorFromConfigs`` variants that allow converting from
|
||||
a source color space in one config to a display/view in another config.
|
||||
|
||||
- The Config class now has an ``isInactiveColorSpace`` method and ``getRoleColorSpace`` method.
|
||||
|
||||
- The CPUProcessor now has the ``isDynamic`` and ``hasDynamic`` methods that were present on
|
||||
the Processor class.
|
||||
|
||||
- The ``ResolveConfigPath`` function converts one of the built-in config short-cut strings
|
||||
into the unambiguous full URI for the current config.
|
||||
|
||||
- The new ``IdentifyBuiltinColorSpace`` and ``IdentifyInterchangeSpace`` methods are
|
||||
described above.
|
||||
|
||||
|
||||
New Built-in Transforms
|
||||
***********************
|
||||
|
||||
For Config Authors
|
||||
++++++++++++++++++
|
||||
|
||||
In config files with ``ocio_profile_version`` set to 2.3 or higher, config authors may take
|
||||
advantage of the following new transform:
|
||||
|
||||
* ``DISPLAY - CIE-XYZ-D65_to_DisplayP3`` To implement a display for the Apple Display P3 color space
|
||||
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
For more detail, please see the GitHub release pages:
|
||||
|
||||
`OCIO 2.3.0 <https://github.com/AcademySoftwareFoundation/OpenColorIO/releases/tag/v2.3.0>`_
|
||||
@@ -1,3 +1,10 @@
|
||||
# Fix an issue with the OCIO's Linux container images that have OpenSSL under 1.1.1.
|
||||
# If the container images are updated with OpenSSL 1.1.1+, the restriction on
|
||||
# urllib3 version <2 can be removed.
|
||||
urllib3<2
|
||||
# The builds for documentation fails with <0.18.0
|
||||
docutils>=0.18.1
|
||||
sphinx<=7.1.2
|
||||
six
|
||||
testresources
|
||||
recommonmark
|
||||
|
||||
@@ -3,7 +3,7 @@ news:
|
||||
enable : true
|
||||
image : images/SpiderVerse_pmm014.1014_lm_v1_opt.jpg
|
||||
title : OCIO v2 is here!
|
||||
content : "Check out our [guide](https://opencolorio.readthedocs.io/en/latest/upgrading_v2/_index.html#migrating-to-v2) for upgrading. Here are just a few highlights of new features:"
|
||||
content : "Check out our [guides](https://opencolorio.readthedocs.io/en/latest/releases/_index.html#releases) for upgrading. Here are just a few highlights of new features:"
|
||||
caption: "OpenColorIO in use on Spider-Man™: Into the Spider-Verse"
|
||||
feature_item :
|
||||
# feature item loop
|
||||
|
||||
@@ -3,6 +3,13 @@ supported_apps:
|
||||
enable : true
|
||||
title : Supported Applications
|
||||
portfolio_item :
|
||||
# portfolio item loop
|
||||
- name : Autodesk 3ds Max
|
||||
image : images/supported_apps/3ds_max.png
|
||||
categories : ["3D", "Animation", "Modeling", "Lighting", "Look Dev", "Texture"]
|
||||
content : 3ds Max 2024 and up.
|
||||
link : "https://www.autodesk.com/products/3ds-max/overview"
|
||||
|
||||
# portfolio item loop
|
||||
- name : Adobe After Effects
|
||||
image : images/supported_apps/ae.png
|
||||
@@ -109,9 +116,9 @@ supported_apps:
|
||||
link : "http://www.thefoundry.co.uk/products/mari"
|
||||
|
||||
# portfolio item loop
|
||||
- name : Maya
|
||||
- name : Autodesk Maya
|
||||
image : images/supported_apps/maya.png
|
||||
categories : ["3D", "Animation", "Modeling", "Lighting", "Texture"]
|
||||
categories : ["3D", "Animation", "Modeling", "Lighting", "Look Dev", "Simulation", "Texture"]
|
||||
content : Maya 2016 and up.
|
||||
link : "https://www.autodesk.com/products/maya/overview"
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 14 KiB |
@@ -30,7 +30,7 @@
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
upgrading_v2/_index
|
||||
releases/_index
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
@@ -150,11 +150,10 @@ this to a Flame compatible 3dl file, simply run::
|
||||
ociobakelut --format flame --lut log_to_display.lut for_flame.3dl
|
||||
|
||||
|
||||
Reversing a 1D LUT
|
||||
Reversing a LUT
|
||||
++++++++++++++++++
|
||||
|
||||
You can apply a LUT in reverse, and write this to a new LUT (this does
|
||||
not work for 3D LUT's, but will for 1D LUT's)::
|
||||
You can apply a LUT in reverse, and write this to a new LUT::
|
||||
|
||||
bash$ ociobakelut --format flame --invlut logtosrgb.3dl srgbtolog.3dl
|
||||
|
||||
|
||||
@@ -125,9 +125,11 @@ public:
|
||||
* Under normal usage, this is not necessary, but it can be helpful in particular instances,
|
||||
* such as designing OCIO profiles, and wanting to re-read luts without restarting.
|
||||
*
|
||||
* \note The method does not apply to instance specific caches such as the processor cache in a
|
||||
* config instance or the GPU and CPU processor caches in a processor instance. Here deleting the
|
||||
* instance flushes the cache.
|
||||
* \note
|
||||
* This method does not apply to instance-specific caches such as the Processor cache in
|
||||
* a Config instance or the GPU and CPU Processor caches in a Processor instance. So in cases
|
||||
* where you still have a Config instance after calling ClearAllCaches, you should also call
|
||||
* the Config's clearProcessorCache method.
|
||||
*/
|
||||
extern OCIOEXPORT void ClearAllCaches();
|
||||
|
||||
@@ -204,6 +206,28 @@ extern OCIOEXPORT ConstConfigRcPtr GetCurrentConfig();
|
||||
/// Set the current configuration. This will then store a copy of the specified config.
|
||||
extern OCIOEXPORT void SetCurrentConfig(const ConstConfigRcPtr & config);
|
||||
|
||||
/**
|
||||
* \brief Make a config path forward-compatible by replacing special built-in config names
|
||||
* with the current name.
|
||||
*
|
||||
* Application developers should call this function on any config path they intend to persist
|
||||
* (e.g., to include in a file saved from a DCC).
|
||||
*
|
||||
* As the built-in config collection evolves, special names such as "ocio://default" and
|
||||
* "ocio://studio-config-latest" will point to newer versions of those configs. Therefore, it is
|
||||
* recommended that application developers not save those strings and instead save the string that
|
||||
* refers to the current version of that config. That way, it's guaranteed that there will be no
|
||||
* change of behavior in the future. For example, as of OCIO 2.3, "ocio://default" should be saved
|
||||
* as "ocio://cg-config-v2.1.0_aces-v1.3_ocio-v2.3".
|
||||
*
|
||||
* Note that there is no validation done on the path. That is left to the application since
|
||||
* typically the application will load the config before attempting to save its path
|
||||
* and therefore catch, for example, a badly formed URI such as "ocio:default".
|
||||
*
|
||||
* \return Resolved path if possible. Otherwise, the original path is returned unmodified.
|
||||
*/
|
||||
extern OCIOEXPORT const char * ResolveConfigPath(const char * originalPath) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Extract an OCIO Config archive.
|
||||
*
|
||||
@@ -296,13 +320,11 @@ public:
|
||||
/**
|
||||
* \brief Create a configuration using a specific config file.
|
||||
*
|
||||
* Also supports the following OCIO URI format for Built-in configs:
|
||||
* "ocio://default" - Default Built-in config.
|
||||
* "ocio://<CONFIG NAME>" - A specific Built-in config. For the list of available
|
||||
* <CONFIG NAME> strings, see \ref Config::CreateFromBuiltinConfig.
|
||||
*
|
||||
* Also supports archived configs (.ocioz files).
|
||||
* Supports the OCIO URI format for Built-in configs.
|
||||
* See \ref Config::CreateFromBuiltinConfig.
|
||||
*
|
||||
* Supports archived configs (.ocioz files).
|
||||
*
|
||||
* \throw Exception If the file may not be read or does not parse.
|
||||
* \return The Config object.
|
||||
*/
|
||||
@@ -340,15 +362,23 @@ public:
|
||||
/**
|
||||
* \brief Create a configuration using an OCIO built-in config.
|
||||
*
|
||||
* \param configName Built-in config name.
|
||||
* \param configName Built-in config name (with or without the "ocio://" URI prefix).
|
||||
*
|
||||
* Also supports the following OCIO URI format for Built-in configs:
|
||||
* "ocio://default" - Default Built-in config.
|
||||
* "ocio://cg-config-latest" - Latest Built-in CG config.
|
||||
* "ocio://studio-config-latest" - Latest Built-in Studio config.
|
||||
* "ocio://<CONFIG NAME>" - A specific Built-in config.
|
||||
*
|
||||
* The available configNames are:
|
||||
*
|
||||
* ACES Studio config, contains a more complete collection of color spaces and displays:
|
||||
* "studio-config-v1.0.0_aces-v1.3_ocio-v2.1"
|
||||
* "studio-config-v2.1.0_aces-v1.3_ocio-v2.3"
|
||||
*
|
||||
* ACES CG config, basic color spaces for computer graphics apps:
|
||||
* "cg-config-v1.0.0_aces-v1.3_ocio-v2.1"
|
||||
* "cg-config-v2.1.0_aces-v1.3_ocio-v2.3"
|
||||
*
|
||||
* More information is available at:
|
||||
* %https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES
|
||||
@@ -459,14 +489,25 @@ public:
|
||||
const char * getEnvironmentVarDefault(const char * name) const;
|
||||
void clearEnvironmentVars();
|
||||
|
||||
/**
|
||||
* \brief The EnvironmentMode controls the behavior of loadEnvironment.
|
||||
* * ENV_ENVIRONMENT_LOAD_PREDEFINED - Only update vars already added to the Context.
|
||||
* * ENV_ENVIRONMENT_LOAD_ALL - Load all env. vars into the Context.
|
||||
*
|
||||
* \note Loading ALL the env. vars may reduce performance and reduce cache efficiency.
|
||||
*
|
||||
* Client programs generally will not use these methods because the EnvironmentMode is
|
||||
* set automatically when a Config is loaded. If the Config has an "environment"
|
||||
* section, the mode is set to LOAD_PREDEFINED, and otherwise set to LOAD_ALL.
|
||||
*/
|
||||
void setEnvironmentMode(EnvironmentMode mode) noexcept;
|
||||
EnvironmentMode getEnvironmentMode() const noexcept;
|
||||
/// Initialize the environment/context variables in the Config's Context.
|
||||
void loadEnvironment() noexcept;
|
||||
|
||||
const char * getSearchPath() const;
|
||||
/**
|
||||
* \brief Set all search paths as a concatenated string, ':' to separate the
|
||||
* paths.
|
||||
* \brief Set all search paths as a concatenated string, use ':' to separate the paths.
|
||||
*
|
||||
* See \ref addSearchPath for a more robust and platform-agnostic method of
|
||||
* setting the search paths.
|
||||
@@ -641,6 +682,9 @@ public:
|
||||
*/
|
||||
void setInactiveColorSpaces(const char * inactiveColorSpaces);
|
||||
const char * getInactiveColorSpaces() const;
|
||||
|
||||
/// Return true if the color space name is present in the inactive_colorspaces list.
|
||||
bool isInactiveColorSpace(const char * colorspace) const noexcept;
|
||||
|
||||
/**
|
||||
* \brief Return true if the specified color space is linear.
|
||||
@@ -679,12 +723,77 @@ public:
|
||||
*/
|
||||
bool isColorSpaceLinear(const char * colorSpace, ReferenceSpaceType referenceSpaceType) const;
|
||||
|
||||
//
|
||||
// Roles
|
||||
//
|
||||
|
||||
// A role is like an alias for a colorspace. You can query the colorspace
|
||||
// corresponding to a role using the normal getColorSpace fcn.
|
||||
/**
|
||||
* \brief Find the name of the color space in the source config that is the same as
|
||||
* a color space in the default built-in config. For example, setting the
|
||||
* builtinColorSpaceName to "sRGB - Texture" (a color space name from that
|
||||
* config), would return the name for the corresponding sRGB texture space in
|
||||
* the current config (or empty if it was not found). Note that this method
|
||||
* relies on heuristics which may evolve over time and which may not work on
|
||||
* all configs.
|
||||
*
|
||||
* The method only looks at active color spaces. If the interchange roles are
|
||||
* missing and heuristics are used, only scene-referred color spaces are searched.
|
||||
*
|
||||
* \param srcConfig The config to search for the desired color space.
|
||||
* \param builtinConfig The built-in config to use. See \ref Config::CreateFromBuiltinConfig.
|
||||
* \param builtinColorSpaceName Color space name in the built-in default config.
|
||||
* \return Matching color space name from the source config. Empty if not found.
|
||||
*
|
||||
* \throw Exception if an interchange space cannot be found or the equivalent space cannot be found.
|
||||
*/
|
||||
static const char * IdentifyBuiltinColorSpace(const ConstConfigRcPtr & srcConfig,
|
||||
const ConstConfigRcPtr & builtinConfig,
|
||||
const char * builtinColorSpaceName);
|
||||
|
||||
/**
|
||||
* \brief Identify the two names of a common color space that exists in both the
|
||||
* given config and the provided built-in config that may be used for converting
|
||||
* color spaces between the two configs. If both configs have the interchange
|
||||
* role set, than the color spaces set to that role will be returned. Otherwise,
|
||||
* heuristics will be used to try and identify a known color space in the source
|
||||
* config. These are the same heuristics that are used for other methods such as
|
||||
* identifyBuiltinColorSpace and GetProcessorTo/FromBuiltinColorSpace.
|
||||
*
|
||||
* Using this method in connection with GetProcessorFromConfigs is more efficient
|
||||
* if you need to call GetProcessorTo/FromBuiltinColorSpace multiple times since it
|
||||
* is only necessary to run the heuristics once (to identify the interchange spaces).
|
||||
*
|
||||
* The srcColorSpaceName and builtinColorSpace name are used to decide which
|
||||
* interchange role to use (scene- or display-referred). However, they are not
|
||||
* used if the interchange roles are not present and the heuristics are used.
|
||||
* It is actually only the ReferenceSpaceType of the color spaces that are used,
|
||||
* so it is not necessary to call this function multiple times if all the spaces
|
||||
* are of the same type. (These are the same arguments that would also be set if
|
||||
* you were instead calling GetProcessorTo/FromBuiltinColorSpace.)
|
||||
*
|
||||
* \param[out] srcInterchangeName Color space name from the source config.
|
||||
* \param[out] builtinInterchangeName Corresponding color space name from the built-in config.
|
||||
* \param srcConfig The config to search for the desired color space.
|
||||
* \param srcColorSpaceName Color space name in the given config to convert to/from.
|
||||
* \param builtinConfig The built-in config to use. See \ref Config::CreateFromBuiltinConfig.
|
||||
* \param builtinColorSpaceName Color space name in the default built-in config.
|
||||
*
|
||||
* \throw Exception if either the srcInterchange or builtinInterchange cannot be identified.
|
||||
*/
|
||||
static void IdentifyInterchangeSpace(const char ** srcInterchangeName,
|
||||
const char ** builtinInterchangeName,
|
||||
const ConstConfigRcPtr & srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
const ConstConfigRcPtr & builtinConfig,
|
||||
const char * builtinColorSpaceName);
|
||||
|
||||
/**
|
||||
* Methods related to Roles.
|
||||
*
|
||||
* A role allows a config author to indicate that a given color space should be used
|
||||
* for a particular purpose.
|
||||
*
|
||||
* Role names may be passed to most functions that accept color space names, such as
|
||||
* getColorSpace. So for example, you may find the name of the color space assigned
|
||||
* to the scene_linear role by getting the color space object for "scene_linear" and
|
||||
* then calling getName on the color space object.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief
|
||||
@@ -709,13 +818,16 @@ public:
|
||||
* Return empty string if index is out of range.
|
||||
*/
|
||||
const char * getRoleColorSpace(int index) const;
|
||||
|
||||
/**
|
||||
* \defgroup Methods related to displays and views.
|
||||
* @{
|
||||
* \brief Get the color space name used for the specified role.
|
||||
*
|
||||
* Return an empty string if the role is not present
|
||||
*/
|
||||
const char * getRoleColorSpace(const char * roleName) const noexcept;
|
||||
|
||||
/**
|
||||
* Methods related to displays and views.
|
||||
*
|
||||
* The following methods only manipulate active displays and views. Active
|
||||
* displays and views are defined from an env. variable or from the config file.
|
||||
*
|
||||
@@ -832,11 +944,8 @@ public:
|
||||
/// Clear all the displays.
|
||||
void clearDisplays();
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* \defgroup Methods related to the Virtual Display.
|
||||
* @{
|
||||
* Methods related to the Virtual Display.
|
||||
*
|
||||
* ... (See descriptions for the non-virtual methods above.)
|
||||
*
|
||||
@@ -916,8 +1025,6 @@ public:
|
||||
*/
|
||||
int instantiateDisplayFromICCProfile(const char * ICCProfileFilepath);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* \brief
|
||||
*
|
||||
@@ -1065,8 +1172,7 @@ public:
|
||||
void clearViewTransforms();
|
||||
|
||||
/**
|
||||
* \defgroup Methods related to named transforms.
|
||||
* @{
|
||||
* Methods related to named transforms.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1109,8 +1215,6 @@ public:
|
||||
/// Clear all named transforms.
|
||||
void clearNamedTransforms();
|
||||
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// File Rules
|
||||
//
|
||||
@@ -1239,7 +1343,7 @@ public:
|
||||
*
|
||||
* If the source config defines the necessary Interchange Role (typically "aces_interchange"),
|
||||
* then the conversion will be well-defined and equivalent to calling GetProcessorFromConfigs
|
||||
* with the source config and the Built-in config
|
||||
* with the source config and the Built-in config.
|
||||
*
|
||||
* However, if the Interchange Roles are not present, heuristics will be used to try and
|
||||
* identify a common color space in the source config that may be used to allow the conversion
|
||||
@@ -1252,11 +1356,12 @@ public:
|
||||
* \param srcConfig The user's source config.
|
||||
* \param srcColorSpaceName The name of the color space in the source config.
|
||||
* \param builtinColorSpaceName The name of the color space in the current default Built-in config.
|
||||
*
|
||||
* \throw Exception if either the src or builtin interchange space cannot be identified.
|
||||
*/
|
||||
static ConstProcessorRcPtr GetProcessorToBuiltinColorSpace(
|
||||
ConstConfigRcPtr srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
const char * builtinColorSpaceName);
|
||||
static ConstProcessorRcPtr GetProcessorToBuiltinColorSpace(ConstConfigRcPtr srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
const char * builtinColorSpaceName);
|
||||
/**
|
||||
* \brief See description of GetProcessorToBuiltinColorSpace.
|
||||
*
|
||||
@@ -1264,14 +1369,12 @@ public:
|
||||
* \param srcConfig The user's source config.
|
||||
* \param srcColorSpaceName The name of the color space in the source config.
|
||||
*/
|
||||
static ConstProcessorRcPtr GetProcessorFromBuiltinColorSpace(
|
||||
const char * builtinColorSpaceName,
|
||||
ConstConfigRcPtr srcConfig,
|
||||
const char * srcColorSpaceName);
|
||||
static ConstProcessorRcPtr GetProcessorFromBuiltinColorSpace(const char * builtinColorSpaceName,
|
||||
ConstConfigRcPtr srcConfig,
|
||||
const char * srcColorSpaceName);
|
||||
|
||||
/**
|
||||
* \brief Get a processor to convert between color spaces in two separate
|
||||
* configs.
|
||||
* \brief Get a processor to convert between color spaces in two separate configs.
|
||||
*
|
||||
* This relies on both configs having the aces_interchange role (when srcName
|
||||
* is scene-referred) or the role cie_xyz_d65_interchange (when srcName is
|
||||
@@ -1291,6 +1394,9 @@ public:
|
||||
/**
|
||||
* The srcInterchangeName and dstInterchangeName must refer to a pair of
|
||||
* color spaces in the two configs that are the same. A role name may also be used.
|
||||
*
|
||||
* Note: For all of the two-config GetProcessor functions, if either the source or
|
||||
* destination color spaces are data spaces, the entire processor will be a no-op.
|
||||
*/
|
||||
static ConstProcessorRcPtr GetProcessorFromConfigs(const ConstConfigRcPtr & srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
@@ -1308,6 +1414,67 @@ public:
|
||||
const char * dstColorSpaceName,
|
||||
const char * dstInterchangeName);
|
||||
|
||||
/**
|
||||
* \brief Get a processor to convert from a color space to a display and view in
|
||||
* two separate configs.
|
||||
*/
|
||||
static ConstProcessorRcPtr GetProcessorFromConfigs(const ConstConfigRcPtr & srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
const ConstConfigRcPtr & dstConfig,
|
||||
const char * dstDisplay,
|
||||
const char * dstView,
|
||||
TransformDirection direction);
|
||||
|
||||
static ConstProcessorRcPtr GetProcessorFromConfigs(const ConstContextRcPtr & srcContext,
|
||||
const ConstConfigRcPtr & srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
const ConstContextRcPtr & dstContext,
|
||||
const ConstConfigRcPtr & dstConfig,
|
||||
const char * dstDisplay,
|
||||
const char * dstView,
|
||||
TransformDirection direction);
|
||||
|
||||
/**
|
||||
* The srcInterchangeName and dstInterchangeName must refer to a pair of
|
||||
* color spaces in the two configs that are the same. A role name may also be used.
|
||||
*/
|
||||
static ConstProcessorRcPtr GetProcessorFromConfigs(const ConstConfigRcPtr & srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
const char * srcInterchangeName,
|
||||
const ConstConfigRcPtr & dstConfig,
|
||||
const char * dstDisplay,
|
||||
const char * dstView,
|
||||
const char * dstInterchangeName,
|
||||
TransformDirection direction);
|
||||
|
||||
static ConstProcessorRcPtr GetProcessorFromConfigs(const ConstContextRcPtr & srcContext,
|
||||
const ConstConfigRcPtr & srcConfig,
|
||||
const char * srcColorSpaceName,
|
||||
const char * srcInterchangeName,
|
||||
const ConstContextRcPtr & dstContext,
|
||||
const ConstConfigRcPtr & dstConfig,
|
||||
const char * dstDisplay,
|
||||
const char * dstView,
|
||||
const char * dstInterchangeName,
|
||||
TransformDirection direction);
|
||||
|
||||
/// Get the Processor Cache flags.
|
||||
ProcessorCacheFlags getProcessorCacheFlags() const noexcept;
|
||||
|
||||
/// Control the caching of processors in the config instance. By default, caching is on.
|
||||
/// The flags allow turning caching off entirely or only turning it off if dynamic
|
||||
/// properties are being used by the processor.
|
||||
void setProcessorCacheFlags(ProcessorCacheFlags flags) const noexcept;
|
||||
|
||||
/**
|
||||
* \brief Clears this config's cache of Processor, CPUProcessor, and GPUProcessor instances.
|
||||
*
|
||||
* This must be done if any of the LUT files used by these Processors have been modified.
|
||||
* Note that setProcessorCacheFlags(PROCESSOR_CACHE_OFF) turns off caching but does not clear
|
||||
* any existing cache.
|
||||
*/
|
||||
void clearProcessorCache() noexcept;
|
||||
|
||||
/// Set the ConfigIOProxy object used to provision the config and LUTs from somewhere other
|
||||
/// than the file system. (This is set on the config's embedded Context object.)
|
||||
void setConfigIOProxy(ConfigIOProxyRcPtr ciop);
|
||||
@@ -1370,11 +1537,6 @@ public:
|
||||
/// Do not use (needed only for pybind11).
|
||||
~Config();
|
||||
|
||||
/// Control the caching of processors in the config instance. By default, caching is on.
|
||||
/// The flags allow turning caching off entirely or only turning it off if dynamic
|
||||
/// properties are being used by the processor.
|
||||
void setProcessorCacheFlags(ProcessorCacheFlags flags) noexcept;
|
||||
|
||||
private:
|
||||
Config();
|
||||
|
||||
@@ -2020,8 +2182,7 @@ private:
|
||||
const Impl * getImpl() const { return m_impl; }
|
||||
};
|
||||
|
||||
/** \defgroup ColorSpaceSetOperators
|
||||
* @{
|
||||
/** ColorSpaceSetOperators
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -2061,8 +2222,6 @@ extern OCIOEXPORT ConstColorSpaceSetRcPtr operator&&(const ConstColorSpaceSetRcP
|
||||
extern OCIOEXPORT ConstColorSpaceSetRcPtr operator-(const ConstColorSpaceSetRcPtr & lcss,
|
||||
const ConstColorSpaceSetRcPtr & rcss);
|
||||
|
||||
/** @}*/
|
||||
|
||||
|
||||
//
|
||||
// Look
|
||||
@@ -2297,6 +2456,10 @@ public:
|
||||
*/
|
||||
bool hasChannelCrosstalk() const;
|
||||
|
||||
/**
|
||||
* Returns a hash string generated by hashing the cachedIDs of the (unoptimized) list of ops
|
||||
* contained in the Processor. (This forms part of the key used by the config's processor cache.)
|
||||
*/
|
||||
const char * getCacheID() const;
|
||||
|
||||
/**
|
||||
@@ -2480,6 +2643,10 @@ public:
|
||||
* there is one in the CPU processor.
|
||||
*/
|
||||
DynamicPropertyRcPtr getDynamicProperty(DynamicPropertyType type) const;
|
||||
/// True if at least one dynamic property of that type exists.
|
||||
bool hasDynamicProperty(DynamicPropertyType type) const noexcept;
|
||||
/// True if at least one dynamic property of any type exists and is dynamic.
|
||||
bool isDynamic() const noexcept;
|
||||
|
||||
/**
|
||||
* \brief Apply to an image with any kind of channel ordering while
|
||||
@@ -3043,6 +3210,10 @@ public:
|
||||
virtual void setTextureMaxWidth(unsigned maxWidth) = 0;
|
||||
virtual unsigned getTextureMaxWidth() const noexcept = 0;
|
||||
|
||||
/// Allow 1D GPU resource type, otherwise always using 2D resources for 1D LUTs.
|
||||
virtual void setAllowTexture1D(bool allowed) = 0;
|
||||
virtual bool getAllowTexture1D() const = 0;
|
||||
|
||||
/**
|
||||
* To avoid global texture sampler and uniform name clashes always append an increasing index
|
||||
* to the resource name.
|
||||
@@ -3100,9 +3271,17 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a 2D texture (1D texture if height equals 1).
|
||||
*
|
||||
* \note
|
||||
* Dimension enum used to differentiate between 1D and 2D object/resource types.
|
||||
*/
|
||||
enum TextureDimensions : uint8_t {
|
||||
TEXTURE_1D = 1,
|
||||
TEXTURE_2D = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a 1D or 2D texture
|
||||
*
|
||||
* \note
|
||||
* The 'values' parameter contains the LUT data which must be used as-is as the dimensions and
|
||||
* origin are hard-coded in the fragment shader program. So, it means one GPU texture per entry.
|
||||
**/
|
||||
@@ -3110,6 +3289,7 @@ public:
|
||||
const char * samplerName,
|
||||
unsigned width, unsigned height,
|
||||
TextureType channel,
|
||||
TextureDimensions dimensions,
|
||||
Interpolation interpolation,
|
||||
const float * values) = 0;
|
||||
|
||||
@@ -3361,6 +3541,7 @@ public:
|
||||
unsigned & width,
|
||||
unsigned & height,
|
||||
TextureType & channel,
|
||||
TextureDimensions & dimensions,
|
||||
Interpolation & interpolation) const = 0;
|
||||
virtual void getTextureValues(unsigned index, const float *& values) const = 0;
|
||||
|
||||
@@ -3442,8 +3623,9 @@ public:
|
||||
void setWorkingDir(const char * dirname);
|
||||
const char * getWorkingDir() const;
|
||||
|
||||
/// Add (or update) a context variable. But it removes it if the value argument
|
||||
/// is null.
|
||||
/// Add (or update) a context variable. But it removes it if the value argument is null.
|
||||
/// Note that a Context StringVar is the same thing as a Config EnvironmentVar and these
|
||||
/// are both often referred to as a "context var".
|
||||
void setStringVar(const char * name, const char * value) noexcept;
|
||||
/// Get the context variable value. It returns an empty string if the context
|
||||
/// variable is null or does not exist.
|
||||
@@ -3459,13 +3641,11 @@ public:
|
||||
/// Add to the instance all the context variables from ctx.
|
||||
void addStringVars(const ConstContextRcPtr & ctx) noexcept;
|
||||
|
||||
|
||||
/// See \ref Config::setEnvironmentMode.
|
||||
void setEnvironmentMode(EnvironmentMode mode) noexcept;
|
||||
|
||||
|
||||
EnvironmentMode getEnvironmentMode() const noexcept;
|
||||
|
||||
/// Seed all string vars with the current environment.
|
||||
/// Seed string vars with the current environment, based on the EnvironmentMode setting.
|
||||
void loadEnvironment() noexcept;
|
||||
|
||||
/// Resolve all the context variables from the string. It could be color space
|
||||
@@ -3594,22 +3774,8 @@ public:
|
||||
*/
|
||||
virtual bool isBuiltinConfigRecommended(size_t configIndex) const = 0;
|
||||
|
||||
/**
|
||||
* @brief Get the default recommended built-in config.
|
||||
*
|
||||
* Get the name of the built-in config that is currently recommended as the default config
|
||||
* to use for applications looking for basic color management.
|
||||
*
|
||||
* As the built-in config collection evolves, the default config name will change in future
|
||||
* releases.
|
||||
*
|
||||
* For backwards compatibility, the name provided here will always work as an argument
|
||||
* to other methods so that any previous default config may be recovered.
|
||||
*
|
||||
* Throws if the name is not found.
|
||||
*
|
||||
* @return Default's built-in config name.
|
||||
*/
|
||||
// Return the full forward-compatible name of the default built-in config.
|
||||
OCIO_DEPRECATED("This was marked as deprecated starting in v2.3, please use ResolveConfigPath(\"ocio://default\").")
|
||||
virtual const char * getDefaultBuiltinConfigName() const = 0;
|
||||
protected:
|
||||
BuiltinConfigRegistry() = default;
|
||||
@@ -3639,8 +3805,7 @@ public:
|
||||
virtual bool isSupported() const noexcept = 0;
|
||||
|
||||
/**
|
||||
* \defgroup Methods to access some information of the attached and active monitors.
|
||||
* @{
|
||||
* Methods to access some information of the attached and active monitors.
|
||||
*/
|
||||
|
||||
/// Get the number of active monitors reported by the operating system.
|
||||
@@ -3657,8 +3822,6 @@ public:
|
||||
/// Get the ICC profile path associated to the monitor.
|
||||
virtual const char * getProfileFilepath(size_t idx) const = 0;
|
||||
|
||||
/** @} */
|
||||
|
||||
protected:
|
||||
SystemMonitors() = default;
|
||||
virtual ~SystemMonitors() = default;
|
||||
|
||||
@@ -453,6 +453,8 @@ struct OCIOEXPORT GradingRGBM
|
||||
double m_master{ 0. };
|
||||
};
|
||||
|
||||
extern OCIOEXPORT bool operator==(const GradingRGBM & lhs, const GradingRGBM & rhs);
|
||||
extern OCIOEXPORT bool operator!=(const GradingRGBM & lhs, const GradingRGBM & rhs);
|
||||
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBM &);
|
||||
|
||||
/// Grading primary values.
|
||||
@@ -488,6 +490,8 @@ struct OCIOEXPORT GradingPrimary
|
||||
static double NoClampWhite();
|
||||
};
|
||||
|
||||
extern OCIOEXPORT bool operator==(const GradingPrimary & lhs, const GradingPrimary & rhs);
|
||||
extern OCIOEXPORT bool operator!=(const GradingPrimary & lhs, const GradingPrimary & rhs);
|
||||
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingPrimary &);
|
||||
|
||||
/// 2D control point used by \ref GradingBSplineCurve.
|
||||
@@ -499,6 +503,8 @@ struct OCIOEXPORT GradingControlPoint
|
||||
float m_y{ 0.f };
|
||||
};
|
||||
|
||||
extern OCIOEXPORT bool operator==(const GradingControlPoint & lhs, const GradingControlPoint & rhs);
|
||||
extern OCIOEXPORT bool operator!=(const GradingControlPoint & lhs, const GradingControlPoint & rhs);
|
||||
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingControlPoint &);
|
||||
|
||||
/// A BSpline curve defined with \ref GradingControlPoint.
|
||||
@@ -530,6 +536,8 @@ protected:
|
||||
GradingBSplineCurve() = default;
|
||||
};
|
||||
|
||||
extern OCIOEXPORT bool operator==(const GradingBSplineCurve & lhs, const GradingBSplineCurve & rhs);
|
||||
extern OCIOEXPORT bool operator!=(const GradingBSplineCurve & lhs, const GradingBSplineCurve & rhs);
|
||||
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingBSplineCurve &);
|
||||
|
||||
/**
|
||||
@@ -559,6 +567,8 @@ protected:
|
||||
GradingRGBCurve() = default;
|
||||
};
|
||||
|
||||
extern OCIOEXPORT bool operator==(const GradingRGBCurve & lhs, const GradingRGBCurve & rhs);
|
||||
extern OCIOEXPORT bool operator!=(const GradingRGBCurve & lhs, const GradingRGBCurve & rhs);
|
||||
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBCurve &);
|
||||
|
||||
/**
|
||||
@@ -602,6 +612,8 @@ struct OCIOEXPORT GradingRGBMSW
|
||||
double m_width { 1. }; // Or pivot for shadows and highlights.
|
||||
};
|
||||
|
||||
extern OCIOEXPORT bool operator==(const GradingRGBMSW & lhs, const GradingRGBMSW & rhs);
|
||||
extern OCIOEXPORT bool operator!=(const GradingRGBMSW & lhs, const GradingRGBMSW & rhs);
|
||||
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBMSW &);
|
||||
|
||||
/// Grading tone values.
|
||||
@@ -641,6 +653,8 @@ struct OCIOEXPORT GradingTone
|
||||
double m_scontrast{ 1.0 };
|
||||
};
|
||||
|
||||
extern OCIOEXPORT bool operator==(const GradingTone & lhs, const GradingTone & rhs);
|
||||
extern OCIOEXPORT bool operator!=(const GradingTone & lhs, const GradingTone & rhs);
|
||||
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingTone &);
|
||||
|
||||
/**
|
||||
@@ -673,7 +687,7 @@ extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingTone &)
|
||||
* OCIO::DynamicPropertyValue::AsGradingPrimary(dynProp);
|
||||
* OCIO::GradingPrimary primary = primaryProp->getValue();
|
||||
* primary.m_saturation += 0.1f;
|
||||
* rgbCurveProp->setValue(primary);
|
||||
* primaryProp->setValue(primary);
|
||||
* }
|
||||
* if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_RGBCURVE))
|
||||
* {
|
||||
|
||||
@@ -456,11 +456,12 @@ enum GpuLanguage
|
||||
GPU_LANGUAGE_MSL_2_0 ///< Metal Shading Language
|
||||
};
|
||||
|
||||
/// Controls which environment variables are loaded into a Context object.
|
||||
enum EnvironmentMode
|
||||
{
|
||||
ENV_ENVIRONMENT_UNKNOWN = 0,
|
||||
ENV_ENVIRONMENT_LOAD_PREDEFINED,
|
||||
ENV_ENVIRONMENT_LOAD_ALL
|
||||
ENV_ENVIRONMENT_LOAD_PREDEFINED, ///< Only load vars in the config's environment section
|
||||
ENV_ENVIRONMENT_LOAD_ALL ///< Load all env. vars (note: may reduce performance)
|
||||
};
|
||||
|
||||
/// A RangeTransform may be set to clamp the values, or not.
|
||||
@@ -725,8 +726,7 @@ extern OCIOEXPORT ExposureContrastStyle ExposureContrastStyleFromString(const ch
|
||||
extern OCIOEXPORT const char * NegativeStyleToString(NegativeStyle style);
|
||||
extern OCIOEXPORT NegativeStyle NegativeStyleFromString(const char * style);
|
||||
|
||||
/** \defgroup Env. variables.
|
||||
* @{
|
||||
/** Env. variables.
|
||||
*
|
||||
* These environmental variables are used by the OpenColorIO library.
|
||||
* For variables that allow specifying more than one token, they should be separated by commas.
|
||||
@@ -760,7 +760,7 @@ extern OCIOEXPORT const char * OCIO_INACTIVE_COLORSPACES_ENVVAR;
|
||||
* The envvar 'OCIO_OPTIMIZATION_FLAGS' provides a way to force a given optimization level.
|
||||
* Remove the variable or set the value to empty to not use it. Set the value of the variable
|
||||
* to the desired optimization level as either an integer or hexadecimal value.
|
||||
* Ex: OCIO_OPTIMIZATION_FLAGS="20479" or "0x4FFF" for OPTIMIZATION_LOSSLESS.
|
||||
* Ex: OCIO_OPTIMIZATION_FLAGS="144457667" or "0x89c3fc3" for OPTIMIZATION_LOSSLESS.
|
||||
*/
|
||||
extern OCIOEXPORT const char * OCIO_OPTIMIZATION_FLAGS_ENVVAR;
|
||||
|
||||
@@ -775,12 +775,6 @@ extern OCIOEXPORT const char * OCIO_OPTIMIZATION_FLAGS_ENVVAR;
|
||||
*/
|
||||
extern OCIOEXPORT const char * OCIO_USER_CATEGORIES_ENVVAR;
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** \defgroup VarsRoles
|
||||
* @{
|
||||
*/
|
||||
|
||||
// TODO: Move to .rst
|
||||
/*!rst::
|
||||
Roles
|
||||
@@ -851,12 +845,6 @@ extern OCIOEXPORT const char * ROLE_INTERCHANGE_SCENE;
|
||||
*/
|
||||
extern OCIOEXPORT const char * ROLE_INTERCHANGE_DISPLAY;
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** \defgroup VarsSharedView
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*!rst::
|
||||
Shared View
|
||||
***********
|
||||
@@ -869,12 +857,6 @@ Shared View
|
||||
*/
|
||||
extern OCIOEXPORT const char * OCIO_VIEW_USE_DISPLAY_NAME;
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** \defgroup VarsFormatMetadata
|
||||
* @{
|
||||
*/
|
||||
|
||||
// TODO: Move to .rst
|
||||
/*!rst::
|
||||
FormatMetadata
|
||||
@@ -928,12 +910,6 @@ extern OCIOEXPORT const char * METADATA_NAME;
|
||||
*/
|
||||
extern OCIOEXPORT const char * METADATA_ID;
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** \defgroup VarsCaches
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*!rst::
|
||||
Caches
|
||||
******
|
||||
@@ -962,8 +938,6 @@ extern OCIOEXPORT const char * OCIO_DISABLE_PROCESSOR_CACHES;
|
||||
// variable to disable the fallback.
|
||||
extern OCIOEXPORT const char * OCIO_DISABLE_CACHE_FALLBACK;
|
||||
|
||||
/** @}*/
|
||||
|
||||
|
||||
// Archive config feature
|
||||
// Default filename (with extension) of an config.
|
||||
@@ -971,6 +945,10 @@ extern OCIOEXPORT const char * OCIO_CONFIG_DEFAULT_NAME;
|
||||
extern OCIOEXPORT const char * OCIO_CONFIG_DEFAULT_FILE_EXT;
|
||||
extern OCIOEXPORT const char * OCIO_CONFIG_ARCHIVE_FILE_EXT;
|
||||
|
||||
// Built-in config feature
|
||||
// URI Prefix
|
||||
extern OCIOEXPORT const char * OCIO_BUILTIN_URI_PREFIX;
|
||||
|
||||
} // namespace OCIO_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
||||
+11
-8
@@ -2,9 +2,12 @@
|
||||
requires = [
|
||||
"setuptools>=42",
|
||||
"wheel",
|
||||
"cmake>=3.12",
|
||||
"cmake>=3.13",
|
||||
"ninja; sys_platform != 'win32' and platform_machine != 'arm64'",
|
||||
# Documentation requirements
|
||||
# Documentation requirements (see docs/requirements.txt for details)
|
||||
"urllib3<2",
|
||||
"docutils>=0.18.1",
|
||||
"sphinx<=7.1.2",
|
||||
"six",
|
||||
"testresources",
|
||||
"recommonmark",
|
||||
@@ -17,12 +20,11 @@ build-backend = "setuptools.build_meta"
|
||||
[tool.cibuildwheel]
|
||||
build-verbosity = "1"
|
||||
|
||||
test-command = "python -m PyOpenColorIOTests.OpenColorIOTestSuite"
|
||||
test-requires = ["numpy"]
|
||||
|
||||
manylinux-x86_64-image = "manylinux2014"
|
||||
manylinux-i686-image = "manylinux2014"
|
||||
manylinux-aarch64-image = "manylinux2014"
|
||||
test-command = [
|
||||
"python {project}/tests/python/OpenColorIOTestSuite.py",
|
||||
"ociocheck"
|
||||
]
|
||||
|
||||
[tool.cibuildwheel.linux]
|
||||
before-build = "share/ci/scripts/linux/yum/install_docs_env.sh"
|
||||
@@ -31,4 +33,5 @@ before-build = "share/ci/scripts/linux/yum/install_docs_env.sh"
|
||||
before-build = "share/ci/scripts/macos/install_docs_env.sh"
|
||||
|
||||
[tool.cibuildwheel.windows]
|
||||
before-build = "bash -c share/ci/scripts/windows/install_docs_env.sh"
|
||||
environment = { PATH="$GITHUB_WORKSPACE/doxygen;$PATH" }
|
||||
before-build = 'bash -c "share/ci/scripts/windows/install_docs_env.sh $GITHUB_WORKSPACE/doxygen"'
|
||||
|
||||
@@ -6,14 +6,13 @@ classifiers =
|
||||
Intended Audience :: Developers
|
||||
Topic :: Software Development :: Libraries :: Python Modules
|
||||
Programming Language :: C++
|
||||
Programming Language :: Python :: 2
|
||||
Programming Language :: Python :: 2.7
|
||||
Programming Language :: Python :: 3
|
||||
Programming Language :: Python :: 3.7
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Programming Language :: Python :: 3.10
|
||||
Programming Language :: Python :: 3.11
|
||||
Programming Language :: Python :: 3.12
|
||||
Programming Language :: Python :: Implementation :: CPython
|
||||
Programming Language :: C++
|
||||
description = OpenColorIO (OCIO) is a complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation.
|
||||
@@ -22,7 +21,7 @@ license_files = LICENSE
|
||||
long_description = file: README.md, LICENSE
|
||||
long_description_content_type = text/markdown
|
||||
name = opencolorio
|
||||
python_requires = '>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*'
|
||||
python_requires = '>=3.7'
|
||||
url = https://opencolorio.org/
|
||||
|
||||
[options]
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
@@ -16,27 +15,49 @@ from setuptools.command.build_ext import build_ext
|
||||
|
||||
|
||||
# Extract the project version from CMake generated ABI header.
|
||||
# NOTE: When droping support for Python2 we can use
|
||||
# tempfile.TemporaryDirectory() context manager instead of try...finally.
|
||||
def get_version():
|
||||
VERSION_REGEX = re.compile(
|
||||
r"^\s*#\s*define\s+OCIO_VERSION_FULL_STR\s+\"(.*)\"\s*$", re.MULTILINE)
|
||||
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
dirpath = tempfile.mkdtemp()
|
||||
|
||||
try:
|
||||
stdout = subprocess.check_output(["cmake", here], cwd=dirpath)
|
||||
path = os.path.join(dirpath, "include", "OpenColorIO", "OpenColorABI.h")
|
||||
with open(path) as f:
|
||||
match = VERSION_REGEX.search(f.read())
|
||||
return match.group(1)
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
"Unable to find OpenColorIO version: {}".format(str(e))
|
||||
)
|
||||
finally:
|
||||
shutil.rmtree(dirpath)
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
try:
|
||||
subprocess.check_call(["cmake", here], cwd=tmpdir)
|
||||
path = os.path.join(tmpdir, "include", "OpenColorIO", "OpenColorABI.h")
|
||||
with open(path) as f:
|
||||
match = VERSION_REGEX.search(f.read())
|
||||
return match.group(1)
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
"Unable to find OpenColorIO version: {}".format(str(e))
|
||||
)
|
||||
|
||||
|
||||
# Call CMake find_package from a dummy script and return whether the package
|
||||
# has been found or not.
|
||||
def cmake_find_package(package_name):
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
try:
|
||||
cmakelist_path = os.path.join(tmpdir, "CMakeLists.txt")
|
||||
with open(cmakelist_path, "w") as f:
|
||||
f.write("""
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(test LANGUAGES CXX)
|
||||
|
||||
find_package({} REQUIRED)
|
||||
""".format(package_name)
|
||||
)
|
||||
|
||||
subprocess.check_call(
|
||||
["cmake", tmpdir],
|
||||
cwd=tmpdir,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL
|
||||
)
|
||||
return True
|
||||
except Exception as e:
|
||||
return False
|
||||
|
||||
|
||||
# Convert distutils Windows platform specifiers to CMake -A arguments
|
||||
@@ -59,6 +80,7 @@ class CMakeExtension(Extension):
|
||||
class CMakeBuild(build_ext):
|
||||
def build_extension(self, ext):
|
||||
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
|
||||
bindir = os.path.join(extdir, "bin")
|
||||
|
||||
# required for auto-detection & inclusion of auxiliary "native" libs
|
||||
if not extdir.endswith(os.path.sep):
|
||||
@@ -73,12 +95,13 @@ class CMakeBuild(build_ext):
|
||||
|
||||
cmake_args = [
|
||||
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}".format(extdir),
|
||||
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY={}".format(bindir),
|
||||
"-DPython_EXECUTABLE={}".format(sys.executable),
|
||||
# Not used on MSVC, but no harm
|
||||
"-DCMAKE_BUILD_TYPE={}".format(cfg),
|
||||
"-DBUILD_SHARED_LIBS=OFF",
|
||||
"-DOCIO_BUILD_DOCS=ON",
|
||||
"-DOCIO_BUILD_APPS=OFF",
|
||||
"-DBUILD_SHARED_LIBS=ON",
|
||||
"-DOCIO_USE_SOVERSION=OFF",
|
||||
"-DOCIO_BUILD_APPS=ON",
|
||||
"-DOCIO_BUILD_TESTS=OFF",
|
||||
"-DOCIO_BUILD_GPU_TESTS=OFF",
|
||||
# Make sure we build everything for the requested architecture(s)
|
||||
@@ -121,7 +144,8 @@ class CMakeBuild(build_ext):
|
||||
# Multi-config generators have a different way to specify configs
|
||||
if not single_config:
|
||||
cmake_args += [
|
||||
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}".format(cfg.upper(), extdir)
|
||||
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}".format(cfg.upper(), extdir),
|
||||
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_{}={}".format(cfg.upper(), bindir),
|
||||
]
|
||||
build_args += ["--config", cfg]
|
||||
|
||||
@@ -131,6 +155,19 @@ class CMakeBuild(build_ext):
|
||||
if archs:
|
||||
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]
|
||||
|
||||
# When building the wheel, the install step is not executed so we need
|
||||
# to have the correct RPATH directly from the build tree output.
|
||||
cmake_args += ["-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"]
|
||||
if sys.platform.startswith("linux"):
|
||||
cmake_args += ["-DCMAKE_INSTALL_RPATH={}".format("$ORIGIN;$ORIGIN/..")]
|
||||
if sys.platform.startswith("darwin"):
|
||||
cmake_args += ["-DCMAKE_INSTALL_RPATH={}".format("@loader_path;@loader_path/..")]
|
||||
|
||||
# Documentation is used for Python docstrings but we allow to build
|
||||
# the wheel without docs to remove a hard dependency on doxygen.
|
||||
if cmake_find_package("Doxygen"):
|
||||
cmake_args += ["-DOCIO_BUILD_DOCS=ON"]
|
||||
|
||||
# Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level
|
||||
# across all generators.
|
||||
if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ:
|
||||
@@ -155,11 +192,34 @@ class CMakeBuild(build_ext):
|
||||
setup(
|
||||
version=get_version(),
|
||||
package_dir={
|
||||
'PyOpenColorIOTests': 'tests/python',
|
||||
'PyOpenColorIOTests.data': 'tests/data',
|
||||
'PyOpenColorIO': 'src/bindings/python/package',
|
||||
'PyOpenColorIO.bin.pyocioamf': 'src/apps/pyocioamf',
|
||||
'PyOpenColorIO.bin.pyociodisplay': 'src/apps/pyociodisplay',
|
||||
},
|
||||
packages=['PyOpenColorIOTests', 'PyOpenColorIOTests.data'],
|
||||
ext_modules=[CMakeExtension("PyOpenColorIO")],
|
||||
packages=[
|
||||
'PyOpenColorIO',
|
||||
'PyOpenColorIO.bin.pyocioamf',
|
||||
'PyOpenColorIO.bin.pyociodisplay',
|
||||
],
|
||||
ext_modules=[CMakeExtension("PyOpenColorIO.PyOpenColorIO")],
|
||||
cmdclass={"build_ext": CMakeBuild},
|
||||
include_package_data=True
|
||||
include_package_data=True,
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
# Native applications
|
||||
'ocioarchive=PyOpenColorIO.command_line:main',
|
||||
'ociobakelut=PyOpenColorIO.command_line:main',
|
||||
'ociocheck=PyOpenColorIO.command_line:main',
|
||||
'ociochecklut=PyOpenColorIO.command_line:main',
|
||||
'ocioconvert=PyOpenColorIO.command_line:main',
|
||||
'ociodisplay=PyOpenColorIO.command_line:main',
|
||||
'ociolutimage=PyOpenColorIO.command_line:main',
|
||||
'ociomakeclf=PyOpenColorIO.command_line:main',
|
||||
'ocioperf=PyOpenColorIO.command_line:main',
|
||||
'ociowrite=PyOpenColorIO.command_line:main',
|
||||
# Python applications
|
||||
'pyocioamf=PyOpenColorIO.bin.pyocioamf.pyocioamf:main',
|
||||
'pyociodisplay=PyOpenColorIO.bin.pyociodisplay.pyociodisplay:main',
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
set -ex
|
||||
|
||||
MINIZIPNG_VERSION="$1"
|
||||
INSTALL_TARGET="$2"
|
||||
|
||||
MINIZIPNG_MAJOR_MINOR=$(echo "${MINIZIPNG_VERSION}" | cut -d. -f-2)
|
||||
MINIZIPNG_MAJOR=$(echo "${MINIZIPNG_VERSION}" | cut -d. -f-1)
|
||||
MINIZIPNG_MINOR=$(echo "${MINIZIPNG_MAJOR_MINOR}" | cut -d. -f2-)
|
||||
MINIZIPNG_PATCH=$(echo "${MINIZIPNG_VERSION}" | cut -d. -f3-)
|
||||
MINIZIPNG_VERSION_U="${MINIZIPNG_MAJOR}.${MINIZIPNG_MINOR}.${MINIZIPNG_PATCH}"
|
||||
|
||||
git clone https://github.com/zlib-ng/minizip-ng
|
||||
cd minizip-ng
|
||||
|
||||
if [ "$MINIZIPNG_VERSION" == "latest" ]; then
|
||||
LATEST_TAG=$(git describe --abbrev=0 --tags)
|
||||
git checkout tags/${LATEST_TAG} -b ${LATEST_TAG}
|
||||
else
|
||||
git checkout tags/${MINIZIPNG_VERSION_U} -b ${MINIZIPNG_VERSION_U}
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
${INSTALL_TARGET:+"-DCMAKE_INSTALL_PREFIX="${INSTALL_TARGET}""} \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DMZ_OPENSSL=OFF \
|
||||
-DMZ_LIBBSD=OFF \
|
||||
-DMZ_BUILD_TESTS=OFF \
|
||||
-DMZ_COMPAT=OFF \
|
||||
-DMZ_BZIP2=OFF \
|
||||
-DMZ_LZMA=OFF \
|
||||
-DMZ_LIBCOMP=OFF \
|
||||
-DMZ_ZSTD=OFF \
|
||||
-DMZ_PKCRYPT=OFF \
|
||||
-DMZ_WZAES=OFF \
|
||||
-DMZ_SIGNING=OFF \
|
||||
-DMZ_ZLIB=ON \
|
||||
-DMZ_ICONV=OFF \
|
||||
-DMZ_FETCH_LIBS=OFF \
|
||||
-DMZ_FORCE_FETCH_LIBS=OFF \
|
||||
-DZLIB_LIBRARY=${INSTALL_TARGET}/${CMAKE_INSTALL_LIBDIR} \
|
||||
-DZLIB_INCLUDE_DIR=${INSTALL_TARGET}/include \
|
||||
../.
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
--parallel 2
|
||||
|
||||
cd ../..
|
||||
rm -rf minizip-ng
|
||||
@@ -22,14 +22,30 @@ mkdir build
|
||||
cd build
|
||||
# FIXME: Revert OSL_BUILD_TESTS to OFF when OSL 1.12 is released
|
||||
# CMake configure fails when tests are off, only fixed in 1.12 dev branch
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
${INSTALL_TARGET:+"-DCMAKE_INSTALL_PREFIX="${INSTALL_TARGET}""} \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DOSL_BUILD_TESTS=ON \
|
||||
-DVERBOSE=ON \
|
||||
-DSTOP_ON_WARNING=OFF \
|
||||
-DBoost_NO_BOOST_CMAKE=ON \
|
||||
../.
|
||||
|
||||
if [[ $OSTYPE == 'darwin'* ]]; then
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
${INSTALL_TARGET:+"-DCMAKE_INSTALL_PREFIX="${INSTALL_TARGET}""} \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++ \
|
||||
-DOSL_BUILD_TESTS=ON \
|
||||
-DVERBOSE=ON \
|
||||
-DSTOP_ON_WARNING=OFF \
|
||||
-DBoost_NO_BOOST_CMAKE=ON \
|
||||
-DLLVM_ROOT=$(brew --prefix llvm@15) \
|
||||
../.
|
||||
else # not macOS
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
${INSTALL_TARGET:+"-DCMAKE_INSTALL_PREFIX="${INSTALL_TARGET}""} \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DOSL_BUILD_TESTS=ON \
|
||||
-DVERBOSE=ON \
|
||||
-DSTOP_ON_WARNING=OFF \
|
||||
-DBoost_NO_BOOST_CMAKE=ON \
|
||||
../.
|
||||
fi
|
||||
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
set -ex
|
||||
|
||||
ZLIB_VERSION="$1"
|
||||
INSTALL_TARGET="$2"
|
||||
|
||||
ZLIB_MAJOR_MINOR=$(echo "${ZLIB_VERSION}" | cut -d. -f-2)
|
||||
ZLIB_MAJOR=$(echo "${ZLIB_VERSION}" | cut -d. -f-1)
|
||||
ZLIB_MINOR=$(echo "${ZLIB_MAJOR_MINOR}" | cut -d. -f2-)
|
||||
ZLIB_PATCH=$(echo "${ZLIB_VERSION}" | cut -d. -f3-)
|
||||
ZLIB_VERSION_U="${ZLIB_MAJOR}.${ZLIB_MINOR}.${ZLIB_PATCH}"
|
||||
|
||||
git clone https://github.com/madler/zlib
|
||||
cd zlib
|
||||
|
||||
if [ "$ZLIB_VERSION" == "latest" ]; then
|
||||
LATEST_TAG=$(git describe --abbrev=0 --tags)
|
||||
git checkout tags/${LATEST_TAG} -b ${LATEST_TAG}
|
||||
else
|
||||
git checkout tags/v${ZLIB_VERSION_U} -b v${ZLIB_VERSION_U}
|
||||
fi
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
${INSTALL_TARGET:+"-DCMAKE_INSTALL_PREFIX="${INSTALL_TARGET}""} \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
../.
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config Release \
|
||||
--parallel 2
|
||||
|
||||
cd ../..
|
||||
rm -rf zlib
|
||||
@@ -5,6 +5,7 @@
|
||||
set -ex
|
||||
|
||||
HERE=$(dirname $0)
|
||||
DOXYGEN_LOCATION="$1"
|
||||
|
||||
bash $HERE/install_doxygen.sh latest
|
||||
bash $HERE/install_doxygen.sh "$DOXYGEN_LOCATION"
|
||||
pip install -r $HERE/../../../../docs/requirements.txt
|
||||
|
||||
@@ -4,10 +4,18 @@
|
||||
|
||||
set -ex
|
||||
|
||||
DOXYGEN_VERSION="$1"
|
||||
DOXYGEN_LOCATION="$1"
|
||||
|
||||
if [ "$DOXYGEN_VERSION" == "latest" ]; then
|
||||
choco install doxygen.install
|
||||
else
|
||||
choco install doxygen.install --version=${DOXYGEN_VERSION}
|
||||
fi
|
||||
# Utility to parse JSON object.
|
||||
choco install jq
|
||||
|
||||
# Get the URL of the latest zip package for Doxygen.
|
||||
url=$(curl -s 'https://api.github.com/repos/doxygen/doxygen/releases/latest' | jq -r '.assets[] | select(.name | test("doxygen-.*windows.x64.bin.zip")) | .browser_download_url')
|
||||
|
||||
# Download the zip.
|
||||
mkdir $DOXYGEN_LOCATION
|
||||
cd $DOXYGEN_LOCATION
|
||||
powershell 'iwr -URI '$url' -OutFile doxygen.zip'
|
||||
|
||||
# Unzip the file into $DOXYGEN_LOCATION.
|
||||
unzip -o doxygen.zip
|
||||
@@ -0,0 +1,66 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Check for compatibility between OpenEXR and OpenImageIO since OCIO requires OpenEXR 3+.
|
||||
#
|
||||
|
||||
message(STATUS "Checking if the OpenImageIO found is built with OpenEXR 3+...")
|
||||
|
||||
find_path (OpenImageIO_INCLUDE_DIR
|
||||
NAMES
|
||||
OpenImageIO/imageio.h
|
||||
HINTS
|
||||
${OpenImageIO_ROOT}
|
||||
# Assuming that OpenImageIO was installed normally, go back a few folders down
|
||||
# to get the equivalent of OpenImageIO_ROOT.
|
||||
${OpenImageIO_DIR}/../../..
|
||||
PATH_SUFFIXES
|
||||
OpenImageIO/include
|
||||
include
|
||||
)
|
||||
|
||||
if (NOT OpenImageIO_INCLUDE_DIR)
|
||||
message(STATUS "${ColorWarning}Could not find OpenImageIO header to evaluate the OpenEXR version.")
|
||||
message(STATUS "Please provide the OpenImageIO_DIR variable.")
|
||||
message(STATUS "If your OpenImageIO's files are located in different root directory, \
|
||||
please provide the OpenImageIO_ROOT where the include files are located.${ColorReset}")
|
||||
endif()
|
||||
|
||||
# Try to figure out version number
|
||||
set (OIIO_VERSION_HEADER "${OpenImageIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h")
|
||||
if (EXISTS "${OIIO_VERSION_HEADER}")
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_MAJOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OpenImageIO_VERSION_MAJOR ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_MINOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OpenImageIO_VERSION_MINOR ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_PATCH .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OpenImageIO_VERSION_PATCH ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_TWEAK .*$")
|
||||
if (TMP)
|
||||
string (REGEX MATCHALL "[0-9]+" OpenImageIO_VERSION_TWEAK ${TMP})
|
||||
else ()
|
||||
set (OpenImageIO_VERSION_TWEAK 0)
|
||||
endif ()
|
||||
set (OpenImageIO_VERSION "${OpenImageIO_VERSION_MAJOR}.${OpenImageIO_VERSION_MINOR}.${OpenImageIO_VERSION_PATCH}.${OpenImageIO_VERSION_TWEAK}")
|
||||
endif ()
|
||||
|
||||
set (OIIO_IMATH_HEADER "${OpenImageIO_INCLUDE_DIR}/OpenImageIO/Imath.h")
|
||||
if (EXISTS "${OIIO_IMATH_HEADER}")
|
||||
file(STRINGS "${OIIO_IMATH_HEADER}" TMP REGEX "^#define OIIO_USING_IMATH .*$")
|
||||
string(REGEX MATCHALL "[0-9]" OIIO_IMATH_VERSION ${TMP})
|
||||
if (OIIO_IMATH_VERSION LESS 3)
|
||||
message(STATUS "Skipping OpenImageIO built against OpenEXR 2, please use version 3 or greater.")
|
||||
else()
|
||||
set(is_OpenEXR_VERSION_valid TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# clean up variables
|
||||
unset(OpenImageIO_INCLUDE_DIR)
|
||||
unset(OIIO_VERSION_HEADER)
|
||||
unset(OIIO_VERSION_MAJOR)
|
||||
unset(OIIO_VERSION_MINOR)
|
||||
unset(OIIO_VERSION_PATCH)
|
||||
unset(OIIO_VERSION_TWEAK)
|
||||
unset(OIIO_IMATH_HEADER)
|
||||
unset(OIIO_IMATH_VERSION)
|
||||
@@ -21,7 +21,7 @@ macro(get_python_pre_command)
|
||||
# available.
|
||||
if(WIN32)
|
||||
# Use Windows path separators since this is being passed through to cmd
|
||||
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} _WIN_BINARY_DIR)
|
||||
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} _WIN_BINARY_DIR)
|
||||
|
||||
set(_DLL_PATH "${_WIN_BINARY_DIR}\\src\\OpenColorIO")
|
||||
if(MSVC_IDE)
|
||||
@@ -43,7 +43,7 @@ macro(get_python_pre_command)
|
||||
# Build path list
|
||||
set(_WIN_PATHS
|
||||
${_PYD_PATH}
|
||||
"${CMAKE_SOURCE_DIR}\\share\\docs"
|
||||
"${PROJECT_SOURCE_DIR}\\share\\docs"
|
||||
)
|
||||
# Include optional paths from macro arguments
|
||||
foreach(_PATH ${ARGN})
|
||||
@@ -65,8 +65,8 @@ macro(get_python_pre_command)
|
||||
else()
|
||||
# Build path list
|
||||
set(_PATHS
|
||||
"${CMAKE_BINARY_DIR}/src/bindings/python"
|
||||
"${CMAKE_SOURCE_DIR}/share/docs"
|
||||
"${PROJECT_BINARY_DIR}/src/bindings/python"
|
||||
"${PROJECT_SOURCE_DIR}/share/docs"
|
||||
)
|
||||
foreach(_PATH ${ARGN})
|
||||
list(APPEND _PATHS ${_PATH})
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
# This function is based on Pybind11's pybind11_strip.
|
||||
|
||||
macro(ocio_strip_binary target_name)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" _uppercase_CMAKE_BUILD_TYPE)
|
||||
if(NOT MSVC AND NOT "${_uppercase_CMAKE_BUILD_TYPE}" MATCHES DEBUG|RELWITHDEBINFO)
|
||||
if(CMAKE_STRIP)
|
||||
if(APPLE)
|
||||
set(_strip_opt -x)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${target_name}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_STRIP} ${_strip_opt} $<TARGET_FILE:${target_name}>
|
||||
)
|
||||
unset(_strip_opt)
|
||||
endif()
|
||||
endif()
|
||||
unset(_uppercase_CMAKE_BUILD_TYPE)
|
||||
endmacro()
|
||||
@@ -6,8 +6,19 @@
|
||||
|
||||
macro(split_version_string version_var output_prefix)
|
||||
string(REPLACE "." ";" _version_var_list ${version_var})
|
||||
list(GET _version_var_list 0 ${output_prefix}_VERSION_MAJOR)
|
||||
list(GET _version_var_list 1 ${output_prefix}_VERSION_MINOR)
|
||||
list(GET _version_var_list 2 ${output_prefix}_VERSION_PATCH)
|
||||
list(LENGTH _version_var_list _version_var_list_length)
|
||||
|
||||
if (_version_var_list_length GREATER_EQUAL 1)
|
||||
list(GET _version_var_list 0 ${output_prefix}_VERSION_MAJOR)
|
||||
endif()
|
||||
|
||||
if (_version_var_list_length GREATER_EQUAL 2)
|
||||
list(GET _version_var_list 1 ${output_prefix}_VERSION_MINOR)
|
||||
endif()
|
||||
|
||||
if (_version_var_list_length GREATER_EQUAL 3)
|
||||
list(GET _version_var_list 2 ${output_prefix}_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
unset(_version_var_list)
|
||||
endmacro()
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
include(ocio_install_dependency)
|
||||
|
||||
###################################################################################################
|
||||
# ocio_print_versions_error is a wrapper for messages when the dependency is not found.
|
||||
#
|
||||
# Arguments:
|
||||
# dep_name is the name of the dependency (package). Please note that dep_name is case sensitive.
|
||||
# message_color is the color of the message.
|
||||
#
|
||||
# Note that this macro is used in ocio_handle_dependency and should be there only.
|
||||
###################################################################################################
|
||||
macro (ocio_print_versions_error dep_name message_color)
|
||||
if(NOT ocio_dep_MIN_VERSION AND NOT ocio_dep_MAX_VERSION AND NOT ocio_dep_RECOMMENDED_VERSION)
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (no version specified)${ColorReset}")
|
||||
elseif(NOT ocio_dep_MIN_VERSION AND NOT ocio_dep_RECOMMENDED_VERSION)
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (maximum version: \"${ocio_dep_MAX_VERSION)\"${ColorReset}")
|
||||
elseif(NOT ocio_dep_MIN_VERSION AND NOT ocio_dep_MAX_VERSION)
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (recommended version: \"${ocio_dep_RECOMMENDED_VERSION}\")\"${ColorReset}")
|
||||
elseif(NOT ocio_dep_RECOMMENDED_VERSION AND NOT ocio_dep_MAX_VERSION)
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (minimum version: \"${ocio_dep_MIN_VERSION})\"${ColorReset}")
|
||||
elseif(NOT ocio_dep_MIN_VERSION)
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (recommended version: \"${ocio_dep_RECOMMENDED_VERSION}\", maximum version: \"${ocio_dep_MAX_VERSION}\")${ColorReset}")
|
||||
elseif(NOT ocio_dep_RECOMMENDED_VERSION)
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (minimum version: \"${ocio_dep_MIN_VERSION}\", maximum version: \"${ocio_dep_MAX_VERSION}\")${ColorReset}")
|
||||
elseif(NOT ocio_dep_MAX_VERSION)
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (minimum version: \"${ocio_dep_MIN_VERSION}\", recommended version: \"${ocio_dep_RECOMMENDED_VERSION}\")${ColorReset}")
|
||||
else()
|
||||
message(STATUS "${message_color}Could NOT find ${dep_name} (minimum version: \"${ocio_dep_MIN_VERSION}\", recommended version: \"${ocio_dep_RECOMMENDED_VERSION}\", max: \"${ocio_dep_MAX_VERSION}\")${ColorReset}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Using a macro because OCIO wants the scope to be the same as the caller scope.
|
||||
# Find modules will set variables via the PARENT_SCOPE option and OCIO needs those
|
||||
# variables in the caller scope.
|
||||
|
||||
###################################################################################################
|
||||
# ocio_handle_dependency is a wrapper for find_package with extra options (features).
|
||||
#
|
||||
# Argument:
|
||||
# dep_name is the name of the dependency (package). Please note that dep_name is case sensitive.
|
||||
#
|
||||
# Options (no value):
|
||||
# REQUIRED - Whether the dependency is required or not. Fails if missing.
|
||||
# PREFER_CONFIG - Call find_package in CONFIG mode internally.
|
||||
# Note that it tries to find <dep_name>Config.cmake or
|
||||
# <dep_name>-Config.cmake directly.
|
||||
# ALLOW_INSTALL - Try to install the dependency if not found. Note that a
|
||||
# corresponding Install<dep_name>.cmake file must exist.
|
||||
# VERBOSE - Enable extra logging.
|
||||
#
|
||||
# Options (one value):
|
||||
# MIN_VERSION - Minimum version for the dependency.
|
||||
# MAX_VERSION - Maximum version for the dependency.
|
||||
# RECOMMENDED_VERSION - Recommended version for the dependency.
|
||||
# RECOMMENDED_VERSION_REASON - Reason for the recommended version.
|
||||
#
|
||||
# Options (multiple values):
|
||||
# VERSION_VARS - List of version variables. Default to <dep_name>_VERSION.
|
||||
# COMPONENTS - List of components to find. Just like find_package option.
|
||||
# PROMOTE_TARGET - List of targets that needs to be globally visible by setting
|
||||
# the targets property IMPORTED_GLOBAL to true. Note that the
|
||||
# targets must be created by the dependency.
|
||||
#
|
||||
# This is a macro because OCIO wants the scope to be the same as the caller scope.
|
||||
# Find modules will set variables via the PARENT_SCOPE option and OCIO needs those
|
||||
# variables in the caller scope.
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
macro (ocio_handle_dependency dep_name)
|
||||
cmake_parse_arguments(
|
||||
# prefix
|
||||
ocio_dep
|
||||
# options
|
||||
"REQUIRED;PREFER_CONFIG;ALLOW_INSTALL;VERBOSE"
|
||||
# one value keywords
|
||||
"MIN_VERSION;MAX_VERSION;RECOMMENDED_VERSION;RECOMMENDED_VERSION_REASON;PROMOTE_TARGET"
|
||||
# multi value keywords
|
||||
"VERSION_VARS;COMPONENTS"
|
||||
# args
|
||||
${ARGN})
|
||||
|
||||
set(ocio_dep_FORCE_INSTALLATION OFF)
|
||||
if(ocio_dep_ALLOW_INSTALL AND OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
set(ocio_dep_FORCE_INSTALLATION ON)
|
||||
endif()
|
||||
|
||||
if(NOT ocio_dep_FORCE_INSTALLATION)
|
||||
set(ocio_dep_QUIET_string "")
|
||||
# Do not set to QUIET when OCIO_VERBOSE is ON.
|
||||
if(NOT ocio_dep_VERBOSE AND NOT OCIO_VERBOSE)
|
||||
set(${dep_name}_FIND_QUIETLY true)
|
||||
set(ocio_dep_QUIET_string "QUIET")
|
||||
endif()
|
||||
|
||||
set(ocio_dep_CONFIG_string "")
|
||||
if(ocio_dep_PREFER_CONFIG)
|
||||
set(ocio_dep_CONFIG_string "CONFIG")
|
||||
endif()
|
||||
|
||||
set(ocio_dep_COMPONENTS_string "")
|
||||
if(ocio_dep_COMPONENTS)
|
||||
set(ocio_dep_COMPONENTS_string "COMPONENTS")
|
||||
endif()
|
||||
|
||||
if (${dep_name}_FOUND)
|
||||
# Nothing to do. Already found.
|
||||
else()
|
||||
# Try to find the recommended, or higher, version.
|
||||
# Note that the recommended version should always be specified.
|
||||
find_package(${dep_name}
|
||||
${ocio_dep_RECOMMENDED_VERSION}
|
||||
${ocio_dep_CONFIG_string}
|
||||
${ocio_dep_COMPONENTS_string}
|
||||
${ocio_dep_COMPONENTS}
|
||||
${ocio_dep_QUIET_string}
|
||||
${ocio_dep_UNPARSED_ARGUMENTS})
|
||||
|
||||
if (NOT ${dep_name}_FOUND AND ocio_dep_PREFER_CONFIG)
|
||||
# Try find_package in module mode instead of config mode.
|
||||
find_package(${dep_name}
|
||||
${ocio_dep_RECOMMENDED_VERSION}
|
||||
${ocio_dep_COMPONENTS_string}
|
||||
${ocio_dep_COMPONENTS}
|
||||
${ocio_dep_QUIET_string}
|
||||
${ocio_dep_UNPARSED_ARGUMENTS})
|
||||
endif()
|
||||
|
||||
if(NOT ${dep_name}_FOUND AND ocio_dep_MIN_VERSION
|
||||
AND NOT ocio_dep_MIN_VERSION VERSION_EQUAL ocio_dep_MAX_VERSION
|
||||
AND NOT ocio_dep_MIN_VERSION VERSION_EQUAL ocio_dep_RECOMMENDED_VERSION)
|
||||
|
||||
# if the recommended, or higher, version is not found, try to find dependency with
|
||||
# the minimum version.
|
||||
find_package(${dep_name}
|
||||
${ocio_dep_MIN_VERSION}
|
||||
${ocio_dep_CONFIG_string}
|
||||
${ocio_dep_COMPONENTS_string}
|
||||
${ocio_dep_COMPONENTS}
|
||||
${ocio_dep_QUIET_string}
|
||||
${ocio_dep_UNPARSED_ARGUMENTS})
|
||||
if (NOT ${dep_name}_FOUND AND ocio_dep_PREFER_CONFIG)
|
||||
# Try find_package in module mode instead of config mode.
|
||||
find_package(${dep_name}
|
||||
${ocio_dep_MIN_VERSION}
|
||||
${ocio_dep_COMPONENTS_string}
|
||||
${ocio_dep_COMPONENTS}
|
||||
${ocio_dep_QUIET_string}
|
||||
${ocio_dep_UNPARSED_ARGUMENTS})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Check which VERSION_VARS was set by find_package.
|
||||
set(_VERSION_VAR "${dep_name}_VERSION")
|
||||
foreach (_vervar ${ocio_dep_VERSION_VARS})
|
||||
if(${_vervar})
|
||||
set(_VERSION_VAR ${_vervar})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(_VERSION_VAR)
|
||||
set(ocio_dep_VERSION ${${_VERSION_VAR}})
|
||||
endif()
|
||||
|
||||
# Expecting that the minimum and recommended version are always provided.
|
||||
# Make sure that the version is within the valid range.
|
||||
if(${dep_name}_FOUND)
|
||||
if (ocio_dep_VERSION)
|
||||
# Make sure that the version found is not greater than the maximum version.
|
||||
if(DEFINED ocio_dep_MAX_VERSION)
|
||||
if(ocio_dep_VERSION VERSION_GREATER ocio_dep_MAX_VERSION)
|
||||
# Display it as an error, but do not abort right now.
|
||||
message(SEND_ERROR "${ColorError}Found ${dep_name} ${ocio_dep_VERSION}, but it is over the maximum version \"${ocio_dep_MAX_VERSION}\" ${ColorReset}")
|
||||
set(_${dep_name}_found_displayed true)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED ocio_dep_RECOMMENDED_VERSION)
|
||||
if (ocio_dep_VERSION VERSION_LESS ocio_dep_RECOMMENDED_VERSION)
|
||||
message(STATUS "${ColorSuccess}Found ${dep_name} (version \"${ocio_dep_VERSION}\") (recommended version: \"${ocio_dep_RECOMMENDED_VERSION}\")${ColorReset}")
|
||||
if (ocio_dep_RECOMMENDED_VERSION_REASON)
|
||||
message(STATUS " Reason: ${ocio_dep_RECOMMENDED_VERSION_REASON}")
|
||||
endif()
|
||||
set(_${dep_name}_found_displayed true)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT _${dep_name}_found_displayed)
|
||||
message(STATUS "${ColorSuccess}Found ${dep_name} (version \"${ocio_dep_VERSION}\")${ColorReset}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "${ColorSuccess}Found ${dep_name} (no version information)${ColorReset}")
|
||||
endif()
|
||||
else()
|
||||
if(ocio_dep_REQUIRED AND NOT ocio_dep_ALLOW_INSTALL)
|
||||
set(message_color "${ColorError}")
|
||||
else()
|
||||
set(message_color "${ColorReset}")
|
||||
endif()
|
||||
|
||||
ocio_print_versions_error(${dep_name} ${message_color})
|
||||
|
||||
if(${dep_name}_ROOT)
|
||||
message(STATUS "${message_color} ${dep_name}_ROOT was: ${${dep_name}_ROOT} ${ColorReset}")
|
||||
elseif($ENV{${dep_name}_ROOT})
|
||||
message(STATUS "${message_color} ENV ${dep_name}_ROOT was: ${${dep_name}_ROOT} ${ColorReset}")
|
||||
endif()
|
||||
|
||||
if(ocio_dep_ALLOW_INSTALL)
|
||||
ocio_install_dependency(${dep_name} VERSION ${ocio_dep_RECOMMENDED_VERSION})
|
||||
endif()
|
||||
|
||||
if(ocio_dep_REQUIRED)
|
||||
if(NOT ${dep_name}_FOUND)
|
||||
message(SEND_ERROR "${ColorError}${dep_name} is required, will abort at the end.${ColorReset}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
elseif(ocio_dep_FORCE_INSTALLATION)
|
||||
# Skip the search and install dependency right away.
|
||||
ocio_install_dependency(${dep_name} VERSION ${ocio_dep_RECOMMENDED_VERSION})
|
||||
endif()
|
||||
|
||||
if(${dep_name}_FOUND AND ocio_dep_PROMOTE_TARGET)
|
||||
foreach (_target_to_be_promoted_ ${ocio_dep_PROMOTE_TARGET})
|
||||
set_target_properties(${_target_to_be_promoted_} PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -0,0 +1,46 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
###################################################################################################
|
||||
# ocio_install_dependency installs a dependency by calling the corresponding Install module.
|
||||
# e.g. Install<dep_name>.cmake
|
||||
#
|
||||
# Argument:
|
||||
# dep_name is the name of the dependency (package). Please note that dep_name is case sensitive.
|
||||
#
|
||||
# Options (one value):
|
||||
# VERSION - Version to install.
|
||||
###################################################################################################
|
||||
macro (ocio_install_dependency dep_name)
|
||||
cmake_parse_arguments(
|
||||
# prefix - Must be different than the one used in ocio_handle_dependency.cmake.
|
||||
ocio_id
|
||||
# options
|
||||
""
|
||||
# one value keywords
|
||||
"VERSION;PROMOTE_TARGET"
|
||||
# multi value keywords
|
||||
""
|
||||
# args
|
||||
${ARGN})
|
||||
|
||||
|
||||
if(NOT ${dep_name}_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
set(OCIO_${dep_name}_RECOMMENDED_VERSION ${ocio_id_VERSION})
|
||||
include(Install${dep_name})
|
||||
set(_${dep_name}_built_by_ocio TRUE)
|
||||
endif()
|
||||
|
||||
if(${dep_name}_FOUND)
|
||||
if(${dep_name}_FOUND AND ocio_id_PROMOTE_TARGET)
|
||||
foreach (_target_to_be_promoted_ ${ocio_id_PROMOTE_TARGET})
|
||||
set_target_properties(${_target_to_be_promoted_} PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if (${_${dep_name}_built_by_ocio})
|
||||
message(STATUS "${ColorSuccess}Installed ${dep_name} (version \"${ocio_id_VERSION}\")${ColorReset}")
|
||||
endif()
|
||||
endif()
|
||||
unset(_${dep_name}_built_by_ocio)
|
||||
endmacro()
|
||||
@@ -6,6 +6,9 @@
|
||||
# by the OCIO_INSTALL_EXT_PACKAGES option.
|
||||
#
|
||||
|
||||
include(Colors)
|
||||
include(ocio_handle_dependency)
|
||||
|
||||
###############################################################################
|
||||
### Global package options ###
|
||||
|
||||
@@ -21,37 +24,106 @@ set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY ON CACHE BOOL
|
||||
set(CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY ON CACHE BOOL
|
||||
"Disable CMake System Package Registry when finding packages")
|
||||
|
||||
if (APPLE)
|
||||
# Store the previous value of CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE.
|
||||
set(_PREVIOUS_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
|
||||
set(_PREVIOUS_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
|
||||
|
||||
# Prioritize other paths before Frameworks and Appbundle for find_path, find_library and
|
||||
# find_package.
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
set(CMAKE_FIND_APPBUNDLE LAST)
|
||||
endif()
|
||||
|
||||
|
||||
message(STATUS "")
|
||||
message(STATUS "Missing a dependency? Try the following possibilities:")
|
||||
message(STATUS "If the package provides CMake's configuration file, use -D<pkg>_DIR=<path to folder>.")
|
||||
message(STATUS "If it doesn't provide it, try -D<pkg>_ROOT=<path to folder with lib and includes>.")
|
||||
message(STATUS "Alternatively, try -D<pkg>_LIBRARY=<path to lib file> and/or -D<pkg>_INCLUDE_DIR=<path to folder>.")
|
||||
message(STATUS "")
|
||||
message(STATUS "Please refer to the find module under share/cmake/modules for extra information.")
|
||||
|
||||
###############################################################################
|
||||
### Packages and versions ###
|
||||
##
|
||||
## Required dependencies
|
||||
##
|
||||
###############################################################################
|
||||
message(STATUS "")
|
||||
message(STATUS "Checking for mandatory dependencies...")
|
||||
|
||||
# expat
|
||||
# https://github.com/libexpat/libexpat
|
||||
find_package(expat 2.4.1 REQUIRED)
|
||||
ocio_handle_dependency( expat REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 2.4.1
|
||||
RECOMMENDED_VERSION 2.5.0
|
||||
RECOMMENDED_VERSION_REASON "CVE fixes and fix issue with symbol leakage when built as a static library")
|
||||
|
||||
# yaml-cpp
|
||||
# https://github.com/jbeder/yaml-cpp
|
||||
find_package(yaml-cpp 0.7.0 REQUIRED)
|
||||
ocio_handle_dependency( yaml-cpp REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 0.6.3
|
||||
RECOMMENDED_VERSION 0.7.0
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
|
||||
# pystring
|
||||
# https://github.com/imageworks/pystring
|
||||
find_package(pystring 1.1.3 REQUIRED)
|
||||
ocio_handle_dependency( pystring REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 1.1.3
|
||||
RECOMMENDED_VERSION 1.1.3
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
|
||||
# Imath (>=3.1)
|
||||
# https://github.com/AcademySoftwareFoundation/Imath
|
||||
set(_Imath_ExternalProject_VERSION "3.1.5")
|
||||
find_package(Imath 3.0 REQUIRED)
|
||||
ocio_handle_dependency( Imath REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 3.1.1
|
||||
RECOMMENDED_VERSION 3.1.6
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
|
||||
# ZLIB
|
||||
# https://github.com/madler/zlib
|
||||
set(_zlib_ExternalProject_VERSION "1.2.12")
|
||||
find_package(zlib REQUIRED)
|
||||
###############################################################################
|
||||
# ZLIB (https://github.com/madler/zlib)
|
||||
#
|
||||
# The following variables can be set:
|
||||
# ZLIB_ROOT Location of ZLIB library file and includes folder.
|
||||
# Alternatively, ZLIB_LIBRARY and ZLIB_INCLUDE_DIR can be used.
|
||||
#
|
||||
# ZLIB_LIBRARY Location of ZLIB library file.
|
||||
# ZLIB_INCLUDE_DIR Location of ZLIB includes folder.
|
||||
#
|
||||
# ZLIB_VERSION ZLIB Version (CMake 3.26+)
|
||||
# ZLIB_VERSION_STRING ZLIB Version (CMake < 3.26)
|
||||
#
|
||||
#
|
||||
# ZLIB_USE_STATIC_LIBS Set to ON if static library is prefered (CMake 3.24+)
|
||||
#
|
||||
###############################################################################
|
||||
# ZLIB 1.2.13 is used since it fixes a critical vulnerability.
|
||||
# See https://nvd.nist.gov/vuln/detail/CVE-2022-37434
|
||||
# See https://github.com/madler/zlib/releases/tag/v1.2.13
|
||||
ocio_handle_dependency( ZLIB REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 1.2.8
|
||||
RECOMMENDED_VERSION 1.2.13
|
||||
RECOMMENDED_VERSION_REASON "CVE fixes"
|
||||
VERSION_VARS ZLIB_VERSION_STRING ZLIB_VERSION )
|
||||
|
||||
###############################################################################
|
||||
|
||||
# minizip-ng
|
||||
# https://github.com/zlib-ng/minizip-ng
|
||||
find_package(minizip-ng 3.0.6 REQUIRED)
|
||||
ocio_handle_dependency( minizip-ng REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 3.0.6
|
||||
RECOMMENDED_VERSION 3.0.7
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
|
||||
###############################################################################
|
||||
##
|
||||
## Optional dependencies
|
||||
##
|
||||
###############################################################################
|
||||
message(STATUS "")
|
||||
message(STATUS "Checking for optional dependencies...")
|
||||
|
||||
if(OCIO_BUILD_APPS)
|
||||
|
||||
# NOTE: Depending of the compiler version lcms2 2.2 does not compile with
|
||||
# C++17 so, if you change the lcms2 version update the code to compile
|
||||
# lcms2 and dependencies with C++17 or higher i.e. remove the cap of C++
|
||||
@@ -59,13 +131,19 @@ if(OCIO_BUILD_APPS)
|
||||
|
||||
# lcms2
|
||||
# https://github.com/mm2/Little-CMS
|
||||
find_package(lcms2 2.2 REQUIRED)
|
||||
ocio_handle_dependency( lcms2 REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 2.2
|
||||
RECOMMENDED_VERSION 2.2
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
endif()
|
||||
|
||||
if(OCIO_BUILD_OPENFX)
|
||||
# openfx
|
||||
# https://github.com/ofxa/openfx
|
||||
find_package(openfx 1.4 REQUIRED)
|
||||
ocio_handle_dependency( openfx REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 1.4
|
||||
RECOMMENDED_VERSION 1.4
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
endif()
|
||||
|
||||
if (OCIO_PYTHON_VERSION AND NOT OCIO_BUILD_PYTHON)
|
||||
@@ -87,44 +165,105 @@ if(OCIO_BUILD_PYTHON OR OCIO_BUILD_DOCS)
|
||||
list(APPEND _Python_COMPONENTS Development)
|
||||
endif()
|
||||
|
||||
|
||||
# Python
|
||||
find_package(Python ${OCIO_PYTHON_VERSION} REQUIRED
|
||||
COMPONENTS ${_Python_COMPONENTS})
|
||||
ocio_handle_dependency( Python REQUIRED
|
||||
COMPONENTS ${_Python_COMPONENTS}
|
||||
MIN_VERSION ${OCIO_PYTHON_VERSION}
|
||||
RECOMMENDED_VERSION ${OCIO_PYTHON_VERSION}
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
|
||||
if(OCIO_BUILD_PYTHON)
|
||||
# pybind11
|
||||
# https://github.com/pybind/pybind11
|
||||
# pybind11 2.9 fixes issues with MS Visual Studio 2022 (Debug).
|
||||
find_package(pybind11 2.9.2 REQUIRED)
|
||||
ocio_handle_dependency( pybind11 REQUIRED ALLOW_INSTALL
|
||||
MIN_VERSION 2.9.2
|
||||
RECOMMENDED_VERSION 2.9.2
|
||||
RECOMMENDED_VERSION_REASON "Pybind 2.10.0+ does not work with Python 2.7 anymore")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set OpenEXR Minimum version as a variable since it it used at multiple places.
|
||||
set(OpenEXR_MININUM_VERSION "3.0.5")
|
||||
if((OCIO_BUILD_APPS AND OCIO_USE_OIIO_FOR_APPS) OR OCIO_BUILD_TESTS)
|
||||
# OpenImageIO is required for OSL unit test and optional for apps.
|
||||
|
||||
# OpenImageIO
|
||||
# https://github.com/OpenImageIO/oiio
|
||||
set(OIIO_VERSION "2.2.14")
|
||||
set(OIIO_RECOMMENDED_VERSION "2.4")
|
||||
|
||||
if(OCIO_USE_OIIO_CMAKE_CONFIG)
|
||||
# TODO: Try when OIIO 2.4 is released (https://github.com/OpenImageIO/oiio/pull/3322).
|
||||
# set(OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH 1)
|
||||
find_package(OpenImageIO ${OIIO_VERSION} CONFIG)
|
||||
else()
|
||||
find_package(OpenImageIO ${OIIO_VERSION})
|
||||
# Supported from OIIO 2.4+. Setting this for lower versions doesn't affect anything.
|
||||
set(OPENIMAGEIO_CONFIG_DO_NOT_FIND_IMATH 1)
|
||||
|
||||
set(is_OpenEXR_VERSION_valid FALSE)
|
||||
# Check for compatibility between OpenEXR and OpenImageIO.
|
||||
# Will set is_OpenEXR_VERSION_valid to TRUE if valid.
|
||||
include(CheckForOpenEXRCompatibility)
|
||||
|
||||
# Do not try to find OpenImageIO if the version of OpenEXR is too old.
|
||||
if (is_OpenEXR_VERSION_valid)
|
||||
###############################################################################
|
||||
# OpenImageIO (https://github.com/OpenImageIO/oiio)
|
||||
#
|
||||
# Variables defined by OpenImageIO CMake's configuration files:
|
||||
# OpenImageIO_FOUND - Indicate whether the library was found or not
|
||||
# OpenImageIO_LIB_DIR - Library's directory
|
||||
# OpenImageIO_INCLUDE_DIR - Location of the header files
|
||||
# OpenImageIO_VERSION - Library's version
|
||||
#
|
||||
# Imported targets defined by this module, if found:
|
||||
# OpenImageIO::OpenImageIO
|
||||
# OpenImageIO::OpenImageIO_Util
|
||||
#
|
||||
###############################################################################
|
||||
# Calling find_package in CONFIG mode using PREFER_CONFIG option as OIIO support
|
||||
# config file since 2.1+ and OCIO minimum version is over that.
|
||||
ocio_handle_dependency( OpenImageIO PREFER_CONFIG
|
||||
MIN_VERSION ${OIIO_VERSION}
|
||||
RECOMMENDED_VERSION ${OIIO_RECOMMENDED_VERSION}
|
||||
PROMOTE_TARGET OpenImageIO::OpenImageIO)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(OCIO_BUILD_APPS)
|
||||
|
||||
if(OCIO_USE_OIIO_FOR_APPS AND OpenImageIO_FOUND AND TARGET OpenImageIO::OpenImageIO)
|
||||
if (USE_MSVC AND OCIO_IMAGE_BACKEND STREQUAL "OpenImageIO")
|
||||
# Temporary until fixed in OpenImageIO: Mute some warnings from OpenImageIO farmhash.h
|
||||
# C4267 (level 3) 'var' : conversion from 'size_t' to 'type', possible loss of data
|
||||
# C4244 (level 3 & 4) 'conversion' conversion from 'type1' to 'type2', possible loss of data
|
||||
target_compile_options(OpenImageIO::OpenImageIO PRIVATE /wd4267 /wd4244)
|
||||
endif()
|
||||
|
||||
add_library(OpenColorIO::ImageIOBackend ALIAS OpenImageIO::OpenImageIO)
|
||||
set(OCIO_IMAGE_BACKEND OpenImageIO)
|
||||
else()
|
||||
# OpenEXR
|
||||
# https://github.com/AcademySoftwareFoundation/openexr
|
||||
set(_OpenEXR_ExternalProject_VERSION "3.1.5")
|
||||
find_package(OpenEXR 3.0)
|
||||
###############################################################################
|
||||
# OpenEXR (https://github.com/AcademySoftwareFoundation/openexr)
|
||||
#
|
||||
# Variables defined by OpenEXR CMake's configuration files:
|
||||
# OpenEXR_FOUND - Indicate whether the library was found or not
|
||||
# OpenEXR_VERSION - Library's version
|
||||
#
|
||||
# Imported targets defined by this module, if found:
|
||||
# OpenEXR::Iex
|
||||
# OpenEXR::IexConfig
|
||||
# OpenEXR::IlmThread
|
||||
# OpenEXR::IlmThreadConfig
|
||||
# OpenEXR::OpenEXR
|
||||
# OpenEXR::OpenEXRConfig
|
||||
# OpenEXR::OpenEXRCore
|
||||
# OpenEXR::OpenEXRUtil
|
||||
#
|
||||
###############################################################################
|
||||
# Calling find_package in CONFIG mode using PREFER_CONFIG option.
|
||||
ocio_handle_dependency( OpenEXR PREFER_CONFIG ALLOW_INSTALL
|
||||
MIN_VERSION ${OpenEXR_MININUM_VERSION}
|
||||
RECOMMENDED_VERSION 3.1.5
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO"
|
||||
PROMOTE_TARGET OpenEXR::OpenEXR)
|
||||
|
||||
if(OpenEXR_FOUND AND TARGET OpenEXR::OpenEXR)
|
||||
add_library(OpenColorIO::ImageIOBackend ALIAS OpenEXR::OpenEXR)
|
||||
@@ -146,14 +285,23 @@ if(OCIO_BUILD_TESTS)
|
||||
if(TARGET Imath::Imath)
|
||||
# OpenShadingLanguage
|
||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||
find_package(OpenShadingLanguage 1.11)
|
||||
ocio_handle_dependency( OSL
|
||||
MIN_VERSION 1.11
|
||||
RECOMMENDED_VERSION 1.11
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
if(NOT OSL_FOUND)
|
||||
message(WARNING "Could NOT find OpenShadingLanguage. Skipping build of the OSL unit tests.")
|
||||
message(WARNING "Skipping build of the OpenShadingLanguage unit tests (OSL missing)")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Could NOT find Imath. Skipping build of the OSL unit tests.")
|
||||
message(WARNING "Skipping build of the OpenShadingLanguage unit tests (Imath missing)")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Could NOT find OpenImageIO. Skipping build of the OSL unit tests.")
|
||||
message(WARNING "Skipping build of the OpenShadingLanguage unit tests (OpenImageIO missing)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
# Restore CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE values.
|
||||
set(CMAKE_FIND_FRAMEWORK ${_PREVIOUS_CMAKE_FIND_FRAMEWORK})
|
||||
set(CMAKE_FIND_APPBUNDLE ${_PREVIOUS_CMAKE_FIND_APPBUNDLE})
|
||||
endif()
|
||||
|
||||
@@ -1,30 +1,41 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install Imath
|
||||
# Locate Imath
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# Imath_FOUND - If FALSE, do not try to link to ilmbase
|
||||
# Imath_LIBRARY - Imath library to link to
|
||||
# Imath_INCLUDE_DIR - Where to find ImathConfig.h
|
||||
# Imath_VERSION - The version of the library
|
||||
# Imath_FOUND - Indicate whether the library was found or not
|
||||
# Imath_LIBRARY - Path to the library file
|
||||
# Imath_INCLUDE_DIR - Location of the header files
|
||||
# Imath_VERSION - Library's version
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# Imath::Imath - IMPORTED target, if found
|
||||
# Global targets defined by this module:
|
||||
# Imath::Imath
|
||||
#
|
||||
# By default, the dynamic libraries of Imath will be found. To find the
|
||||
# static ones instead, you must set the Imath_STATIC_LIBRARY variable to
|
||||
# TRUE before calling find_package(Imath ...).
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
# In this case, you may set Imath_STATIC_LIBRARY to ON to request use of the static one.
|
||||
# If only the static library is present (such as when OCIO builds the dependency), then the option
|
||||
# is not needed.
|
||||
#
|
||||
# If Imath is not installed in a standard path, you can use the
|
||||
# Imath_ROOT variable to tell CMake where to find it. If it is not found
|
||||
# and OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, Imath will be
|
||||
# downloaded, built, and statically-linked into libOpenColorIO at build time.
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -DImath_DIR to point to the directory containing the CMake configuration file for the package.
|
||||
# -- Set -DImath_ROOT to point to the directory containing the lib and include directories.
|
||||
# -- Set -DImath_LIBRARY and -DImath_INCLUDE_DIR to point to the lib and include directories.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
# BUILD_TYPE_DEBUG variable is currently set in one of the OCIO's CMake files.
|
||||
# Now that some OCIO's find module are installed with the library itself (with static build),
|
||||
# a consumer app don't have access to the variables set by an OCIO's CMake files. Therefore, some
|
||||
# OCIO's find modules must detect the build type by itselves.
|
||||
set(BUILD_TYPE_DEBUG OFF)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
|
||||
set(BUILD_TYPE_DEBUG ON)
|
||||
endif()
|
||||
|
||||
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
set(_Imath_REQUIRED_VARS Imath_LIBRARY)
|
||||
set(_Imath_LIB_VER "${Imath_FIND_VERSION_MAJOR}_${Imath_FIND_VERSION_MINOR}")
|
||||
@@ -122,122 +133,12 @@ endif()
|
||||
###############################################################################
|
||||
### Create target
|
||||
|
||||
if (NOT TARGET Imath::Imath)
|
||||
if (Imath_FOUND AND NOT TARGET Imath::Imath)
|
||||
add_library(Imath::Imath UNKNOWN IMPORTED GLOBAL)
|
||||
add_library(Imath::ImathConfig INTERFACE IMPORTED GLOBAL)
|
||||
set(_Imath_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT Imath_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(Imath_FOUND TRUE)
|
||||
if(_Imath_ExternalProject_VERSION)
|
||||
set(Imath_VERSION ${_Imath_ExternalProject_VERSION})
|
||||
else()
|
||||
set(Imath_VERSION ${Imath_FIND_VERSION})
|
||||
endif()
|
||||
set(Imath_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Set the expected library name
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
set(_Imath_LIB_SUFFIX "_d")
|
||||
endif()
|
||||
|
||||
include(VersionUtils)
|
||||
split_version_string(${Imath_VERSION} _Imath_ExternalProject)
|
||||
|
||||
set(_Imath_LIB_VER "${_Imath_ExternalProject_VERSION_MAJOR}_${_Imath_ExternalProject_VERSION_MINOR}")
|
||||
|
||||
set(Imath_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}Imath-${_Imath_LIB_VER}${_Imath_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_Imath_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(Imath_CXX_FLAGS "${Imath_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
string(STRIP "${Imath_CXX_FLAGS}" Imath_CXX_FLAGS)
|
||||
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_FLAGS=${Imath_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DPYTHON=OFF
|
||||
-DDOCS=OFF
|
||||
-DIMATH_HALF_USE_LOOKUP_TABLE=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${Imath_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(imath_install
|
||||
GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/Imath.git"
|
||||
GIT_TAG "v${Imath_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/Imath"
|
||||
BUILD_BYPRODUCTS ${Imath_LIBRARY}
|
||||
CMAKE_ARGS ${Imath_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(Imath::Imath imath_install)
|
||||
|
||||
message(STATUS "Installing Imath: ${Imath_LIBRARY} (version \"${Imath_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
@@ -253,4 +154,4 @@ if(_Imath_TARGET_CREATE)
|
||||
)
|
||||
|
||||
mark_as_advanced(Imath_INCLUDE_DIR Imath_LIBRARY Imath_VERSION)
|
||||
endif()
|
||||
endif()
|
||||
@@ -89,8 +89,8 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS( "Nuke" DEFAULT_MSG
|
||||
SET( Nuke_API_VERSION "" )
|
||||
IF( NUKE_FOUND )
|
||||
TRY_RUN(NUKE_VERSION_EXITCODE NUKE_VERSION_COMPILED
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/share/cmake/modules/src/TestForDDImageVersion.cxx
|
||||
${PROJECT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/share/cmake/modules/src/TestForDDImageVersion.cxx
|
||||
COMPILE_DEFINITIONS
|
||||
"-I${Nuke_INCLUDE_DIR}"
|
||||
RUN_OUTPUT_VARIABLE
|
||||
|
||||
+45
-58
@@ -1,51 +1,54 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install OpenShadingLanguage (OSL)
|
||||
# Locate OpenShadingLanguage (OSL)
|
||||
#
|
||||
# If the library is not installed in a standard path, you can use the OSL_ROOT
|
||||
# variable to tell CMake where to find it.
|
||||
# Variables defined by this module:
|
||||
# OSL_FOUND - Indicate whether the library was found or not
|
||||
# OSL_LIB_DIR - Location of the libary files
|
||||
# OSL_INCLUDE_DIR - Location of the header files
|
||||
# OSL_VERSION - Library's version
|
||||
# OSL_SHADERS_INCLUDE_DIR - Location of the shader's header files
|
||||
# OSL_SHADERS_DIR - Used for OSL unit tests
|
||||
#
|
||||
# These variables are set only when OSL_ROOT is provided:
|
||||
# oslcomp_LIBRARY - Path to the library file
|
||||
# oslexec_LIBRARY - Path to the library file
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# osl::osl
|
||||
#
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
#
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -DOpenShadingLanguage_DIR to point to the directory containing the CMake configuration file for the package.
|
||||
# -- Set -DOpenShadingLanguage_ROOT to point to the directory containing the lib and include directories.
|
||||
#
|
||||
|
||||
|
||||
if(NOT TARGET osl::osl)
|
||||
add_library(osl::osl INTERFACE IMPORTED GLOBAL)
|
||||
set(OSL_FOUND OFF)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
if(NOT DEFINED OSL_ROOT)
|
||||
|
||||
find_package(OSL ${OpenShadingLanguage_FIND_VERSION} CONFIG)
|
||||
|
||||
set(OpenShadingLanguage_VERSION ${OSL_VERSION})
|
||||
|
||||
# TODO: No variable to have the share directory?
|
||||
find_package(OSL ${OSL_FIND_VERSION} CONFIG QUIET)
|
||||
|
||||
set(OSL_SHADERS_INCLUDE_DIR ${OSL_INCLUDE_DIR}/../share)
|
||||
|
||||
# Variable used by the OSL unit tests.
|
||||
set(OSL_SHADERS_DIR ${OSL_SHADERS_INCLUDE_DIR}/OSL/shaders)
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (OpenShadingLanguage
|
||||
FOUND_VAR OpenShadingLanguage_FOUND
|
||||
REQUIRED_VARS OSL_INCLUDE_DIR OSL_LIB_DIR OpenShadingLanguage_VERSION
|
||||
VERSION_VAR OpenShadingLanguage_VERSION
|
||||
find_package_handle_standard_args (OSL
|
||||
REQUIRED_VARS
|
||||
OSL_INCLUDE_DIR
|
||||
OSL_LIB_DIR
|
||||
VERSION_VAR
|
||||
OSL_VERSION
|
||||
)
|
||||
|
||||
set(OSL_FOUND ${OpenShadingLanguage_FOUND})
|
||||
|
||||
else()
|
||||
|
||||
set(OSL_INCLUDE_DIR ${OSL_ROOT}/include)
|
||||
|
||||
set(OSL_VERSION_HEADER "${OSL_INCLUDE_DIR}/OSL/oslversion.h")
|
||||
|
||||
if(EXISTS "${OSL_VERSION_HEADER}")
|
||||
|
||||
# Try to figure out version number
|
||||
file (STRINGS "${OSL_VERSION_HEADER}" TMP REGEX "^#define OSL_LIBRARY_VERSION_MAJOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OSL_VERSION_MAJOR ${TMP})
|
||||
@@ -54,12 +57,14 @@ else()
|
||||
file (STRINGS "${OSL_VERSION_HEADER}" TMP REGEX "^#define OSL_LIBRARY_VERSION_PATCH .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OSL_VERSION_PATCH ${TMP})
|
||||
file (STRINGS "${OSL_VERSION_HEADER}" TMP REGEX "^#define OSL_LIBRARY_VERSION_TWEAK .*$")
|
||||
|
||||
if (TMP)
|
||||
string (REGEX MATCHALL "[0-9]+" OSL_VERSION_TWEAK ${TMP})
|
||||
else ()
|
||||
set (OSL_VERSION_TWEAK 0)
|
||||
endif ()
|
||||
set (OpenShadingLanguage_VERSION "${OSL_VERSION_MAJOR}.${OSL_VERSION_MINOR}.${OSL_VERSION_PATCH}.${OSL_VERSION_TWEAK}")
|
||||
|
||||
set (OSL_VERSION "${OSL_VERSION_MAJOR}.${OSL_VERSION_MINOR}.${OSL_VERSION_PATCH}.${OSL_VERSION_TWEAK}")
|
||||
|
||||
# Find the oslcomp library.
|
||||
find_library(oslcomp_LIBRARY
|
||||
@@ -92,58 +97,41 @@ else()
|
||||
)
|
||||
|
||||
set(OSL_SHADERS_INCLUDE_DIR ${OSL_ROOT}/share)
|
||||
|
||||
# Variable used by the OSL unit tests.
|
||||
set(OSL_SHADERS_DIR ${OSL_SHADERS_INCLUDE_DIR}/OSL/shaders)
|
||||
|
||||
if(EXISTS "${OSL_SHADERS_DIR}")
|
||||
|
||||
# Variable used by the OSL unit tests.
|
||||
set(OSL_FOUND ON)
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (OpenShadingLanguage
|
||||
FOUND_VAR OpenShadingLanguage_FOUND
|
||||
REQUIRED_VARS OSL_INCLUDE_DIR oslcomp_LIBRARY oslexec_LIBRARY OpenShadingLanguage_VERSION
|
||||
VERSION_VAR OpenShadingLanguage_VERSION
|
||||
find_package_handle_standard_args (OSL
|
||||
REQUIRED_VARS
|
||||
OSL_INCLUDE_DIR
|
||||
OSL_SHADERS_DIR
|
||||
oslcomp_LIBRARY
|
||||
oslexec_LIBRARY
|
||||
VERSION_VAR
|
||||
OSL_VERSION
|
||||
)
|
||||
|
||||
set(OSL_FOUND ${OpenShadingLanguage_FOUND})
|
||||
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Check the C++ version ###
|
||||
### Create target
|
||||
|
||||
# TODO: Which version starts to impose C++14?
|
||||
|
||||
if(${CMAKE_CXX_STANDARD} LESS_EQUAL 11)
|
||||
set(OSL_FOUND OFF)
|
||||
message(WARNING "Need C++14 or higher to compile OpenShadingLanguage. Skipping build of the OSL unit tests")
|
||||
if(NOT TARGET osl::osl)
|
||||
add_library(osl::osl INTERFACE IMPORTED GLOBAL)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(OSL_FOUND)
|
||||
|
||||
if (NOT OSL_FIND_QUIETLY)
|
||||
message(STATUS "OpenShadingLanguage includes = ${OSL_INCLUDE_DIR}")
|
||||
message(STATUS "OpenShadingLanguage shaders = ${OSL_SHADERS_DIR}")
|
||||
message(STATUS "OpenShadingLanguage library dir = ${OSL_LIB_DIR}")
|
||||
endif ()
|
||||
|
||||
list(APPEND LIB_INCLUDE_DIRS ${OSL_INCLUDE_DIR})
|
||||
list(APPEND LIB_INCLUDE_DIRS ${OSL_SHADERS_INCLUDE_DIR})
|
||||
|
||||
target_include_directories(osl::osl INTERFACE "${LIB_INCLUDE_DIRS}")
|
||||
target_link_libraries(osl::osl INTERFACE OSL::oslcomp OSL::oslexec)
|
||||
|
||||
if (${OpenShadingLanguage_VERSION} VERSION_GREATER_EQUAL "1.12" AND ${CMAKE_CXX_STANDARD} LESS_EQUAL 11)
|
||||
# C++14 is required for OSL 1.12+
|
||||
if (${OSL_VERSION} VERSION_GREATER_EQUAL "1.12" AND ${CMAKE_CXX_STANDARD} LESS_EQUAL 11)
|
||||
set(OSL_FOUND OFF)
|
||||
message(WARNING "Need C++14 or higher to compile OpenShadingLanguage. Skipping build the OSL unit tests")
|
||||
endif()
|
||||
@@ -152,5 +140,4 @@ if(OSL_FOUND)
|
||||
oslcomp_LIBRARY oslcomp_FOUND
|
||||
oslexec_LIBRARY oslexec_FOUND
|
||||
)
|
||||
|
||||
endif()
|
||||
@@ -1,174 +0,0 @@
|
||||
###########################################################################
|
||||
# OpenImageIO https://www.openimageio.org
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
#
|
||||
# For an up-to-date version of this file, see:
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/src/cmake/Modules/FindOpenImageIO.cmake
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# CMake module to find OpenImageIO
|
||||
#
|
||||
# This module will set
|
||||
# OpenImageIO_FOUND True, if found
|
||||
# OPENIMAGEIO_INCLUDES directory where headers are found
|
||||
# OPENIMAGEIO_LIBRARIES libraries for OIIO
|
||||
# OPENIMAGEIO_LIBRARY_DIRS library dirs for OIIO
|
||||
# OPENIMAGEIO_VERSION Version ("major.minor.patch.tweak")
|
||||
# OPENIMAGEIO_VERSION_MAJOR Version major number
|
||||
# OPENIMAGEIO_VERSION_MINOR Version minor number
|
||||
# OPENIMAGEIO_VERSION_PATCH Version minor patch
|
||||
# OPENIMAGEIO_VERSION_TWEAK Version minor tweak
|
||||
#
|
||||
# Imported targets:
|
||||
# OpenImageIO::OpenImageIO The libOpenImageIO library.
|
||||
# OpenImageIO::oiiotool The oiiotool executable.
|
||||
#
|
||||
# Special inputs:
|
||||
# OpenImageIO_ROOT - if using CMake >= 3.12, will automatically search
|
||||
# this area for OIIO components.
|
||||
# OPENIMAGEIO_ROOT_DIR - custom "prefix" location of OIIO installation
|
||||
# (expecting bin, lib, include subdirectories)
|
||||
# This is deprecated, but will work for a while.
|
||||
# OpenImageIO_FIND_QUIETLY - if set, print minimal console output
|
||||
# OIIO_LIBNAME_SUFFIX - if set, optional nonstandard library suffix
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# NOTE: This file is deprecated.
|
||||
#
|
||||
# In OIIO 2.1+, we generate OpenImageIOConfig.cmake files that are now the
|
||||
# preferred way for downstream projecs to find an installed OIIO. There
|
||||
# should be no need to copy this FindOpenImageIO.cmake file into downstream
|
||||
# projects, *unless* they need to work with a range of OIIO vesions that
|
||||
# may include <2.1, which would lack the generated config files.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
|
||||
# If 'OPENIMAGE_HOME' not set, use the env variable of that name if available
|
||||
if (NOT OPENIMAGEIO_ROOT_DIR AND NOT $ENV{OPENIMAGEIO_ROOT_DIR} STREQUAL "")
|
||||
set (OPENIMAGEIO_ROOT_DIR $ENV{OPENIMAGEIO_ROOT_DIR})
|
||||
endif ()
|
||||
|
||||
find_library (OPENIMAGEIO_LIBRARY
|
||||
NAMES
|
||||
OpenImageIO${OIIO_LIBNAME_SUFFIX}
|
||||
HINTS
|
||||
${OPENIMAGEIO_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
lib64
|
||||
lib
|
||||
OpenImageIO/lib
|
||||
)
|
||||
find_library (OPENIMAGEIO_UTIL_LIBRARY
|
||||
NAMES
|
||||
OpenImageIO_Util${OIIO_LIBNAME_SUFFIX}
|
||||
HINTS
|
||||
${OPENIMAGEIO_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
lib64
|
||||
lib
|
||||
OpenImageIO/lib
|
||||
)
|
||||
find_path (OPENIMAGEIO_INCLUDE_DIR
|
||||
NAMES
|
||||
OpenImageIO/imageio.h
|
||||
HINTS
|
||||
${OPENIMAGEIO_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
OpenImageIO/include
|
||||
)
|
||||
find_program (OIIOTOOL_BIN
|
||||
NAMES
|
||||
oiiotool
|
||||
HINTS
|
||||
${OPENIMAGEIO_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
OpenImageIO/bin
|
||||
)
|
||||
|
||||
# Try to figure out version number
|
||||
set (OIIO_VERSION_HEADER "${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h")
|
||||
if (EXISTS "${OIIO_VERSION_HEADER}")
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_MAJOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_MAJOR ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_MINOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_MINOR ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_PATCH .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_PATCH ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_TWEAK .*$")
|
||||
if (TMP)
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_TWEAK ${TMP})
|
||||
else ()
|
||||
set (OPENIMAGEIO_VERSION_TWEAK 0)
|
||||
endif ()
|
||||
set (OPENIMAGEIO_VERSION "${OPENIMAGEIO_VERSION_MAJOR}.${OPENIMAGEIO_VERSION_MINOR}.${OPENIMAGEIO_VERSION_PATCH}.${OPENIMAGEIO_VERSION_TWEAK}")
|
||||
endif ()
|
||||
|
||||
set (OIIO_IMATH_HEADER "${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/Imath.h")
|
||||
if (EXISTS "${OIIO_IMATH_HEADER}")
|
||||
file (STRINGS "${OIIO_IMATH_HEADER}" TMP REGEX "^#define OIIO_USING_IMATH .*$")
|
||||
string (REGEX MATCHALL "[0-9]" OIIO_IMATH_VERSION ${TMP})
|
||||
if (OIIO_IMATH_VERSION LESS 3)
|
||||
message(STATUS "Skipping OpenImageIO built against OpenEXR 2, please use version 3 or greater.")
|
||||
return ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (
|
||||
OpenImageIO
|
||||
FOUND_VAR
|
||||
OpenImageIO_FOUND
|
||||
REQUIRED_VARS
|
||||
OPENIMAGEIO_INCLUDE_DIR
|
||||
OPENIMAGEIO_LIBRARY
|
||||
OPENIMAGEIO_VERSION
|
||||
VERSION_VAR
|
||||
OPENIMAGEIO_VERSION
|
||||
)
|
||||
|
||||
set (OPENIMAGEIO_FOUND ${OpenImageIO_FOUND}) # Old name
|
||||
|
||||
if (OpenImageIO_FOUND)
|
||||
set (OPENIMAGEIO_INCLUDES ${OPENIMAGEIO_INCLUDE_DIR})
|
||||
set (OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
|
||||
get_filename_component (OPENIMAGEIO_LIBRARY_DIRS "${OPENIMAGEIO_LIBRARY}" DIRECTORY)
|
||||
if (NOT OpenImageIO_FIND_QUIETLY)
|
||||
message ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDE_DIR}" )
|
||||
message ( STATUS "OpenImageIO libraries = ${OPENIMAGEIO_LIBRARIES}" )
|
||||
message ( STATUS "OpenImageIO library_dirs = ${OPENIMAGEIO_LIBRARY_DIRS}" )
|
||||
endif ()
|
||||
|
||||
if (NOT TARGET OpenImageIO::OpenImageIO)
|
||||
add_library(OpenImageIO::OpenImageIO UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenImageIO::OpenImageIO PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENIMAGEIO_INCLUDES}")
|
||||
|
||||
set_property(TARGET OpenImageIO::OpenImageIO APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${OPENIMAGEIO_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
# Starting with OIIO v2.3, some utility classes are now only declared in OpenImageIO_Util
|
||||
# (and not in both libraries like in older versions).
|
||||
if (${OPENIMAGEIO_VERSION} VERSION_GREATER_EQUAL "2.3" AND NOT TARGET OpenImageIO::OpenImageIO_Util)
|
||||
add_library(OpenImageIO::OpenImageIO_Util UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenImageIO::OpenImageIO_Util PROPERTIES
|
||||
IMPORTED_LOCATION "${OPENIMAGEIO_UTIL_LIBRARY}")
|
||||
target_link_libraries(OpenImageIO::OpenImageIO INTERFACE OpenImageIO::OpenImageIO_Util)
|
||||
endif ()
|
||||
|
||||
# Starting with OIIO v2.3, OIIO needs to compile at least in C++14.
|
||||
if (${OPENIMAGEIO_VERSION} VERSION_GREATER_EQUAL "2.3" AND ${CMAKE_CXX_STANDARD} LESS_EQUAL 11)
|
||||
set(OpenImageIO_FOUND OFF)
|
||||
message(WARNING "Need C++14 or higher to compile with OpenImageIO ${OPENIMAGEIO_VERSION}.")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
OPENIMAGEIO_INCLUDE_DIR
|
||||
OPENIMAGEIO_LIBRARY
|
||||
)
|
||||
@@ -4,14 +4,14 @@
|
||||
# Locate Sphinx (Python documentation generator)
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# Sphinx_FOUND
|
||||
# Sphinx_EXECUTABLE (CACHE)
|
||||
# Sphinx_FOUND - Indicate whether the executable was found or not
|
||||
# Sphinx_EXECUTABLE - Path to the executable file
|
||||
#
|
||||
# Usage:
|
||||
# find_package(Sphinx)
|
||||
#
|
||||
# If Sphinx is not installed in a standard path, add it to the Sphinx_ROOT
|
||||
# variable to tell CMake where to find it.
|
||||
# If the executable is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -DSphinx_ROOT to point to the directory containing the executable.
|
||||
# -- Set -DSphinx_EXECUTABLE to point to executable file.
|
||||
#
|
||||
|
||||
find_package(Python QUIET COMPONENTS Interpreter)
|
||||
|
||||
@@ -1,30 +1,41 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install expat
|
||||
# Locate expat
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# expat_FOUND - If FALSE, do not try to link to expat
|
||||
# expat_LIBRARY - expat library to link to
|
||||
# expat_INCLUDE_DIR - Where to find expat.h
|
||||
# expat_VERSION - The version of the library
|
||||
# expat_FOUND - Indicate whether the library was found or not
|
||||
# expat_LIBRARY - Path to the library file
|
||||
# expat_INCLUDE_DIR - Location of the header files
|
||||
# expat_VERSION - Library's version
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# expat::expat - IMPORTED target, if found
|
||||
# Global targets defined by this module:
|
||||
# expat::expat
|
||||
#
|
||||
# By default, the dynamic libraries of expat will be found. To find the static
|
||||
# ones instead, you must set the expat_STATIC_LIBRARY variable to TRUE
|
||||
# before calling find_package(expat ...).
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
# In this case, you may set expat_STATIC_LIBRARY to ON to request use of the static one.
|
||||
# If only the static library is present (such as when OCIO builds the dependency), then the option
|
||||
# is not needed.
|
||||
#
|
||||
# If expat is not installed in a standard path, you can use the expat_ROOT
|
||||
# variable to tell CMake where to find it. If it is not found and
|
||||
# OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, expat will be downloaded,
|
||||
# built, and statically-linked into libOpenColorIO at build time.
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -Dexpat_DIR to point to the directory containing the CMake configuration file for the package.
|
||||
# -- Set -Dexpat_ROOT to point to the directory containing the lib and include directories.
|
||||
# -- Set -Dexpat_LIBRARY and -Dexpat_INCLUDE_DIR to point to the lib and include directories.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
# BUILD_TYPE_DEBUG variable is currently set in one of the OCIO's CMake files.
|
||||
# Now that some OCIO's find module are installed with the library itself (with static build),
|
||||
# a consumer app don't have access to the variables set by an OCIO's CMake files. Therefore, some
|
||||
# OCIO's find modules must detect the build type by itselves.
|
||||
set(BUILD_TYPE_DEBUG OFF)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
|
||||
set(BUILD_TYPE_DEBUG ON)
|
||||
endif()
|
||||
|
||||
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
set(_expat_REQUIRED_VARS expat_LIBRARY)
|
||||
|
||||
@@ -87,21 +98,57 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
expat/include
|
||||
)
|
||||
|
||||
# Expat uses prefix "lib" on all platform by default.
|
||||
# Library name doesn't change in debug.
|
||||
|
||||
# For Windows, see https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/win32/README.txt.
|
||||
# libexpat<postfix=[w][d][MD|MT]>.lib
|
||||
# The "w" indicates the UTF-16 version of the library.
|
||||
|
||||
# Lib names to search for
|
||||
set(_expat_LIB_NAMES expat libexpat)
|
||||
set(_expat_LIB_NAMES libexpat expat)
|
||||
|
||||
if(WIN32 AND BUILD_TYPE_DEBUG)
|
||||
# Prefer Debug lib names (Windows only)
|
||||
list(INSERT _expat_LIB_NAMES 0 expatd)
|
||||
# Prefer Debug lib names. The library name changes only on Windows.
|
||||
list(INSERT _expat_LIB_NAMES 0 libexpatd libexpatwd expatd expatwd)
|
||||
elseif(WIN32)
|
||||
# libexpat(w).dll/.lib
|
||||
list(APPEND _expat_LIB_NAMES libexpatw expatw)
|
||||
endif()
|
||||
|
||||
if(expat_STATIC_LIBRARY)
|
||||
# Looking for both "lib" prefix and CMAKE_STATIC_LIBRARY_PREFIX.
|
||||
# Prefer static lib names
|
||||
set(_expat_STATIC_LIB_NAMES
|
||||
set(_expat_STATIC_LIB_NAMES
|
||||
"libexpat${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expat${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(WIN32 AND BUILD_TYPE_DEBUG)
|
||||
# Prefer static Debug lib names (Windows only)
|
||||
# Prefer static Debug lib names. The library name changes only on Windows.
|
||||
list(INSERT _expat_STATIC_LIB_NAMES 0
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatd${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
"libexpatdMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatdMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatd${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatwdMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatwdMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatwd${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatdMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatdMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatd${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatwdMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatwdMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatwd${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
elseif (WIN32)
|
||||
list(INSERT _expat_STATIC_LIB_NAMES 0
|
||||
"libexpatMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatwMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libexpatwMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatwMD${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}expatwMT${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -154,126 +201,11 @@ endif()
|
||||
###############################################################################
|
||||
### Create target
|
||||
|
||||
if(NOT TARGET expat::expat)
|
||||
if(expat_FOUND AND NOT TARGET expat::expat)
|
||||
add_library(expat::expat UNKNOWN IMPORTED GLOBAL)
|
||||
set(_expat_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT expat_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(expat_FOUND TRUE)
|
||||
set(expat_VERSION ${expat_FIND_VERSION})
|
||||
set(expat_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Set the expected library name
|
||||
if(WIN32)
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
set(_expat_LIB_SUFFIX "d")
|
||||
endif()
|
||||
# Static Linking, Multi-threaded Dll naming (>=2.2.8):
|
||||
# https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/win32/README.txt
|
||||
set(_expat_LIB_SUFFIX "${_expat_LIB_SUFFIX}MD")
|
||||
endif()
|
||||
|
||||
# Expat use a hardcoded lib prefix instead of CMAKE_STATIC_LIBRARY_PREFIX
|
||||
# https://github.com/libexpat/libexpat/blob/R_2_4_1/expat/CMakeLists.txt#L374
|
||||
set(_expat_LIB_PREFIX "lib")
|
||||
|
||||
set(expat_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${_expat_LIB_PREFIX}expat${_expat_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_expat_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(EXPAT_C_FLAGS "${EXPAT_C_FLAGS} /EHsc")
|
||||
set(EXPAT_CXX_FLAGS "${EXPAT_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
string(STRIP "${EXPAT_C_FLAGS}" EXPAT_C_FLAGS)
|
||||
string(STRIP "${EXPAT_CXX_FLAGS}" EXPAT_CXX_FLAGS)
|
||||
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS}
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW
|
||||
-DCMAKE_C_VISIBILITY_PRESET=${CMAKE_C_VISIBILITY_PRESET}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_C_FLAGS=${EXPAT_C_FLAGS}
|
||||
-DCMAKE_CXX_FLAGS=${EXPAT_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DEXPAT_BUILD_DOCS=OFF
|
||||
-DEXPAT_BUILD_EXAMPLES=OFF
|
||||
-DEXPAT_BUILD_TESTS=OFF
|
||||
-DEXPAT_BUILD_TOOLS=OFF
|
||||
-DEXPAT_SHARED_LIBS=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${expat_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(expat_install
|
||||
GIT_REPOSITORY "https://github.com/libexpat/libexpat.git"
|
||||
GIT_TAG "R_${expat_FIND_VERSION_MAJOR}_${expat_FIND_VERSION_MINOR}_${expat_FIND_VERSION_PATCH}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/libexpat"
|
||||
BUILD_BYPRODUCTS ${expat_LIBRARY}
|
||||
SOURCE_SUBDIR expat
|
||||
CMAKE_ARGS ${EXPAT_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(expat::expat expat_install)
|
||||
message(STATUS "Installing expat: ${expat_LIBRARY} (version \"${expat_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
@@ -284,4 +216,4 @@ if(_expat_TARGET_CREATE)
|
||||
)
|
||||
|
||||
mark_as_advanced(expat_INCLUDE_DIR expat_LIBRARY expat_VERSION)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install lcms2
|
||||
# Locate lcms2
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# lcms2_FOUND - If FALSE, do not try to link to lcms
|
||||
@@ -9,24 +9,20 @@
|
||||
# lcms2_INCLUDE_DIR - Where to find lcms2.h
|
||||
# lcms2_VERSION - The version of the library
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# Global targets defined by this module:
|
||||
# lcms2::lcms2 - IMPORTED target, if found
|
||||
#
|
||||
# By default, the dynamic libraries of lcms2 will be found. To find the static
|
||||
# ones instead, you must set the lcms2_STATIC_LIBRARY variable to TRUE
|
||||
# before calling find_package(lcms2 ...).
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
# In this case, you may set lcms2_STATIC_LIBRARY to ON to request use of the static one.
|
||||
# If only the static library is present (such as when OCIO builds the dependency), then the option
|
||||
# is not needed.
|
||||
#
|
||||
# If lcms2 is not installed in a standard path, you can use the lcms2_ROOT
|
||||
# variable to tell CMake where to find it. If it is not found and
|
||||
# OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, lcms2 will be
|
||||
# downloaded, built, and statically-linked into libOpenColorIO at build time.
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -Dlcms2_ROOT to point to the directory containing the lib and include directories.
|
||||
# -- Set -Dlcms2_LIBRARY and -Dlcms2_INCLUDE_DIR to point to the lib and include directories.
|
||||
#
|
||||
|
||||
if(NOT TARGET lcms2::lcms2)
|
||||
add_library(lcms2::lcms2 UNKNOWN IMPORTED GLOBAL)
|
||||
set(_lcms2_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
@@ -95,104 +91,11 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
### Configure target ###
|
||||
|
||||
if(NOT lcms2_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(lcms2_FOUND TRUE)
|
||||
set(lcms2_VERSION ${lcms2_FIND_VERSION})
|
||||
set(lcms2_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/lcms2")
|
||||
set(lcms2_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lcms2${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_lcms2_TARGET_CREATE)
|
||||
if(UNIX)
|
||||
set(lcms2_C_FLAGS "${lcms2_C_FLAGS} -fvisibility=hidden -fPIC")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||
set(lcms2_C_FLAGS "${lcms2_C_FLAGS} -Wno-aggressive-loop-optimizations")
|
||||
endif()
|
||||
|
||||
string(STRIP "${lcms2_C_FLAGS}" lcms2_C_FLAGS)
|
||||
|
||||
# NOTE: Depending of the compiler version lcm2 2.2 does not compile with C++17 so revert
|
||||
# to C++11 because the library is only used by a cmd line tool.
|
||||
|
||||
set(lcms2_CXX_STANDARD ${CMAKE_CXX_STANDARD})
|
||||
if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 17)
|
||||
set(lcms2_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS}
|
||||
-DCMAKE_C_FLAGS=${lcms2_C_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${lcms2_CXX_STANDARD}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${lcms2_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(lcms2_install
|
||||
GIT_REPOSITORY "https://github.com/mm2/Little-CMS.git"
|
||||
GIT_TAG "lcms${lcms2_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/Little-CMS"
|
||||
BUILD_BYPRODUCTS ${lcms2_LIBRARY}
|
||||
CMAKE_ARGS ${lcms2_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
PATCH_COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
"${CMAKE_SOURCE_DIR}/share/cmake/projects/Buildlcms2.cmake"
|
||||
"CMakeLists.txt"
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(lcms2::lcms2 lcms2_install)
|
||||
message(STATUS "Installing lcms2: ${lcms2_LIBRARY} (version \"${lcms2_VERSION}\")")
|
||||
endif()
|
||||
if(lcms2_FOUND AND NOT TARGET lcms2::lcms2)
|
||||
add_library(lcms2::lcms2 UNKNOWN IMPORTED GLOBAL)
|
||||
set(_lcms2_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,30 +1,104 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install minizip-ng
|
||||
# Locate minizip-ng
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# minizip-ng_FOUND - If FALSE, do not try to link to minizip-ng
|
||||
# minizip-ng_LIBRARY - minizip-ng library to link to
|
||||
# minizip-ng_INCLUDE_DIR - Where to find mz.h and other headers
|
||||
# minizip-ng_VERSION - The version of the library
|
||||
# minizip-ng_COMPAT - Whether minizip-ng MZ_COMPAT was used or not
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# minizip-ng::minizip-ng - IMPORTED target, if found
|
||||
# Global targets defined by this module:
|
||||
# MINIZIP::minizip-ng - IMPORTED target, if found
|
||||
#
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
# In this case, you may set minizip-ng_STATIC_LIBRARY to ON to request use of the static one.
|
||||
# If only the static library is present (such as when OCIO builds the dependency), then the option
|
||||
# is not needed.
|
||||
#
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -Dminizip-ng_DIR to point to the directory containing the CMake configuration file for the package.
|
||||
# -- Set -Dminizip-ng_ROOT to point to the directory containing the lib and include directories.
|
||||
# -- Set -Dminizip-ng_LIBRARY and -Dminizip-ng_INCLUDE_DIR to point to the lib and include directories.
|
||||
#
|
||||
#
|
||||
# For external builds of minizip-ng, please note that the same build options should be used.
|
||||
# Using more options, such as enabling other compression methods, will provoke linking issue
|
||||
# since OCIO is not linking to those libraries.
|
||||
#
|
||||
# e.g. Setting MZ_BZIP2=ON will cause linking issue since OCIO will not be linked against BZIP2.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
# BUILD_TYPE_DEBUG variable is currently set in one of the OCIO's CMake files.
|
||||
# Now that some OCIO's find module are installed with the library itself (with static build),
|
||||
# a consumer app don't have access to the variables set by an OCIO's CMake files. Therefore, some
|
||||
# OCIO's find modules must detect the build type by itselves.
|
||||
set(BUILD_TYPE_DEBUG OFF)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
|
||||
set(BUILD_TYPE_DEBUG ON)
|
||||
endif()
|
||||
|
||||
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
if(NOT DEFINED minizip-ng_ROOT)
|
||||
# Search for minizip-ng-config.cmake
|
||||
find_package(minizip-ng ${minizip-ng_FIND_VERSION} CONFIG)
|
||||
find_package(minizip-ng ${minizip-ng_FIND_VERSION} CONFIG QUIET)
|
||||
endif()
|
||||
|
||||
|
||||
if (minizip-ng_FOUND)
|
||||
get_target_property(minizip-ng_LIBRARY MINIZIP::minizip-ng LOCATION)
|
||||
get_target_property(minizip-ng_INCLUDE_DIR MINIZIP::minizip-ng INTERFACE_INCLUDE_DIRECTORIES)
|
||||
else ()
|
||||
get_target_property(minizip-ng_LIBRARY MINIZIP::minizip-ng LOCATION)
|
||||
|
||||
# Depending on the options used when minizip-ng was built, it could have multiple libraries
|
||||
# listed in INTERFACE_LINK_LIBRARIES. OCIO only needs ZLIB.
|
||||
# Only add custom zlib target ZLIB::ZLIB to INTERFACE_LINK_LIBRARIES.
|
||||
set_target_properties(MINIZIP::minizip-ng PROPERTIES INTERFACE_LINK_LIBRARIES "ZLIB::ZLIB")
|
||||
|
||||
if (NOT minizip-ng_LIBRARY)
|
||||
# Lib names to search for
|
||||
set(_minizip-ng_LIB_NAMES minizip-ng)
|
||||
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
# Prefer Debug lib names (Windows only)
|
||||
list(INSERT _minizip-ng_LIB_NAMES 0 minizip-ngd)
|
||||
endif()
|
||||
|
||||
if(minizip-ng_STATIC_LIBRARY)
|
||||
# Prefer static lib names
|
||||
set(_minizip-ng_STATIC_LIB_NAMES
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}minizip-ng${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(WIN32 AND BUILD_TYPE_DEBUG)
|
||||
# Prefer static Debug lib names (Windows only)
|
||||
list(INSERT _minizip-ng_STATIC_LIB_NAMES 0
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}minizip-ngd${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Find library
|
||||
find_library(minizip-ng_LIBRARY
|
||||
NAMES
|
||||
${_minizip-ng_STATIC_LIB_NAMES}
|
||||
${_minizip-ng_LIB_NAMES}
|
||||
HINTS
|
||||
${minizip-ng_ROOT}
|
||||
${PC_minizip-ng_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# Set IMPORTED_LOCATION property for MINIZIP::minizip-ng target.
|
||||
if (TARGET MINIZIP::minizip-ng)
|
||||
set_target_properties(MINIZIP::minizip-ng PROPERTIES
|
||||
IMPORTED_LOCATION "${minizip-ng_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
list(APPEND _minizip-ng_REQUIRED_VARS minizip-ng_INCLUDE_DIR)
|
||||
|
||||
# Search for minizip-ng.pc
|
||||
@@ -40,25 +114,28 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
${PC_minizip-ng_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
include/minizip-ng
|
||||
include/minizip
|
||||
minizip-ng/include
|
||||
minizip/include
|
||||
)
|
||||
|
||||
# Lib names to search for
|
||||
set(_minizip-ng_LIB_NAMES minizip-ng libminizip-ng)
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
# Prefer Debug lib names (Windows only)
|
||||
list(INSERT _minizip-ng_LIB_NAMES 0 minizip-ngd)
|
||||
endif()
|
||||
# Minizip-ng uses prefix "lib" on all platform by default.
|
||||
# Library name doesn't change in debug.
|
||||
|
||||
# Lib names to search for.
|
||||
# Search for "minizip" since the library could be named "minizip" if it was built
|
||||
# with MZ_COMPAT=ON.
|
||||
set(_minizip-ng_LIB_NAMES libminizip-ng minizip-ng libminizip minizip)
|
||||
|
||||
if(minizip-ng_STATIC_LIBRARY)
|
||||
# Prefer static lib names
|
||||
# Looking for both "lib" prefix and CMAKE_STATIC_LIBRARY_PREFIX.
|
||||
# Prefer static lib names.
|
||||
set(_minizip-ng_STATIC_LIB_NAMES
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}minizip-ng${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(WIN32 AND BUILD_TYPE_DEBUG)
|
||||
# Prefer static Debug lib names (Windows only)
|
||||
list(INSERT _minizip-ng_STATIC_LIB_NAMES 0
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}minizip-ngd${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
"libminizip-ng${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}minizip-ng${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"libminizip${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}minizip${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
# Find library
|
||||
@@ -74,7 +151,23 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
)
|
||||
|
||||
# Get version from header or pkg-config
|
||||
set(minizip-ng_VERSION "${minizip-ng_FIND_VERSION}")
|
||||
if(minizip-ng_INCLUDE_DIR)
|
||||
list(GET minizip-ng_INCLUDE_DIR 0 _minizip-ng_INCLUDE_DIR)
|
||||
if(EXISTS "${_minizip-ng_INCLUDE_DIR}/mz.h")
|
||||
set(_minizip-ng_CONFIG "${_minizip-ng_INCLUDE_DIR}/mz.h")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(_minizip-ng_CONFIG)
|
||||
file(STRINGS "${_minizip-ng_CONFIG}" _minizip-ng_VER_SEARCH
|
||||
REGEX "^[ \t]*#define[ \t]+MZ_VERSION[ \t]+\\(\"[.0-9]+\"\\).*$")
|
||||
if(_minizip-ng_VER_SEARCH)
|
||||
string(REGEX REPLACE ".*#define[ \t]+MZ_VERSION[ \t]+\\(\"([.0-9]+)\"\\).*"
|
||||
"\\1" minizip-ng_VERSION "${_minizip-ng_VER_SEARCH}")
|
||||
endif()
|
||||
elseif(PC_minizip-ng_FOUND)
|
||||
set(minizip-ng_VERSION "${PC_minizip-ng_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Override REQUIRED if package can be installed
|
||||
@@ -95,124 +188,33 @@ endif()
|
||||
###############################################################################
|
||||
### Create target
|
||||
|
||||
if(NOT TARGET minizip-ng::minizip-ng)
|
||||
add_library(minizip-ng::minizip-ng UNKNOWN IMPORTED GLOBAL)
|
||||
if(minizip-ng_FOUND AND NOT TARGET MINIZIP::minizip-ng)
|
||||
add_library(MINIZIP::minizip-ng UNKNOWN IMPORTED GLOBAL)
|
||||
set(_minizip-ng_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
if(NOT minizip-ng_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(minizip-ng_FOUND TRUE)
|
||||
set(minizip-ng_VERSION ${minizip-ng_FIND_VERSION})
|
||||
set(minizip-ng_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Minizip-ng use a hardcoded lib prefix instead of CMAKE_STATIC_LIBRARY_PREFIX
|
||||
set(_minizip-ng_LIB_PREFIX "lib")
|
||||
|
||||
set(minizip-ng_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${_minizip-ng_LIB_PREFIX}minizip-ng${_minizip-ng_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_minizip-ng_TARGET_CREATE)
|
||||
set(MINIZIP-NG_CMAKE_ARGS
|
||||
${MINIZIP-NG_CMAKE_ARGS}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}/minizip-ng
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DMZ_OPENSSL=OFF
|
||||
-DMZ_LIBBSD=OFF
|
||||
-DMZ_BUILD_TESTS=OFF
|
||||
-DMZ_COMPAT=OFF
|
||||
-DMZ_BZIP2=OFF
|
||||
-DMZ_LZMA=OFF
|
||||
-DMZ_LIBCOMP=OFF
|
||||
-DMZ_ZSTD=OFF
|
||||
-DMZ_PKCRYPT=OFF
|
||||
-DMZ_WZAES=OFF
|
||||
-DMZ_SIGNING=OFF
|
||||
-DMZ_ZLIB=ON
|
||||
-DMZ_ICONV=OFF
|
||||
-DMZ_FETCH_LIBS=OFF
|
||||
-DMZ_FORCE_FETCH_LIBS=OFF
|
||||
-DZLIB_LIBRARY=${ZLIB_LIBRARIES}
|
||||
-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(minizip-ng_CMAKE_ARGS
|
||||
${minizip-ng_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(minizip-ng_CMAKE_ARGS
|
||||
${minizip-ng_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(minizip-ng_CMAKE_ARGS
|
||||
${minizip-ng_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${minizip-ng_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(minizip-ng_install
|
||||
GIT_REPOSITORY "https://github.com/zlib-ng/minizip-ng.git"
|
||||
GIT_TAG "${minizip-ng_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/libminizip-ng"
|
||||
BUILD_BYPRODUCTS ${minizip-ng_LIBRARY}
|
||||
CMAKE_ARGS ${MINIZIP-NG_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(minizip-ng::minizip-ng minizip-ng_install)
|
||||
message(STATUS "Installing minizip-ng: ${minizip-ng_LIBRARY} (version \"${minizip-ng_VERSION}\")")
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_minizip-ng_TARGET_CREATE)
|
||||
set_target_properties(minizip-ng::minizip-ng PROPERTIES
|
||||
set_target_properties(MINIZIP::minizip-ng PROPERTIES
|
||||
IMPORTED_LOCATION "${minizip-ng_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${minizip-ng_INCLUDE_DIR}"
|
||||
)
|
||||
|
||||
mark_as_advanced(minizip-ng_INCLUDE_DIR minizip-ng_LIBRARY minizip-ng_VERSION)
|
||||
|
||||
target_link_libraries(minizip-ng::minizip-ng INTERFACE ZLIB::ZLIB)
|
||||
endif()
|
||||
target_link_libraries(MINIZIP::minizip-ng INTERFACE ZLIB::ZLIB)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Detect compatibility mode ###
|
||||
|
||||
set(minizip-ng_COMPAT FALSE)
|
||||
if(minizip-ng_INCLUDE_DIR)
|
||||
list(GET minizip-ng_INCLUDE_DIR 0 _minizip-ng_INCLUDE_DIR)
|
||||
if(EXISTS "${_minizip-ng_INCLUDE_DIR}/mz_compat.h")
|
||||
set(minizip-ng_COMPAT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced(minizip-ng_COMPAT)
|
||||
|
||||
@@ -1,26 +1,22 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install openfx
|
||||
# Locate openfx
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# openfx_FOUND - If FALSE, do not try to include openfx
|
||||
# openfx_INCLUDE_DIR - Where to find ofxCore.h
|
||||
# openfx_VERSION - The version of the library
|
||||
# openfx_FOUND - Indicate whether the library was found or not
|
||||
# openfx_INCLUDE_DIR - Location of the header files
|
||||
# openfx_VERSION - Library's version
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# openfx::module - IMPORTED target, if found
|
||||
# Global targets defined by this module:
|
||||
# openfx::module
|
||||
#
|
||||
# If openfx is not installed in a standard path, you can use the
|
||||
# openfx_ROOT variable to tell CMake where to find it. If it is not found
|
||||
# and OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, openfx will be
|
||||
# downloaded at build time.
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
#
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using the following method:
|
||||
# -- Set -Dopenfx_ROOT to point to the directory containing the lib and include directories.
|
||||
#
|
||||
|
||||
if(NOT TARGET openfx::module)
|
||||
add_library(openfx::module INTERFACE IMPORTED GLOBAL)
|
||||
set(_openfx_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
@@ -56,45 +52,11 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
### Create target
|
||||
|
||||
if(NOT openfx_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
set(_openfx_INSTALL_DIR "${_EXT_BUILD_ROOT}/openfx/src/openfx_install")
|
||||
|
||||
# Set find_package standard args
|
||||
set(openfx_FOUND TRUE)
|
||||
set(openfx_VERSION ${openfx_FIND_VERSION})
|
||||
set(openfx_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/openfx")
|
||||
|
||||
if(_openfx_TARGET_CREATE)
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${openfx_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(openfx_install
|
||||
GIT_REPOSITORY "https://github.com/ofxa/openfx.git"
|
||||
GIT_TAG "OFX_Release_${openfx_FIND_VERSION_MAJOR}_${openfx_FIND_VERSION_MINOR}_TAG"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/openfx"
|
||||
BUILD_BYPRODUCTS ${openfx_INCLUDE_DIR}
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory
|
||||
"${_EXT_BUILD_ROOT}/openfx/src/openfx_install/include"
|
||||
"${openfx_INCLUDE_DIR}"
|
||||
INSTALL_COMMAND ""
|
||||
CMAKE_ARGS ${openfx_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
add_dependencies(openfx::module openfx_install)
|
||||
message(STATUS "Installing openfx: ${openfx_INCLUDE_DIR} (version \"${openfx_VERSION}\")")
|
||||
endif()
|
||||
if(openfx_FOUND AND NOT TARGET openfx::module)
|
||||
add_library(openfx::module INTERFACE IMPORTED GLOBAL)
|
||||
set(_openfx_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install pybind11
|
||||
# Locate pybind11
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# pybind11_FOUND - If FALSE, do not try to link to pybind11
|
||||
# pybind11_INCLUDE_DIR - Where to find pybind11.h
|
||||
# pybind11_VERSION - The version of the library
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# pybind11::module - IMPORTED target, if found
|
||||
# Global targets defined by this module:
|
||||
# pybind11::module
|
||||
#
|
||||
# If pybind11 is not installed in a standard path, you can use the
|
||||
# pybind11_ROOT variable to tell CMake where to find it. If it is not found
|
||||
# and OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, pybind11 will be
|
||||
# downloaded at build time.
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
#
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -Dpybind11_DIR to point to the directory containing the CMake configuration file for the package.
|
||||
# -- Set -Dpybind11_ROOT to point to the directory containing the lib and include directories.
|
||||
# -- Set -Dpybind11_LIBRARY and -Dpybind11_INCLUDE_DIR to point to the lib and include directories.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
@@ -126,94 +129,11 @@ endif()
|
||||
###############################################################################
|
||||
### Create target ###
|
||||
|
||||
if(NOT TARGET pybind11::module)
|
||||
if(pybind11_FOUND AND NOT TARGET pybind11::module)
|
||||
add_library(pybind11::module INTERFACE IMPORTED GLOBAL)
|
||||
set(_pybind11_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT pybind11_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(pybind11_FOUND TRUE)
|
||||
set(pybind11_VERSION ${pybind11_FIND_VERSION})
|
||||
set(pybind11_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
if(_pybind11_TARGET_CREATE)
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${pybind11_INCLUDE_DIR})
|
||||
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
# Using FindPython mode (PYBIND11_FINDPYTHON=ON) doesn't seem to
|
||||
# work when building on docker manylinux images where Development
|
||||
# component is not available but is hardcoded in pybind11 script.
|
||||
-DPYTHON_EXECUTABLE=${Python_EXECUTABLE}
|
||||
-DPYBIND11_INSTALL=ON
|
||||
-DPYBIND11_TEST=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(pybind11_install
|
||||
GIT_REPOSITORY "https://github.com/pybind/pybind11.git"
|
||||
GIT_TAG "v${pybind11_FIND_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/pybind11"
|
||||
BUILD_BYPRODUCTS ${pybind11_INCLUDE_DIR}
|
||||
CMAKE_ARGS ${pybind11_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(pybind11::module pybind11_install)
|
||||
message(STATUS "Installing pybind11: ${pybind11_INCLUDE_DIR} (version \"${pybind11_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install pystring
|
||||
# Locate pystring
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# pystring_FOUND - If FALSE, do not try to link to pystring
|
||||
# pystring_LIBRARY - Where to find pystring
|
||||
# pystring_INCLUDE_DIR - Where to find pystring.h
|
||||
# pystring_FOUND - Indicate whether the library was found or not
|
||||
# pystring_LIBRARY - Path to the library file
|
||||
# pystring_INCLUDE_DIR - Location of the header files
|
||||
# pystring_VERSION - Library's version
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# Global targets defined by this module:
|
||||
# pystring::pystring - IMPORTED target, if found
|
||||
#
|
||||
# If pystring is not installed in a standard path, you can use the
|
||||
# pystring_ROOT variable to tell CMake where to find it. If it is not found
|
||||
# and OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, pystring will be
|
||||
# downloaded, built, and statically-linked into libOpenColorIO at build time.
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
#
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -Dpystring_ROOT to point to the directory containing the lib and include directories.
|
||||
# -- Set -Dpystring_LIBRARY and -Dpystring_INCLUDE_DIR to point to the lib and include directories.
|
||||
#
|
||||
|
||||
if(NOT TARGET pystring::pystring)
|
||||
add_library(pystring::pystring UNKNOWN IMPORTED GLOBAL)
|
||||
set(_pystring_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
@@ -29,11 +28,12 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
# Find include directory
|
||||
find_path(pystring_INCLUDE_DIR
|
||||
NAMES
|
||||
pystring/pystring.h
|
||||
pystring.h
|
||||
HINTS
|
||||
${pystring_ROOT}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
include/pystring
|
||||
pystring/include
|
||||
)
|
||||
|
||||
@@ -64,104 +64,11 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
### Configure target ###
|
||||
|
||||
if(NOT pystring_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(pystring_FOUND TRUE)
|
||||
set(pystring_VERSION ${pystring_FIND_VERSION})
|
||||
set(pystring_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
set(pystring_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}pystring${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_pystring_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
string(STRIP "${pystring_CXX_FLAGS}" pystring_CXX_FLAGS)
|
||||
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_FLAGS=${pystring_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if (ANDROID)
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
#TODO: Find a way to merge in the static libs when built with internal pystring
|
||||
message(WARNING
|
||||
"Building STATIC libOpenColorIO using the in-built pystring. "
|
||||
"pystring symbols are NOT included in the output binary!"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${pystring_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(pystring_install
|
||||
GIT_REPOSITORY "https://github.com/imageworks/pystring.git"
|
||||
GIT_TAG "v${pystring_FIND_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/pystring"
|
||||
BUILD_BYPRODUCTS ${pystring_LIBRARY}
|
||||
CMAKE_ARGS ${pystring_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
PATCH_COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
"${CMAKE_SOURCE_DIR}/share/cmake/projects/Buildpystring.cmake"
|
||||
"CMakeLists.txt"
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(pystring::pystring pystring_install)
|
||||
message(STATUS "Installing pystring: ${pystring_LIBRARY} (version \"${pystring_VERSION}\")")
|
||||
endif()
|
||||
if(pystring_FOUND AND NOT TARGET pystring::pystring)
|
||||
add_library(pystring::pystring UNKNOWN IMPORTED GLOBAL)
|
||||
set(_pystring_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
@@ -174,4 +81,4 @@ if(_pystring_TARGET_CREATE)
|
||||
)
|
||||
|
||||
mark_as_advanced(pystring_INCLUDE_DIR pystring_LIBRARY pystring_VERSION)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,40 +1,65 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install yaml-cpp
|
||||
# Locate yaml-cpp
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# yaml-cpp_FOUND - If FALSE, do not try to link to yamlcpp
|
||||
# yaml-cpp_LIBRARY - yaml-cpp library to link to
|
||||
# yaml-cpp_INCLUDE_DIR - Where to find yaml.h
|
||||
# yaml-cpp_VERSION - The version of the library
|
||||
# yaml-cpp_FOUND - Indicate whether the library was found or not
|
||||
# yaml-cpp_LIBRARY - Path to the library file
|
||||
# yaml-cpp_INCLUDE_DIR - Location of the header files
|
||||
# yaml-cpp_VERSION - Library's version
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# yaml-cpp - IMPORTED target, if found
|
||||
# Global targets defined by this module:
|
||||
# yaml-cpp::yaml-cpp
|
||||
#
|
||||
# By default, the dynamic libraries of yaml-cpp will be found. To find the
|
||||
# static ones instead, you must set the yaml-cpp_STATIC_LIBRARY variable to
|
||||
# TRUE before calling find_package(yaml-cpp ...).
|
||||
# For compatibility with the upstream CMake package, the following variables and targets are defined:
|
||||
# YAML_CPP_LIBRARIES - Libraries to link against yaml-cpp
|
||||
# YAML_CPP_INCLUDE_DIR - Include directory
|
||||
#
|
||||
# If yaml-cpp is not installed in a standard path, you can use the
|
||||
# yaml-cpp_ROOT variable to tell CMake where to find it. If it is not found
|
||||
# and OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, yaml-cpp will be
|
||||
# downloaded, built, and statically-linked into libOpenColorIO at build time.
|
||||
# Usually CMake will use the dynamic library rather than static, if both are present.
|
||||
# In this case, you may set yaml-cpp_STATIC_LIBRARY to ON to request use of the static one.
|
||||
# If only the static library is present (such as when OCIO builds the dependency), then the option
|
||||
# is not needed.
|
||||
#
|
||||
# If the library is not installed in a typical location where CMake will find it, you may specify
|
||||
# the location using one of the following methods:
|
||||
# -- Set -Dyaml-cpp_DIR to point to the directory containing the CMake configuration file for the package.
|
||||
# -- Set -Dyaml-cpp_ROOT to point to the directory containing the lib and include directories.
|
||||
# -- Set -Dyaml-cpp_LIBRARY and -Dyaml-cpp_INCLUDE_DIR to point to the lib and include directories.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
# BUILD_TYPE_DEBUG variable is currently set in one of the OCIO's CMake files.
|
||||
# Now that some OCIO's find module are installed with the library itself (with static build),
|
||||
# a consumer app don't have access to the variables set by an OCIO's CMake files. Therefore, some
|
||||
# OCIO's find modules must detect the build type by itselves.
|
||||
set(BUILD_TYPE_DEBUG OFF)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
|
||||
set(BUILD_TYPE_DEBUG ON)
|
||||
endif()
|
||||
|
||||
if(yaml-cpp_FIND_QUIETLY)
|
||||
set(quiet QUIET)
|
||||
endif()
|
||||
|
||||
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
set(_yaml-cpp_REQUIRED_VARS yaml-cpp_LIBRARY)
|
||||
|
||||
# Search for yaml-cpp-config.cmake
|
||||
if(NOT DEFINED yaml-cpp_ROOT)
|
||||
# Search for yaml-cpp-config.cmake
|
||||
find_package(yaml-cpp ${yaml-cpp_FIND_VERSION} CONFIG QUIET)
|
||||
find_package(yaml-cpp ${yaml-cpp_FIND_VERSION} CONFIG ${quiet})
|
||||
endif()
|
||||
|
||||
if(yaml-cpp_FOUND)
|
||||
get_target_property(yaml-cpp_LIBRARY yaml-cpp LOCATION)
|
||||
# Alias target for yaml-cpp < 0.8 compatibility
|
||||
if(TARGET yaml-cpp AND NOT TARGET yaml-cpp::yaml-cpp)
|
||||
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
|
||||
endif()
|
||||
|
||||
get_target_property(yaml-cpp_INCLUDE_DIR yaml-cpp::yaml-cpp INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(yaml-cpp_LIBRARY yaml-cpp::yaml-cpp LOCATION)
|
||||
else()
|
||||
|
||||
# As yaml-cpp-config.cmake search fails, search an installed library
|
||||
@@ -43,14 +68,14 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
list(APPEND _yaml-cpp_REQUIRED_VARS yaml-cpp_INCLUDE_DIR yaml-cpp_VERSION)
|
||||
|
||||
# Search for yaml-cpp.pc
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_yaml-cpp QUIET "yaml-cpp>=${yaml-cpp_FIND_VERSION}")
|
||||
find_package(PkgConfig ${quiet})
|
||||
pkg_check_modules(PC_yaml-cpp ${quiet} "yaml-cpp>=${yaml-cpp_FIND_VERSION}")
|
||||
|
||||
# Try to detect the version installed, if any.
|
||||
if(NOT PC_yaml-cpp_FOUND)
|
||||
pkg_search_module(PC_yaml-cpp QUIET "yaml-cpp")
|
||||
pkg_search_module(PC_yaml-cpp ${quiet} "yaml-cpp")
|
||||
endif()
|
||||
|
||||
|
||||
# Find include directory
|
||||
find_path(yaml-cpp_INCLUDE_DIR
|
||||
NAMES
|
||||
@@ -66,22 +91,21 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
|
||||
# Lib names to search for
|
||||
set(_yaml-cpp_LIB_NAMES yaml-cpp)
|
||||
if(WIN32 AND BUILD_TYPE_DEBUG AND NOT MINGW)
|
||||
# Prefer Debug lib names (Windows only)
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
# Prefer Debug lib names.
|
||||
list(INSERT _yaml-cpp_LIB_NAMES 0 yaml-cppd)
|
||||
endif()
|
||||
|
||||
if(yaml-cpp_STATIC_LIBRARY)
|
||||
# Prefer static lib names
|
||||
if(WIN32 AND NOT MINGW)
|
||||
set(_yaml-cpp_LIB_SUFFIX "md")
|
||||
endif()
|
||||
set(_yaml-cpp_STATIC_LIB_NAMES
|
||||
"libyaml-cpp${_yaml-cpp_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
if(WIN32 AND BUILD_TYPE_DEBUG AND NOT MINGW)
|
||||
# Prefer static Debug lib names (Windows only)
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}yaml-cpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
# Starting from 0.7.0, all platforms uses the suffix "d" for debug.
|
||||
# See https://github.com/jbeder/yaml-cpp/blob/master/CMakeLists.txt#L141
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
list(INSERT _yaml-cpp_STATIC_LIB_NAMES 0
|
||||
"libyaml-cpp${_yaml-cpp_LIB_SUFFIX}d${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}yaml-cppd${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -91,7 +115,7 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
${_yaml-cpp_STATIC_LIB_NAMES}
|
||||
${_yaml-cpp_LIB_NAMES}
|
||||
HINTS
|
||||
${_yaml-cpp_ROOT}
|
||||
${yaml-cpp_ROOT}
|
||||
${PC_yaml-cpp_LIBRARY_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64
|
||||
@@ -112,152 +136,37 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(yaml-cpp
|
||||
REQUIRED_VARS
|
||||
REQUIRED_VARS
|
||||
${_yaml-cpp_REQUIRED_VARS}
|
||||
VERSION_VAR
|
||||
yaml-cpp_VERSION
|
||||
)
|
||||
|
||||
mark_as_advanced(yaml-cpp_INCLUDE_DIR yaml-cpp_LIBRARY yaml-cpp_VERSION)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Create target (if previous 'find_package' call hasn't) ###
|
||||
### Create target
|
||||
|
||||
if(NOT TARGET yaml-cpp)
|
||||
add_library(yaml-cpp UNKNOWN IMPORTED GLOBAL)
|
||||
set(_yaml-cpp_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT yaml-cpp_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(yaml-cpp_FOUND TRUE)
|
||||
set(yaml-cpp_VERSION ${yaml-cpp_FIND_VERSION})
|
||||
set(yaml-cpp_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Starting from 0.7.0, this is included on all platforms, we could also
|
||||
# override CMAKE_DEBUG_POSTFIX to bypass it.
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
string(APPEND _yaml-cpp_LIB_SUFFIX "d")
|
||||
endif()
|
||||
|
||||
# Set the expected library name
|
||||
set(yaml-cpp_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}yaml-cpp${_yaml-cpp_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_yaml-cpp_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(yaml-cpp_CXX_FLAGS "${yaml-cpp_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
if(USE_CLANG)
|
||||
# Remove some global 'shadow' warnings.
|
||||
set(yaml-cpp_CXX_FLAGS "${yaml-cpp_CXX_FLAGS} -Wno-shadow")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(STRIP "${yaml-cpp_CXX_FLAGS}" yaml-cpp_CXX_FLAGS)
|
||||
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS}
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_FLAGS=${yaml-cpp_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DYAML_BUILD_SHARED_LIBS=OFF
|
||||
-DYAML_CPP_BUILD_TESTS=OFF
|
||||
-DYAML_CPP_BUILD_TOOLS=OFF
|
||||
-DYAML_CPP_BUILD_CONTRIB=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if (ANDROID)
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
#TODO: Find a way to merge in the static libs when built with internal yamlcpp
|
||||
message(WARNING
|
||||
"Building STATIC libOpenColorIO using the in-built yaml-cpp. "
|
||||
"yaml-cpp symbols are NOT included in the output binary!"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(yaml-cpp_GIT_TAG "yaml-cpp-${yaml-cpp_VERSION}")
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${yaml-cpp_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(yaml-cpp_install
|
||||
GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
|
||||
GIT_TAG ${yaml-cpp_GIT_TAG}
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/yaml-cpp"
|
||||
BUILD_BYPRODUCTS ${yaml-cpp_LIBRARY}
|
||||
CMAKE_ARGS ${yaml-cpp_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(yaml-cpp yaml-cpp_install)
|
||||
message(STATUS
|
||||
"Installing yaml-cpp: ${yaml-cpp_LIBRARY} (version \"${yaml-cpp_VERSION}\")"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_yaml-cpp_TARGET_CREATE)
|
||||
set_target_properties(yaml-cpp PROPERTIES
|
||||
if (yaml-cpp_FOUND AND NOT TARGET yaml-cpp::yaml-cpp)
|
||||
add_library(yaml-cpp::yaml-cpp UNKNOWN IMPORTED GLOBAL)
|
||||
set_target_properties(yaml-cpp::yaml-cpp PROPERTIES
|
||||
IMPORTED_LOCATION ${yaml-cpp_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(yaml-cpp_INCLUDE_DIR yaml-cpp_LIBRARY yaml-cpp_VERSION)
|
||||
endif()
|
||||
# Required because Installyaml-cpp.cmake creates `yaml-cpp::yaml-cpp`
|
||||
# as an alias, and aliases get resolved in exported targets, causing the
|
||||
# find_dependency(yaml-cpp) call in OpenColorIOConfig.cmake to fail.
|
||||
# This can be removed once Installyaml-cpp.cmake targets yaml-cpp 0.8.
|
||||
if (NOT TARGET yaml-cpp)
|
||||
add_library(yaml-cpp ALIAS yaml-cpp::yaml-cpp)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (yaml-cpp_FOUND)
|
||||
# TODO: Remove this variable and use the `yaml-cpp::yaml-cpp` target
|
||||
# directly when the minimum version of yaml-cpp is updated to 0.8.
|
||||
get_target_property(YAML_CPP_INCLUDE_DIR yaml-cpp::yaml-cpp INCLUDE_DIRECTORIES)
|
||||
set(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp)
|
||||
endif ()
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install Imath
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# Imath_FOUND - Indicate whether the library was found or not
|
||||
# Imath_LIBRARY - Path to the library file
|
||||
# Imath_INCLUDE_DIR - Location of the header files
|
||||
# Imath_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# Imath::Imath
|
||||
# Imath::ImathConfig
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
|
||||
if (NOT TARGET Imath::Imath)
|
||||
add_library(Imath::Imath UNKNOWN IMPORTED GLOBAL)
|
||||
add_library(Imath::ImathConfig INTERFACE IMPORTED GLOBAL)
|
||||
set(_Imath_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT Imath_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(Imath_FOUND TRUE)
|
||||
if(OCIO_Imath_RECOMMENDED_VERSION)
|
||||
set(Imath_VERSION ${OCIO_Imath_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(Imath_VERSION ${Imath_FIND_VERSION})
|
||||
endif()
|
||||
set(Imath_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Set the expected library name
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
set(_Imath_LIB_SUFFIX "_d")
|
||||
endif()
|
||||
|
||||
include(VersionUtils)
|
||||
split_version_string(${Imath_VERSION} _Imath_ExternalProject)
|
||||
|
||||
set(_Imath_LIB_VER "${_Imath_ExternalProject_VERSION_MAJOR}_${_Imath_ExternalProject_VERSION_MINOR}")
|
||||
|
||||
set(Imath_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}Imath-${_Imath_LIB_VER}${_Imath_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_Imath_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(Imath_CXX_FLAGS "${Imath_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
string(STRIP "${Imath_CXX_FLAGS}" Imath_CXX_FLAGS)
|
||||
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_FLAGS=${Imath_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DPYTHON=OFF
|
||||
-DDOCS=OFF
|
||||
-DIMATH_HALF_USE_LOOKUP_TABLE=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(Imath_CMAKE_ARGS
|
||||
${Imath_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${Imath_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(imath_install
|
||||
GIT_REPOSITORY "https://github.com/AcademySoftwareFoundation/Imath.git"
|
||||
GIT_TAG "v${Imath_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/Imath"
|
||||
BUILD_BYPRODUCTS ${Imath_LIBRARY}
|
||||
CMAKE_ARGS ${Imath_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(Imath::Imath imath_install)
|
||||
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing Imath: ${Imath_LIBRARY} (version \"${Imath_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_Imath_TARGET_CREATE)
|
||||
file(MAKE_DIRECTORY ${Imath_INCLUDE_DIR}/Imath)
|
||||
|
||||
set_target_properties(Imath::Imath PROPERTIES
|
||||
IMPORTED_LOCATION ${Imath_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Imath_INCLUDE_DIR};${Imath_INCLUDE_DIR}/Imath"
|
||||
)
|
||||
set_target_properties(Imath::ImathConfig PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Imath_INCLUDE_DIR};${Imath_INCLUDE_DIR}/Imath"
|
||||
)
|
||||
|
||||
mark_as_advanced(Imath_INCLUDE_DIR Imath_LIBRARY Imath_VERSION)
|
||||
endif()
|
||||
+26
-59
@@ -1,13 +1,13 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install OpenEXR.
|
||||
# Install OpenEXR
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# OpenEXR_FOUND - If FALSE, do not try to link to OpenEXR
|
||||
# OpenEXR_LIBRARY - OpenEXR library to link to
|
||||
# OpenEXR_INCLUDE_DIR - Where to find OpenEXR headers
|
||||
# OpenEXR_VERSION - The version of the library
|
||||
# OpenEXR_FOUND - Indicate whether the library was found or not
|
||||
# OpenEXR_LIBRARY - Path to the library file
|
||||
# OpenEXR_INCLUDE_DIR - Location of the header files
|
||||
# OpenEXR_VERSION - Library's version
|
||||
#
|
||||
# Imported targets defined by this module, if found:
|
||||
# OpenEXR::Iex
|
||||
@@ -19,47 +19,10 @@
|
||||
# OpenEXR::OpenEXRCore
|
||||
# OpenEXR::OpenEXRUtil
|
||||
#
|
||||
# By default, the dynamic libraries of OpenEXR will be found. To find the
|
||||
# static ones instead, you must set the OpenEXR_STATIC_LIBRARY variable to
|
||||
# TRUE before calling find_package(OpenEXR ...).
|
||||
#
|
||||
# If OpenEXR is not installed in a standard path, you can use the
|
||||
# OpenEXR_ROOT variable to tell CMake where to find it. If it is not found
|
||||
# and OCIO_INSTALL_EXT_PACKAGES is set to MISSING or ALL, OpenEXR will be
|
||||
# downloaded, statically-built, and used to generate
|
||||
# libOpenColorIOimageioapphelpers.
|
||||
# Depending on user options when configuring OCIO, OpenEXR can be used to
|
||||
# build libOpenColorIOimageioapphelpers.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
set(_OpenEXR_REQUIRED_VARS OpenEXR_LIBRARY)
|
||||
set(_OpenEXR_LIB_VER "${OpenEXR_FIND_VERSION_MAJOR}_${OpenEXR_FIND_VERSION_MINOR}")
|
||||
|
||||
if(NOT DEFINED OpenEXR_ROOT)
|
||||
# Search for OpenEXRConfig.cmake
|
||||
find_package(OpenEXR ${OpenEXR_FIND_VERSION} CONFIG QUIET)
|
||||
endif()
|
||||
|
||||
if(OpenEXR_FOUND)
|
||||
get_target_property(OpenEXR_LIBRARY OpenEXR::OpenEXR LOCATION)
|
||||
get_target_property(OpenEXR_INCLUDE_DIR OpenEXR::OpenEXR INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif()
|
||||
|
||||
# Override REQUIRED if package can be installed
|
||||
if(OCIO_INSTALL_EXT_PACKAGES STREQUAL MISSING)
|
||||
set(OpenEXR_FIND_REQUIRED FALSE)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenEXR
|
||||
REQUIRED_VARS
|
||||
${_OpenEXR_REQUIRED_VARS}
|
||||
VERSION_VAR
|
||||
OpenEXR_VERSION
|
||||
)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
@@ -77,22 +40,21 @@ macro(set_target_location target_name)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
if(NOT OpenEXR_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
if(NOT OpenEXR_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Required dependency
|
||||
# OCIO custom module to find ZLIB. (Findzlib)
|
||||
find_package(zlib)
|
||||
# Not trying to find ZLIB here since it is a required dependency of OCIO.
|
||||
if(NOT ZLIB_FOUND)
|
||||
message(STATUS "ZLib is required to build OpenEXR.")
|
||||
message(STATUS "ZLIB is required to build OpenEXR.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(Threads)
|
||||
|
||||
ocio_handle_dependency(Threads)
|
||||
if(NOT Threads_FOUND)
|
||||
message(STATUS "Threads is required to build OpenEXR.")
|
||||
return()
|
||||
@@ -100,8 +62,8 @@ if(NOT OpenEXR_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
|
||||
# Set find_package standard args
|
||||
set(OpenEXR_FOUND TRUE)
|
||||
if(_OpenEXR_ExternalProject_VERSION)
|
||||
set(OpenEXR_VERSION ${_OpenEXR_ExternalProject_VERSION})
|
||||
if(OCIO_OpenEXR_RECOMMENDED_VERSION)
|
||||
set(OpenEXR_VERSION ${OCIO_OpenEXR_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(OpenEXR_VERSION ${OpenEXR_FIND_VERSION})
|
||||
endif()
|
||||
@@ -113,9 +75,9 @@ if(NOT OpenEXR_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
endif()
|
||||
|
||||
include(VersionUtils)
|
||||
split_version_string(${OpenEXR_VERSION} _OpenEXR_ExternalProject)
|
||||
split_version_string(${OpenEXR_VERSION} _OpenEXR)
|
||||
|
||||
set(_OpenEXR_LIB_VER "${_OpenEXR_ExternalProject_VERSION_MAJOR}_${_OpenEXR_ExternalProject_VERSION_MINOR}")
|
||||
set(_OpenEXR_LIB_VER "${_OpenEXR_VERSION_MAJOR}_${_OpenEXR_VERSION_MINOR}")
|
||||
|
||||
set_target_location(Iex)
|
||||
set_target_location(IlmThread)
|
||||
@@ -148,7 +110,7 @@ if(NOT OpenEXR_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DOPENEXR_INSTALL_EXAMPLES=OFF
|
||||
-DOPENEXR_INSTALL_TOOLS=OFF
|
||||
-DOPENEXR_BUILD_TOOLS=OFF
|
||||
# Try to use in-source built Imath first, if available.
|
||||
-DCMAKE_PREFIX_PATH=${_EXT_DIST_ROOT}
|
||||
)
|
||||
@@ -198,7 +160,8 @@ if(NOT OpenEXR_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
# Prevent some CI jobs to fail when building.
|
||||
# --parallel
|
||||
)
|
||||
|
||||
# Additional targets. ALIAS to UNKNOWN imported target is only possible
|
||||
@@ -214,7 +177,9 @@ if(NOT OpenEXR_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
|
||||
add_dependencies(OpenEXR::OpenEXR openexr_install)
|
||||
|
||||
message(STATUS "Installing OpenEXR: ${OpenEXR_LIBRARY} (version \"${OpenEXR_VERSION}\")")
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing OpenEXR: ${OpenEXR_LIBRARY} (version \"${OpenEXR_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -236,6 +201,7 @@ if(_OpenEXR_TARGET_CREATE)
|
||||
IMPORTED_LOCATION ${IlmThread_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenEXR_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "OpenEXR::IlmThreadConfig;OpenEXR::IlmThreadConfig;OpenEXR::Iex;Threads::Threads"
|
||||
STATIC_LIBRARY_OPTIONS "-no_warning_for_no_symbols"
|
||||
)
|
||||
set_target_properties(OpenEXR::IlmThreadConfig PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenEXR_INCLUDE_DIR};${OpenEXR_INCLUDE_DIR}/OpenEXR"
|
||||
@@ -252,6 +218,7 @@ if(_OpenEXR_TARGET_CREATE)
|
||||
IMPORTED_LOCATION ${OpenEXRCore_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenEXR_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "OpenEXR::IlmThreadConfig;ZLIB::ZLIB;\$<LINK_ONLY:Imath::ImathConfig>"
|
||||
STATIC_LIBRARY_OPTIONS "-no_warning_for_no_symbols"
|
||||
)
|
||||
set_target_properties(OpenEXR::OpenEXRUtil PROPERTIES
|
||||
IMPORTED_LOCATION ${OpenEXRUtil_LIBRARY}
|
||||
+48
-60
@@ -1,75 +1,56 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Locate or install minizip-ng
|
||||
# Install ZLIB
|
||||
#
|
||||
# Except for the variable ZLIB_VERSION_STRING, OCIO sets the same variables as the
|
||||
# CMake's FindZLIB when installing ZLIB manually.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# ZLIB_FOUND - If FALSE, do not try to link to minizip-ng
|
||||
# ZLIB_LIBRARIES - ZLIB library to link to
|
||||
# ZLIB_INCLUDE_DIRS - Where to find zlib.h and other headers
|
||||
# ZLIB_VERSION - The version of the library
|
||||
# ZLIB_FOUND - Indicate whether the library was found or not
|
||||
# ZLIB_LIBRARY - Path to the library file
|
||||
# ZLIB_INCLUDE_DIR - Location of the header files
|
||||
# ZLIB_VERSION - Library's version
|
||||
#
|
||||
# Targets defined by this module:
|
||||
# ZLIB::ZLIB - IMPORTED target, if found
|
||||
# Global targets defined by this module:
|
||||
# ZLIB::ZLIB
|
||||
#
|
||||
# This module is named GetZLIB because it is not used with find_package().
|
||||
# It must be included using include().
|
||||
#
|
||||
# The reason is that CMake provide a FindZLIB already and the current file is
|
||||
# using it.
|
||||
#
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
# Assign the rigtt name for ZLIB depending on the OS.
|
||||
if(WIN32)
|
||||
set(_ZLIB_LIB_NAME "zlib")
|
||||
set(_ZLIB_STATIC_LIB_NAME "zlibstatic")
|
||||
else()
|
||||
set(_ZLIB_LIB_NAME "z")
|
||||
set(_ZLIB_STATIC_LIB_NAME "z")
|
||||
endif()
|
||||
|
||||
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
set(_ZLIB_REQUIRED_VARS ZLIB_LIBRARIES)
|
||||
|
||||
if(NOT DEFINED ZLIB_ROOT)
|
||||
# Save old value of CMAKE_MODULE_PATH
|
||||
set(_ZLIB__CMAKE_MODULE_PATH_OLD_ ${CMAKE_MODULE_PATH})
|
||||
# Force find_package to use CMAKE module and not custom modules.
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules")
|
||||
|
||||
# Use CMake FindZLIB module
|
||||
find_package(ZLIB ${zlib_FIND_VERSION})
|
||||
|
||||
# Restore CMAKE_MODULE_PATH
|
||||
set(CMAKE_MODULE_PATH ${_ZLIB__CMAKE_MODULE_PATH_OLD_})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
|
||||
###############################################################################
|
||||
if(NOT TARGET ZLIB::ZLIB)
|
||||
add_library(ZLIB::ZLIB UNKNOWN IMPORTED GLOBAL)
|
||||
set(_ZLIB_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
if(NOT ZLIB_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
### Install package from source
|
||||
###############################################################################
|
||||
if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${CMAKE_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${CMAKE_BINARY_DIR}/ext/build")
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
if(WIN32)
|
||||
set(_ZLIB_LIB_NAME "zlib")
|
||||
set(_ZLIB_STATIC_LIB_NAME "zlibstatic")
|
||||
else()
|
||||
set(_ZLIB_LIB_NAME "z")
|
||||
set(_ZLIB_STATIC_LIB_NAME "z")
|
||||
endif()
|
||||
|
||||
# Set find_package standard args
|
||||
set(ZLIB_FOUND TRUE)
|
||||
if(_zlib_ExternalProject_VERSION)
|
||||
set(ZLIB_VERSION ${_zlib_ExternalProject_VERSION})
|
||||
if(OCIO_ZLIB_RECOMMENDED_VERSION)
|
||||
set(ZLIB_VERSION ${OCIO_ZLIB_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(ZLIB_VERSION ${zlib_FIND_VERSION})
|
||||
set(ZLIB_VERSION ${ZLIB_FIND_VERSION})
|
||||
endif()
|
||||
|
||||
set(ZLIB_INCLUDE_DIRS "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Windows need the "d" suffix at the end.
|
||||
@@ -87,6 +68,10 @@ if(NOT ZLIB_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
if(_ZLIB_TARGET_CREATE)
|
||||
set(ZLIB_CMAKE_ARGS
|
||||
${ZLIB_CMAKE_ARGS}
|
||||
# Setting policy CMP0042 when building ZLIB since that project is using an old CMake
|
||||
# version as the cmake_minimum_required and that version has no knowledge of the policy.
|
||||
# Since that policy gets unset, it causes a warning with CMake 3.25+.
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0042=NEW
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
@@ -149,22 +134,25 @@ if(NOT ZLIB_FOUND AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f ${_EXT_DIST_ROOT}/${_ZLIB_INSTALL_LIBDIR}/zlib.lib ${_EXT_DIST_ROOT}/bin/zlib.dll
|
||||
)
|
||||
|
||||
add_library(ZLIB::ZLIB STATIC IMPORTED GLOBAL)
|
||||
add_dependencies(ZLIB::ZLIB ZLIB_install)
|
||||
set_property(TARGET ZLIB::ZLIB PROPERTY
|
||||
IMPORTED_LOCATION "${ZLIB_LIBRARIES}"
|
||||
)
|
||||
target_include_directories(ZLIB::ZLIB INTERFACE "${CMAKE_INSTALL_BINDIR}/include")
|
||||
|
||||
set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
|
||||
set(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS})
|
||||
|
||||
message(STATUS "Installing ZLIB: ${ZLIB_LIBRARIES} (version \"${ZLIB_VERSION}\")")
|
||||
|
||||
# FindZLIB from CMake needs ZLIB_LIBRARY and ZLIB_INCLUDE_DIR.
|
||||
# Starting CMake 3.17+, The mark_as_advanced() command no longer creates a cache entry if one
|
||||
# does not already exist. (See policy CMP0102)
|
||||
# For that reasons, ZLIB_LIBRARY and ZLIB_INCLUDE_DIR are set in the CMake's Cache since ZLIB
|
||||
# is needed by other OCIO dependencies.
|
||||
set(ZLIB_LIBRARY ${ZLIB_LIBRARIES} CACHE STRING "ZLIB library file")
|
||||
set(ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS} CACHE STRING "ZLIB includes directory")
|
||||
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing ZLIB: ${ZLIB_LIBRARIES} (version \"${ZLIB_VERSION}\") ")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
###############################################################################
|
||||
if(_ZLIB_TARGET_CREATE)
|
||||
set_target_properties(ZLIB::ZLIB PROPERTIES
|
||||
IMPORTED_LOCATION ${ZLIB_LIBRARIES}
|
||||
@@ -172,4 +160,4 @@ if(_ZLIB_TARGET_CREATE)
|
||||
)
|
||||
|
||||
mark_as_advanced(ZLIB_INCLUDE_DIRS ZLIB_LIBRARIES ZLIB_VERSION)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,161 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install expat
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# expat_FOUND - Indicate whether the library was found or not
|
||||
# expat_LIBRARY - Path to the library file
|
||||
# expat_INCLUDE_DIR - Location of the header files
|
||||
# expat_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# expat::expat
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
|
||||
if(NOT TARGET expat::expat)
|
||||
add_library(expat::expat UNKNOWN IMPORTED GLOBAL)
|
||||
set(_expat_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT expat_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(expat_FOUND TRUE)
|
||||
if(OCIO_expat_RECOMMENDED_VERSION)
|
||||
set(expat_VERSION ${OCIO_expat_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(expat_VERSION ${expat_FIND_VERSION})
|
||||
endif()
|
||||
set(expat_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Set the expected library name
|
||||
if(WIN32)
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
set(_expat_LIB_SUFFIX "d")
|
||||
endif()
|
||||
# Static Linking, Multi-threaded Dll naming (>=2.2.8):
|
||||
# https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/win32/README.txt
|
||||
set(_expat_LIB_SUFFIX "${_expat_LIB_SUFFIX}MD")
|
||||
endif()
|
||||
|
||||
# Expat use a hardcoded lib prefix instead of CMAKE_STATIC_LIBRARY_PREFIX
|
||||
# https://github.com/libexpat/libexpat/blob/R_2_4_1/expat/CMakeLists.txt#L374
|
||||
set(_expat_LIB_PREFIX "lib")
|
||||
|
||||
set(expat_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${_expat_LIB_PREFIX}expat${_expat_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_expat_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(EXPAT_C_FLAGS "${EXPAT_C_FLAGS} /EHsc")
|
||||
set(EXPAT_CXX_FLAGS "${EXPAT_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
string(STRIP "${EXPAT_C_FLAGS}" EXPAT_C_FLAGS)
|
||||
string(STRIP "${EXPAT_CXX_FLAGS}" EXPAT_CXX_FLAGS)
|
||||
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS}
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW
|
||||
-DCMAKE_C_VISIBILITY_PRESET=${CMAKE_C_VISIBILITY_PRESET}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_C_FLAGS=${EXPAT_C_FLAGS}
|
||||
-DCMAKE_CXX_FLAGS=${EXPAT_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DEXPAT_BUILD_DOCS=OFF
|
||||
-DEXPAT_BUILD_EXAMPLES=OFF
|
||||
-DEXPAT_BUILD_TESTS=OFF
|
||||
-DEXPAT_BUILD_TOOLS=OFF
|
||||
-DEXPAT_SHARED_LIBS=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(EXPAT_CMAKE_ARGS
|
||||
${EXPAT_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${expat_INCLUDE_DIR})
|
||||
|
||||
string(REPLACE "." ";" VERSION_LIST ${expat_VERSION})
|
||||
list(GET VERSION_LIST 0 expat_VERSION_MAJOR)
|
||||
list(GET VERSION_LIST 1 expat_VERSION_MINOR)
|
||||
list(GET VERSION_LIST 2 expat_VERSION_PATCH)
|
||||
|
||||
ExternalProject_Add(expat_install
|
||||
GIT_REPOSITORY "https://github.com/libexpat/libexpat.git"
|
||||
GIT_TAG "R_${expat_VERSION_MAJOR}_${expat_VERSION_MINOR}_${expat_VERSION_PATCH}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/libexpat"
|
||||
BUILD_BYPRODUCTS ${expat_LIBRARY}
|
||||
SOURCE_SUBDIR expat
|
||||
CMAKE_ARGS ${EXPAT_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(expat::expat expat_install)
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing expat: ${expat_LIBRARY} (version \"${expat_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_expat_TARGET_CREATE)
|
||||
set_target_properties(expat::expat PROPERTIES
|
||||
IMPORTED_LOCATION ${expat_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${expat_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(expat_INCLUDE_DIR expat_LIBRARY expat_VERSION)
|
||||
endif()
|
||||
@@ -0,0 +1,142 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install lcms2
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# lcms2_FOUND - Indicate whether the library was found or not
|
||||
# lcms2_LIBRARY - Path to the library file
|
||||
# lcms2_INCLUDE_DIR - Location of the header files
|
||||
# lcms2_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# lcms2::lcms2
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(NOT TARGET lcms2::lcms2)
|
||||
add_library(lcms2::lcms2 UNKNOWN IMPORTED GLOBAL)
|
||||
set(_lcms2_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT lcms2_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(lcms2_FOUND TRUE)
|
||||
if(OCIO_lcms2_RECOMMENDED_VERSION)
|
||||
set(lcms2_VERSION ${OCIO_lcms2_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(lcms2_VERSION ${lcms2_FIND_VERSION})
|
||||
endif()
|
||||
set(lcms2_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/lcms2")
|
||||
set(lcms2_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lcms2${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_lcms2_TARGET_CREATE)
|
||||
if(UNIX)
|
||||
set(lcms2_C_FLAGS "${lcms2_C_FLAGS} -fvisibility=hidden -fPIC")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||
set(lcms2_C_FLAGS "${lcms2_C_FLAGS} -Wno-aggressive-loop-optimizations")
|
||||
endif()
|
||||
|
||||
string(STRIP "${lcms2_C_FLAGS}" lcms2_C_FLAGS)
|
||||
|
||||
# NOTE: Depending of the compiler version lcm2 2.2 does not compile with C++17 so revert
|
||||
# to C++11 because the library is only used by a cmd line tool.
|
||||
|
||||
set(lcms2_CXX_STANDARD ${CMAKE_CXX_STANDARD})
|
||||
if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 17)
|
||||
set(lcms2_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS}
|
||||
-DCMAKE_C_FLAGS=${lcms2_C_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${lcms2_CXX_STANDARD}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(lcms2_CMAKE_ARGS
|
||||
${lcms2_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${lcms2_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(lcms2_install
|
||||
GIT_REPOSITORY "https://github.com/mm2/Little-CMS.git"
|
||||
GIT_TAG "lcms${lcms2_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/Little-CMS"
|
||||
BUILD_BYPRODUCTS ${lcms2_LIBRARY}
|
||||
CMAKE_ARGS ${lcms2_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
PATCH_COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
"${PROJECT_SOURCE_DIR}/share/cmake/projects/Buildlcms2.cmake"
|
||||
"CMakeLists.txt"
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(lcms2::lcms2 lcms2_install)
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing lcms2: ${lcms2_LIBRARY} (version \"${lcms2_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_lcms2_TARGET_CREATE)
|
||||
set_target_properties(lcms2::lcms2 PROPERTIES
|
||||
IMPORTED_LOCATION ${lcms2_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${lcms2_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(lcms2_INCLUDE_DIR lcms2_LIBRARY lcms2_VERSION)
|
||||
endif()
|
||||
@@ -0,0 +1,154 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install minizip-ng
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# minizip-ng_FOUND - Indicate whether the library was found or not
|
||||
# minizip-ng_LIBRARY - Path to the library file
|
||||
# minizip-ng_INCLUDE_DIR - Location of the header files
|
||||
# minizip-ng_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# minizip-ng::minizip-ng
|
||||
#
|
||||
# Link against the following target:
|
||||
# ZLIB::ZLIB
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
if(NOT TARGET MINIZIP::minizip-ng)
|
||||
add_library(MINIZIP::minizip-ng UNKNOWN IMPORTED GLOBAL)
|
||||
set(_minizip-ng_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT minizip-ng_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(minizip-ng_FOUND TRUE)
|
||||
if(OCIO_minizip-ng_RECOMMENDED_VERSION)
|
||||
set(minizip-ng_VERSION ${OCIO_minizip-ng_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(minizip-ng_VERSION ${minizip-ng_FIND_VERSION})
|
||||
endif()
|
||||
|
||||
set(minizip-ng_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/minizip-ng")
|
||||
|
||||
# Minizip-ng use a hardcoded lib prefix instead of CMAKE_STATIC_LIBRARY_PREFIX
|
||||
set(_minizip-ng_LIB_PREFIX "lib")
|
||||
|
||||
set(minizip-ng_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${_minizip-ng_LIB_PREFIX}minizip-ng${_minizip-ng_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_minizip-ng_TARGET_CREATE)
|
||||
set(minizip-ng_CMAKE_ARGS
|
||||
${minizip-ng_CMAKE_ARGS}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
# Since the other modules create a subfolder for the includes by default and since
|
||||
# minizip-ng does not, a suffix is added to CMAKE_INSTALL_INCLUDEDIR in order to
|
||||
# install the headers under a subdirectory named "minizip-ng".
|
||||
# Note that this does not affect external builds for minizip-ng.
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}/minizip-ng
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DMZ_OPENSSL=OFF
|
||||
-DMZ_LIBBSD=OFF
|
||||
-DMZ_BUILD_TESTS=OFF
|
||||
-DMZ_COMPAT=OFF
|
||||
-DMZ_BZIP2=OFF
|
||||
-DMZ_LZMA=OFF
|
||||
-DMZ_LIBCOMP=OFF
|
||||
-DMZ_ZSTD=OFF
|
||||
-DMZ_PKCRYPT=OFF
|
||||
-DMZ_WZAES=OFF
|
||||
-DMZ_SIGNING=OFF
|
||||
-DMZ_ZLIB=ON
|
||||
-DMZ_ICONV=OFF
|
||||
-DMZ_FETCH_LIBS=OFF
|
||||
-DMZ_FORCE_FETCH_LIBS=OFF
|
||||
-DZLIB_LIBRARY=${ZLIB_LIBRARIES}
|
||||
-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(minizip-ng_CMAKE_ARGS
|
||||
${minizip-ng_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(minizip-ng_CMAKE_ARGS
|
||||
${minizip-ng_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(minizip-ng_CMAKE_ARGS
|
||||
${minizip-ng_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${minizip-ng_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(minizip-ng_install
|
||||
GIT_REPOSITORY "https://github.com/zlib-ng/minizip-ng.git"
|
||||
GIT_TAG "${minizip-ng_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/libminizip-ng"
|
||||
BUILD_BYPRODUCTS ${minizip-ng_LIBRARY}
|
||||
CMAKE_ARGS ${minizip-ng_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(MINIZIP::minizip-ng minizip-ng_install)
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing minizip-ng: ${minizip-ng_LIBRARY} (version \"${minizip-ng_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_minizip-ng_TARGET_CREATE)
|
||||
set_target_properties(MINIZIP::minizip-ng PROPERTIES
|
||||
IMPORTED_LOCATION "${minizip-ng_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${minizip-ng_INCLUDE_DIR}"
|
||||
)
|
||||
|
||||
mark_as_advanced(minizip-ng_INCLUDE_DIR minizip-ng_LIBRARY minizip-ng_VERSION)
|
||||
|
||||
target_link_libraries(MINIZIP::minizip-ng INTERFACE ZLIB::ZLIB)
|
||||
endif()
|
||||
@@ -0,0 +1,86 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install openfx
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# openfx_FOUND - Indicate whether the library was found or not
|
||||
# openfx_INCLUDE_DIR - Location of the header files
|
||||
# openfx_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# openfx::module
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
|
||||
if(NOT TARGET openfx::module)
|
||||
add_library(openfx::module INTERFACE IMPORTED GLOBAL)
|
||||
set(_openfx_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT openfx_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
set(_openfx_INSTALL_DIR "${_EXT_BUILD_ROOT}/openfx/src/openfx_install")
|
||||
|
||||
# Set find_package standard args
|
||||
set(openfx_FOUND TRUE)
|
||||
if(OCIO_openfx_RECOMMENDED_VERSION)
|
||||
set(openfx_VERSION ${OCIO_openfx_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(openfx_VERSION ${openfx_FIND_VERSION})
|
||||
endif()
|
||||
set(openfx_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/openfx")
|
||||
|
||||
if(_openfx_TARGET_CREATE)
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${openfx_INCLUDE_DIR})
|
||||
|
||||
include(VersionUtils)
|
||||
split_version_string(${openfx_VERSION} openfx)
|
||||
|
||||
ExternalProject_Add(openfx_install
|
||||
GIT_REPOSITORY "https://github.com/ofxa/openfx.git"
|
||||
# The latest version from 2015 is OFX_Release_1_4_TAG.
|
||||
# Need to be careful since older version might have the patch number in the tag.
|
||||
GIT_TAG "OFX_Release_${openfx_VERSION_MAJOR}_${openfx_VERSION_MINOR}_TAG"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/openfx"
|
||||
BUILD_BYPRODUCTS ${openfx_INCLUDE_DIR}
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} -E copy_directory
|
||||
"${_EXT_BUILD_ROOT}/openfx/src/openfx_install/include"
|
||||
"${openfx_INCLUDE_DIR}"
|
||||
INSTALL_COMMAND ""
|
||||
CMAKE_ARGS ${openfx_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
add_dependencies(openfx::module openfx_install)
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing openfx: ${openfx_INCLUDE_DIR} (version \"${openfx_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_openfx_TARGET_CREATE)
|
||||
set_target_properties(openfx::module PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${openfx_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(openfx_INCLUDE_DIR)
|
||||
endif()
|
||||
@@ -0,0 +1,122 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install pybind11
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# pybind11_FOUND - Indicate whether the library was found or not
|
||||
# pybind11_INCLUDE_DIR - Location of the header files
|
||||
# pybind11_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# pybind11::module
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Create target ###
|
||||
|
||||
if(NOT TARGET pybind11::module)
|
||||
add_library(pybind11::module INTERFACE IMPORTED GLOBAL)
|
||||
set(_pybind11_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT pybind11_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(pybind11_FOUND TRUE)
|
||||
if(OCIO_pybind11_RECOMMENDED_VERSION)
|
||||
set(pybind11_VERSION ${OCIO_pybind11_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(pybind11_VERSION ${pybind11_FIND_VERSION})
|
||||
endif()
|
||||
set(pybind11_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
if(_pybind11_TARGET_CREATE)
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${pybind11_INCLUDE_DIR})
|
||||
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
# Using FindPython mode (PYBIND11_FINDPYTHON=ON) doesn't seem to
|
||||
# work when building on docker manylinux images where Development
|
||||
# component is not available but is hardcoded in pybind11 script.
|
||||
-DPYTHON_EXECUTABLE=${Python_EXECUTABLE}
|
||||
-DPYBIND11_INSTALL=ON
|
||||
-DPYBIND11_TEST=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
if (ANDROID)
|
||||
set(pybind11_CMAKE_ARGS
|
||||
${pybind11_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(pybind11_install
|
||||
GIT_REPOSITORY "https://github.com/pybind/pybind11.git"
|
||||
GIT_TAG "v${pybind11_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/pybind11"
|
||||
BUILD_BYPRODUCTS ${pybind11_INCLUDE_DIR}
|
||||
CMAKE_ARGS ${pybind11_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(pybind11::module pybind11_install)
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing pybind11: ${pybind11_INCLUDE_DIR} (version \"${pybind11_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_pybind11_TARGET_CREATE)
|
||||
set_target_properties(pybind11::module PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${pybind11_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(pybind11_INCLUDE_DIR pybind11_VERSION)
|
||||
endif()
|
||||
@@ -0,0 +1,134 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install pystring
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# pystring_FOUND - Indicate whether the library was found or not
|
||||
# pystring_LIBRARY - Path to the library file
|
||||
# pystring_INCLUDE_DIR - Location of the header files
|
||||
# pystring_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# pystring::pystring
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(NOT TARGET pystring::pystring)
|
||||
add_library(pystring::pystring UNKNOWN IMPORTED GLOBAL)
|
||||
set(_pystring_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT pystring_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(pystring_FOUND TRUE)
|
||||
if(OCIO_pystring_RECOMMENDED_VERSION)
|
||||
set(pystring_VERSION ${OCIO_pystring_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(pystring_VERSION ${pystring_FIND_VERSION})
|
||||
endif()
|
||||
set(pystring_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}/pystring")
|
||||
|
||||
set(pystring_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}pystring${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_pystring_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
string(STRIP "${pystring_CXX_FLAGS}" pystring_CXX_FLAGS)
|
||||
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS}
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_FLAGS=${pystring_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if (ANDROID)
|
||||
set(pystring_CMAKE_ARGS
|
||||
${pystring_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${pystring_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(pystring_install
|
||||
GIT_REPOSITORY "https://github.com/imageworks/pystring.git"
|
||||
GIT_TAG "v${pystring_VERSION}"
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/pystring"
|
||||
BUILD_BYPRODUCTS ${pystring_LIBRARY}
|
||||
CMAKE_ARGS ${pystring_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
PATCH_COMMAND
|
||||
${CMAKE_COMMAND} -E copy
|
||||
"${PROJECT_SOURCE_DIR}/share/cmake/projects/Buildpystring.cmake"
|
||||
"CMakeLists.txt"
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(pystring::pystring pystring_install)
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing pystring: ${pystring_LIBRARY} (version \"${pystring_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_pystring_TARGET_CREATE)
|
||||
set_target_properties(pystring::pystring PROPERTIES
|
||||
IMPORTED_LOCATION ${pystring_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${pystring_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(pystring_INCLUDE_DIR pystring_LIBRARY pystring_VERSION)
|
||||
endif()
|
||||
@@ -0,0 +1,43 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install sse2neon (header-only version)
|
||||
# https://github.com/DLTcollab/sse2neon
|
||||
#
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# sse2neon
|
||||
###############################################################################
|
||||
|
||||
# Download sse2neon using FetchContent and make it available at configure time.
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
set(FETCHCONTENT_BASE_DIR "${CMAKE_BINARY_DIR}/ext/build/sse2neon")
|
||||
FetchContent_Declare(sse2neon
|
||||
GIT_REPOSITORY https://github.com/DLTcollab/sse2neon.git
|
||||
GIT_TAG v1.6.0
|
||||
)
|
||||
|
||||
# FetchContent_MakeAvailable is not available until CMake 3.14+.
|
||||
# Using FetchContent_GetProperties and FetchContent_Populate instead.
|
||||
FetchContent_GetProperties(sse2neon)
|
||||
|
||||
if(NOT sse2neon_POPULATED)
|
||||
FetchContent_Populate(sse2neon)
|
||||
|
||||
set(_EXT_DIST_INCLUDE "${CMAKE_BINARY_DIR}/ext/dist/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
file(COPY "${sse2neon_SOURCE_DIR}/sse2neon.h" DESTINATION "${_EXT_DIST_INCLUDE}/sse2neon")
|
||||
|
||||
# sse2neon_INCLUDE_DIR is used internally for CheckSupportSSEUsingSSE2NEON.cmake and to create sse2neon
|
||||
# target for OCIO.
|
||||
set(sse2neon_INCLUDE_DIR "${sse2neon_SOURCE_DIR}")
|
||||
|
||||
# Any changes to the following lines must be replicated in ./CMakeLists.txt as well.
|
||||
# Create a target for sse2neon (non-imported)
|
||||
add_library(sse2neon INTERFACE)
|
||||
# Add the include directories to the target.
|
||||
target_include_directories(sse2neon INTERFACE "${sse2neon_INCLUDE_DIR}")
|
||||
# Ignore the warnings coming from sse2neon.h as they are false positives.
|
||||
target_compile_options(sse2neon INTERFACE -Wno-unused-parameter)
|
||||
endif()
|
||||
@@ -0,0 +1,161 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
#
|
||||
# Install yaml-cpp
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# yaml-cpp_FOUND - Indicate whether the library was found or not
|
||||
# yaml-cpp_LIBRARY - Path to the library file
|
||||
# yaml-cpp_INCLUDE_DIR - Location of the header files
|
||||
# yaml-cpp_VERSION - Library's version
|
||||
#
|
||||
# Global targets defined by this module:
|
||||
# yaml-cpp::yaml-cpp
|
||||
#
|
||||
# For compatibility with the upstream CMake package, the following variables and targets are defined:
|
||||
# yaml-cpp::yaml-cpp - Alias of the yaml-cpp target
|
||||
# YAML_CPP_LIBRARIES - Libraries to link against yaml-cpp
|
||||
# YAML_CPP_INCLUDE_DIR - Include directory
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
### Create target (if previous 'find_package' call hasn't) ###
|
||||
|
||||
if(NOT TARGET yaml-cpp::yaml-cpp)
|
||||
add_library(yaml-cpp::yaml-cpp UNKNOWN IMPORTED GLOBAL)
|
||||
set(_yaml-cpp_TARGET_CREATE TRUE)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
|
||||
if(NOT yaml-cpp_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(ExternalProject)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(_EXT_DIST_ROOT "${PROJECT_BINARY_DIR}/ext/dist")
|
||||
set(_EXT_BUILD_ROOT "${PROJECT_BINARY_DIR}/ext/build")
|
||||
|
||||
# Set find_package standard args
|
||||
set(yaml-cpp_FOUND TRUE)
|
||||
if(OCIO_yaml-cpp_RECOMMENDED_VERSION)
|
||||
set(yaml-cpp_VERSION ${OCIO_yaml-cpp_RECOMMENDED_VERSION})
|
||||
else()
|
||||
set(yaml-cpp_VERSION ${yaml-cpp_FIND_VERSION})
|
||||
endif()
|
||||
set(yaml-cpp_INCLUDE_DIR "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# Starting from 0.7.0, this is included on all platforms, we could also
|
||||
# override CMAKE_DEBUG_POSTFIX to bypass it.
|
||||
if(BUILD_TYPE_DEBUG)
|
||||
string(APPEND _yaml-cpp_LIB_SUFFIX "d")
|
||||
endif()
|
||||
|
||||
# Set the expected library name
|
||||
set(yaml-cpp_LIBRARY
|
||||
"${_EXT_DIST_ROOT}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}yaml-cpp${_yaml-cpp_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
|
||||
if(_yaml-cpp_TARGET_CREATE)
|
||||
if(MSVC)
|
||||
set(yaml-cpp_CXX_FLAGS "${yaml-cpp_CXX_FLAGS} /EHsc")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
if(USE_CLANG)
|
||||
# Remove some global 'shadow' warnings.
|
||||
set(yaml-cpp_CXX_FLAGS "${yaml-cpp_CXX_FLAGS} -Wno-shadow")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(STRIP "${yaml-cpp_CXX_FLAGS}" yaml-cpp_CXX_FLAGS)
|
||||
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS}
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0063=NEW
|
||||
-DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET}
|
||||
-DCMAKE_VISIBILITY_INLINES_HIDDEN=${CMAKE_VISIBILITY_INLINES_HIDDEN}
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_CXX_FLAGS=${yaml-cpp_CXX_FLAGS}
|
||||
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
-DCMAKE_INSTALL_MESSAGE=${CMAKE_INSTALL_MESSAGE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_EXT_DIST_ROOT}
|
||||
-DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR}
|
||||
-DCMAKE_INSTALL_DATADIR=${CMAKE_INSTALL_DATADIR}
|
||||
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
|
||||
-DCMAKE_OBJECT_PATH_MAX=${CMAKE_OBJECT_PATH_MAX}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DYAML_BUILD_SHARED_LIBS=OFF
|
||||
-DYAML_CPP_BUILD_TESTS=OFF
|
||||
-DYAML_CPP_BUILD_TOOLS=OFF
|
||||
-DYAML_CPP_BUILD_CONTRIB=OFF
|
||||
)
|
||||
|
||||
if(CMAKE_TOOLCHAIN_FILE)
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
string(REPLACE ";" "$<SEMICOLON>" ESCAPED_CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS}
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||
-DCMAKE_OSX_ARCHITECTURES=${ESCAPED_CMAKE_OSX_ARCHITECTURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if (ANDROID)
|
||||
set(yaml-cpp_CMAKE_ARGS
|
||||
${yaml-cpp_CMAKE_ARGS}
|
||||
-DANDROID_PLATFORM=${ANDROID_PLATFORM}
|
||||
-DANDROID_ABI=${ANDROID_ABI}
|
||||
-DANDROID_STL=${ANDROID_STL})
|
||||
endif()
|
||||
|
||||
set(yaml-cpp_GIT_TAG "yaml-cpp-${yaml-cpp_VERSION}")
|
||||
|
||||
# Hack to let imported target be built from ExternalProject_Add
|
||||
file(MAKE_DIRECTORY ${yaml-cpp_INCLUDE_DIR})
|
||||
|
||||
ExternalProject_Add(yaml-cpp_install
|
||||
GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
|
||||
GIT_TAG ${yaml-cpp_GIT_TAG}
|
||||
GIT_CONFIG advice.detachedHead=false
|
||||
GIT_SHALLOW TRUE
|
||||
PREFIX "${_EXT_BUILD_ROOT}/yaml-cpp"
|
||||
BUILD_BYPRODUCTS ${yaml-cpp_LIBRARY}
|
||||
CMAKE_ARGS ${yaml-cpp_CMAKE_ARGS}
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND
|
||||
${CMAKE_COMMAND} --build .
|
||||
--config ${CMAKE_BUILD_TYPE}
|
||||
--target install
|
||||
--parallel
|
||||
)
|
||||
|
||||
add_dependencies(yaml-cpp::yaml-cpp yaml-cpp_install)
|
||||
if(OCIO_VERBOSE)
|
||||
message(STATUS "Installing yaml-cpp: ${yaml-cpp_LIBRARY} (version \"${yaml-cpp_VERSION}\")")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
if(_yaml-cpp_TARGET_CREATE)
|
||||
set_target_properties(yaml-cpp::yaml-cpp PROPERTIES
|
||||
IMPORTED_LOCATION ${yaml-cpp_LIBRARY}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(yaml-cpp_INCLUDE_DIR yaml-cpp_LIBRARY yaml-cpp_VERSION)
|
||||
endif()
|
||||
|
||||
set(YAML_CPP_INCLUDE_DIR "${yaml-cpp_INCLUDE_DIR}")
|
||||
set(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp)
|
||||
@@ -15,12 +15,13 @@ file(GLOB SOURCES "src/*.c" "src/*.h")
|
||||
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
|
||||
|
||||
if(UNIX)
|
||||
set(lcms2_C_FLAGS "${lcms2_C_FLAGS} -fPIC")
|
||||
set(lcms2_C_FLAGS "${lcms2_C_FLAGS};-fPIC")
|
||||
endif()
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
LIBRARY_OUTPUT_NAME "${PROJECT_NAME}"
|
||||
COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} ${lcms2_C_FLAGS}"
|
||||
COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};${lcms2_C_FLAGS}"
|
||||
LINK_OPTIONS "${PLATFORM_LINK_OPTIONS}"
|
||||
PUBLIC_HEADER "${HEADERS}"
|
||||
)
|
||||
|
||||
|
||||
@@ -18,11 +18,12 @@ set(SOURCES
|
||||
add_library(${PROJECT_NAME} STATIC ${HEADERS} ${SOURCES})
|
||||
|
||||
if(UNIX)
|
||||
set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS} -fPIC")
|
||||
set(pystring_CXX_FLAGS "${pystring_CXX_FLAGS};-fPIC")
|
||||
endif()
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} ${pystring_CXX_FLAGS}"
|
||||
COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};${pystring_CXX_FLAGS}"
|
||||
LINK_OPTIONS "${PLATFORM_LINK_OPTIONS}"
|
||||
PUBLIC_HEADER "${HEADERS}"
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
# Checks for ARM NEON availability
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
set(_cmake_osx_architectures_orig "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64")
|
||||
endif()
|
||||
|
||||
set(source_code "
|
||||
#include <arm_neon.h>
|
||||
int main()
|
||||
{
|
||||
float32x4_t v = vdupq_n_f32(0);
|
||||
return 0;
|
||||
}")
|
||||
|
||||
check_cxx_source_compiles ("${source_code}" COMPILER_SUPPORTS_ARM_NEON)
|
||||
|
||||
set(CMAKE_OSX_ARCHITECTURES "${_cmake_osx_architectures_orig}")
|
||||
|
||||
unset(_cmake_osx_architectures_orig)
|
||||
mark_as_advanced(COMPILER_SUPPORTS_ARM_NEON)
|
||||
@@ -0,0 +1,60 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
set(_cmake_cxx_flags_orig "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64;x86_64"
|
||||
OR "${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64;arm64"))
|
||||
set(__universal_build 1)
|
||||
set(_cmake_osx_architectures_orig "${CMAKE_OSX_ARCHITECTURES}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "/w /arch:AVX")
|
||||
elseif(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -mavx")
|
||||
endif()
|
||||
|
||||
if (APPLE AND __universal_build)
|
||||
# Force the test to build under x86_64
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||
# Apple has an automatic translation layer from SSE to ARM Neon.
|
||||
endif()
|
||||
|
||||
set(AVX_CODE "
|
||||
#include <iostream>
|
||||
#include <immintrin.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
// Create two arrays of floats
|
||||
float a[8] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
|
||||
float b[8] = {2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0};
|
||||
|
||||
_mm256_add_ps(_mm256_load_ps(a), _mm256_load_ps(b));
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/avx_test.cpp" "${AVX_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX")
|
||||
try_compile(COMPILER_SUPPORTS_AVX
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/avx_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_AVX)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX - Failed")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${_cmake_cxx_flags_orig}")
|
||||
unset(_cmake_cxx_flags_orig)
|
||||
|
||||
if(__universal_build)
|
||||
set(CMAKE_OSX_ARCHITECTURES "${_cmake_osx_architectures_orig}")
|
||||
unset(_cmake_osx_architectures_orig)
|
||||
unset(__universal_build)
|
||||
endif()
|
||||
@@ -0,0 +1,68 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
set(_cmake_cxx_flags_orig "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64;x86_64"
|
||||
OR "${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64;arm64"))
|
||||
set(__universal_build 1)
|
||||
set(_cmake_osx_architectures_orig "${CMAKE_OSX_ARCHITECTURES}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "/w /arch:AVX2")
|
||||
elseif(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -mavx2 -mfma -mf16c")
|
||||
endif()
|
||||
|
||||
if (APPLE AND __universal_build)
|
||||
# Force the test to build under x86_64
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||
# Apple has an automatic translation layer from SSE to ARM Neon.
|
||||
endif()
|
||||
|
||||
set(AVX2_CODE "
|
||||
#include <immintrin.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
__m256i a = _mm256_set_epi32(1, 2, 3, 4, 5, 6, 7, 8);
|
||||
__m256i b = _mm256_set_epi32(8, 7, 6, 5, 4, 3, 2, 1);
|
||||
__m256i result = _mm256_add_epi32(a, b);
|
||||
|
||||
__m256 result_f16c = _mm256_cvtph_ps(_mm_set_epi16(1, 2, 3, 4, 5, 6, 7, 8));
|
||||
|
||||
__m256 result_fma = _mm256_fmadd_ps(
|
||||
_mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0),
|
||||
_mm256_set_ps(8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0),
|
||||
_mm256_set_ps(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/avx2_test.cpp" "${AVX2_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX2")
|
||||
try_compile(COMPILER_SUPPORTS_AVX2
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/avx2_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_AVX2)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX2 - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX2 - Failed")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${_cmake_cxx_flags_orig}")
|
||||
unset(_cmake_cxx_flags_orig)
|
||||
|
||||
if(__universal_build)
|
||||
set(CMAKE_OSX_ARCHITECTURES "${_cmake_osx_architectures_orig}")
|
||||
unset(_cmake_osx_architectures_orig)
|
||||
unset(__universal_build)
|
||||
endif()
|
||||
@@ -0,0 +1,56 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
set(_cmake_cxx_flags_orig "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64;x86_64"
|
||||
OR "${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64;arm64"))
|
||||
set(__universal_build 1)
|
||||
set(_cmake_osx_architectures_orig "${CMAKE_OSX_ARCHITECTURES}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "/w /arch:AVX512")
|
||||
elseif(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -mavx512f")
|
||||
endif()
|
||||
|
||||
if (APPLE AND __universal_build)
|
||||
# Force the test to build under x86_64
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||
# Apple has an automatic translation layer from SSE to ARM Neon.
|
||||
endif()
|
||||
|
||||
set(AVX512_CODE "
|
||||
#include <immintrin.h>
|
||||
|
||||
int main() {
|
||||
__m512i vec = _mm512_set1_epi32(42);
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/avx512_test.cpp" "${AVX512_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX512")
|
||||
try_compile(COMPILER_SUPPORTS_AVX512
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/avx512_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_AVX512)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX512 - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_AVX512 - Failed")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${_cmake_cxx_flags_orig}")
|
||||
unset(_cmake_cxx_flags_orig)
|
||||
|
||||
if(__universal_build)
|
||||
set(CMAKE_OSX_ARCHITECTURES "${_cmake_osx_architectures_orig}")
|
||||
unset(_cmake_osx_architectures_orig)
|
||||
unset(__universal_build)
|
||||
endif()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user