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,381 +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
|
||||
# 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_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
|
||||
# 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_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
|
||||
# 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_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
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -404,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:
|
||||
@@ -418,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
|
||||
|
||||
+157
-206
@@ -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
|
||||
@@ -336,11 +316,12 @@ jobs:
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
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 }},
|
||||
@@ -349,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'
|
||||
@@ -441,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: |
|
||||
@@ -505,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 }},
|
||||
@@ -520,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
|
||||
@@ -613,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 \
|
||||
|
||||
@@ -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
|
||||
|
||||
+196
-17
@@ -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,7 +29,7 @@ endif()
|
||||
# Project definition.
|
||||
|
||||
project(OpenColorIO
|
||||
VERSION 2.2.1
|
||||
VERSION 2.3.2
|
||||
DESCRIPTION "OpenColorIO (OCIO) is a complete color management solution"
|
||||
HOMEPAGE_URL https://github.com/AcademySoftwareFoundation/OpenColorIO
|
||||
LANGUAGES CXX C)
|
||||
@@ -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
|
||||
|
||||
@@ -291,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/)
|
||||
@@ -305,8 +484,8 @@ 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")
|
||||
|
||||
+1
-1
@@ -243,7 +243,7 @@ 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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
Presentations & Publications
|
||||
============================
|
||||
|
||||
* ASWF Open Source Days 2023 `video <https://www.youtube.com/watch?v=y-oq693Wl8g>`_
|
||||
|
||||
* OCIO wins the Pipeline Tool award at DigiPro 2022! `video <https://vimeo.com/742052701>`_
|
||||
|
||||
* ASWF Open Source Days 2022 `video <https://www.youtube.com/watch?v=WzFlz1HeNdI>`_
|
||||
|
||||
@@ -4,28 +4,45 @@
|
||||
|
||||
.. _aces_cg:
|
||||
|
||||
ACES CG Config
|
||||
==============
|
||||
OCIO CG Config for ACES
|
||||
=======================
|
||||
|
||||
The ACES Computer Graphics (CG) config is a simple, lightweight config intended for use
|
||||
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.
|
||||
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 ACES CG Config leverages the high quality ACES implementation built into OCIO itself
|
||||
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 the
|
||||
following string in place of the config path::
|
||||
ocio://cg-config-v1.0.0_aces-v1.3_ocio-v2.1
|
||||
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:
|
||||
|
||||
The default built-in config is currently the ACES CG Config, so the even simpler:
|
||||
``ocio://default`` may be used instead. Note however, that the value of the default
|
||||
config may evolve over time.
|
||||
``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
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
.. _aces_studio:
|
||||
|
||||
ACES Studio Config
|
||||
==================
|
||||
OCIO Studio Config for ACES
|
||||
===========================
|
||||
|
||||
The ACES Studio Config is the successor to the widely used :ref:`ACES config <aces_1.0.3>`
|
||||
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 widely used in the VFX and post-production
|
||||
industries.
|
||||
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`.
|
||||
@@ -20,11 +20,29 @@ 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 ACES Studio Config leverages the high quality ACES implementation built into OCIO itself
|
||||
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 the
|
||||
following string in place of the config path::
|
||||
ocio://studio-config-v1.0.0_aces-v1.3_ocio-v2.1
|
||||
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -305,6 +305,16 @@ 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
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ films as SpiderMan 2 (2004), Surf's Up (2007), Cloudy with a Chance of Meatballs
|
||||
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. Development has continued to be active since
|
||||
then with the 2.1 release in 2021 and the 2.2 release in 2022 adding even more
|
||||
capabilities. Here is more information about our :ref:`upgrading_to_v2`.
|
||||
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
|
||||
|
||||
@@ -24,9 +24,10 @@ Alternatives
|
||||
Python
|
||||
++++++
|
||||
|
||||
If you only need the Python binding, 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.
|
||||
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**::
|
||||
|
||||
@@ -187,10 +188,26 @@ Three ``OCIO_INSTALL_EXT_PACKAGES`` options are available::
|
||||
Existing Install Hints
|
||||
++++++++++++++++++++++
|
||||
|
||||
When using libraries already on your system, the CMake variable
|
||||
``-D <Package Name>_ROOT=<Path>`` may be used to specify the path to the include and
|
||||
library root directory rather than have CMake try to find it. The package names used
|
||||
by OCIO are as follows (note that these are case-sensitive):
|
||||
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 ``-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:
|
||||
|
||||
@@ -214,21 +231,6 @@ Optional:
|
||||
- ``GLUT``
|
||||
- ``Python``
|
||||
|
||||
There are scenarios in which some of the dependencies may not be compiled into an
|
||||
OCIO dynamic library. This is more likely when OCIO does not download the packages
|
||||
itself. In these cases, it may be helpful to additionally specify the CMake variable
|
||||
``-D <Package Name>_STATIC_LIBRARY=ON``. The following package names support this hint:
|
||||
``expat``, ``yaml-cpp``, ``Imath``, ``lcms2``, ``ZLIB``, and ``minizip-ng``.
|
||||
|
||||
Rather than using ``_ROOT``, and possibly ``_STATIC_LIBRARY``, you may instead use
|
||||
``-D <Package Name>_LIBRARY=<Path>`` and ``-D <Package Name>_INCLUDE_DIR=<Path>``.
|
||||
In this case, the library path will control whether a static or dynamic library is used.
|
||||
It may also be used to handle situations where the library and/or include files are not
|
||||
in the typical location relative to the root directory.
|
||||
|
||||
The OCIO `CMake find modules <https://github.com/AcademySoftwareFoundation/OpenColorIO/tree/main/share/cmake/modules>`_
|
||||
may be consulted for more detail on the handling of a given package and the CMake
|
||||
variables it uses.
|
||||
|
||||
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
|
||||
@@ -263,6 +265,7 @@ 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:
|
||||
@@ -276,14 +279,33 @@ Here are the most common OCIO-specific CMake options (the default values are sho
|
||||
- ``-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_SSE=ON`` (Set to OFF to turn off SSE CPU performance optimizations)
|
||||
- ``-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 reendering)
|
||||
- ``-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
|
||||
@@ -384,7 +406,7 @@ Windows
|
||||
While build environments may vary between users, the recommended way to build OCIO from source on
|
||||
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>`_
|
||||
@@ -396,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
|
||||
@@ -422,14 +448,26 @@ 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.
|
||||
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
|
||||
|
||||
@@ -10,6 +10,7 @@ Releases
|
||||
.. toctree::
|
||||
:caption: Upgrading to v2
|
||||
|
||||
ocio_2_3
|
||||
ocio_2_2
|
||||
ocio_2_1
|
||||
ocio_2_0
|
||||
|
||||
@@ -25,8 +25,8 @@ 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
|
||||
****************
|
||||
@@ -657,3 +657,5 @@ For more detail, please see the GitHub release pages:
|
||||
`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>`_
|
||||
|
||||
@@ -12,8 +12,9 @@ Timeline
|
||||
OpenColorIO 2.1 was delivered in August 2021 and is in the VFX Reference Platform for
|
||||
calendar year 2022.
|
||||
|
||||
New Features
|
||||
============
|
||||
|
||||
New Feature Guide
|
||||
=================
|
||||
|
||||
ACES 1.3 Gamut Compression
|
||||
**************************
|
||||
@@ -171,3 +172,5 @@ For more detail, please see the GitHub release pages:
|
||||
`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>`_
|
||||
|
||||
+19
-17
@@ -13,8 +13,8 @@ OpenColorIO 2.2 was delivered in October 2022 and is in the VFX Reference Platfo
|
||||
calendar year 2023.
|
||||
|
||||
|
||||
New Features
|
||||
============
|
||||
New Feature Guide
|
||||
=================
|
||||
|
||||
Built-in Configs
|
||||
****************
|
||||
@@ -281,14 +281,14 @@ 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.
|
||||
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.
|
||||
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).
|
||||
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
|
||||
@@ -363,26 +363,26 @@ 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.
|
||||
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.)
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
|
||||
@@ -393,3 +393,5 @@ 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 |
@@ -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
|
||||
@@ -652,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.
|
||||
@@ -690,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
|
||||
@@ -720,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.
|
||||
*
|
||||
@@ -843,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.)
|
||||
*
|
||||
@@ -927,8 +1025,6 @@ public:
|
||||
*/
|
||||
int instantiateDisplayFromICCProfile(const char * ICCProfileFilepath);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* \brief
|
||||
*
|
||||
@@ -1076,8 +1172,7 @@ public:
|
||||
void clearViewTransforms();
|
||||
|
||||
/**
|
||||
* \defgroup Methods related to named transforms.
|
||||
* @{
|
||||
* Methods related to named transforms.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1120,8 +1215,6 @@ public:
|
||||
/// Clear all named transforms.
|
||||
void clearNamedTransforms();
|
||||
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// File Rules
|
||||
//
|
||||
@@ -1250,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
|
||||
@@ -1263,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.
|
||||
*
|
||||
@@ -1275,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
|
||||
@@ -1302,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,
|
||||
@@ -1319,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);
|
||||
@@ -1381,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();
|
||||
|
||||
@@ -2031,8 +2182,7 @@ private:
|
||||
const Impl * getImpl() const { return m_impl; }
|
||||
};
|
||||
|
||||
/** \defgroup ColorSpaceSetOperators
|
||||
* @{
|
||||
/** ColorSpaceSetOperators
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -2072,8 +2222,6 @@ extern OCIOEXPORT ConstColorSpaceSetRcPtr operator&&(const ConstColorSpaceSetRcP
|
||||
extern OCIOEXPORT ConstColorSpaceSetRcPtr operator-(const ConstColorSpaceSetRcPtr & lcss,
|
||||
const ConstColorSpaceSetRcPtr & rcss);
|
||||
|
||||
/** @}*/
|
||||
|
||||
|
||||
//
|
||||
// Look
|
||||
@@ -2308,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;
|
||||
|
||||
/**
|
||||
@@ -2491,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
|
||||
@@ -3054,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.
|
||||
@@ -3111,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.
|
||||
**/
|
||||
@@ -3121,6 +3289,7 @@ public:
|
||||
const char * samplerName,
|
||||
unsigned width, unsigned height,
|
||||
TextureType channel,
|
||||
TextureDimensions dimensions,
|
||||
Interpolation interpolation,
|
||||
const float * values) = 0;
|
||||
|
||||
@@ -3372,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;
|
||||
|
||||
@@ -3604,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;
|
||||
@@ -3649,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.
|
||||
@@ -3667,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))
|
||||
* {
|
||||
|
||||
@@ -726,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.
|
||||
@@ -761,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;
|
||||
|
||||
@@ -776,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
|
||||
@@ -852,12 +845,6 @@ extern OCIOEXPORT const char * ROLE_INTERCHANGE_SCENE;
|
||||
*/
|
||||
extern OCIOEXPORT const char * ROLE_INTERCHANGE_DISPLAY;
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** \defgroup VarsSharedView
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*!rst::
|
||||
Shared View
|
||||
***********
|
||||
@@ -870,12 +857,6 @@ Shared View
|
||||
*/
|
||||
extern OCIOEXPORT const char * OCIO_VIEW_USE_DISPLAY_NAME;
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** \defgroup VarsFormatMetadata
|
||||
* @{
|
||||
*/
|
||||
|
||||
// TODO: Move to .rst
|
||||
/*!rst::
|
||||
FormatMetadata
|
||||
@@ -929,12 +910,6 @@ extern OCIOEXPORT const char * METADATA_NAME;
|
||||
*/
|
||||
extern OCIOEXPORT const char * METADATA_ID;
|
||||
|
||||
/** @}*/
|
||||
|
||||
/** \defgroup VarsCaches
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*!rst::
|
||||
Caches
|
||||
******
|
||||
@@ -963,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.
|
||||
@@ -972,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',
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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 ###
|
||||
|
||||
@@ -32,116 +35,95 @@ if (APPLE)
|
||||
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)
|
||||
###
|
||||
### 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 (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
|
||||
set(_ZLIB_FIND_VERSION "1.2.13")
|
||||
set(_ZLIB_ExternalProject_VERSION ${_ZLIB_FIND_VERSION})
|
||||
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 )
|
||||
|
||||
if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
# ZLIB_USE_STATIC_LIBS is supported only from CMake 3.24+.
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
|
||||
if (ZLIB_STATIC_LIBRARY)
|
||||
set(ZLIB_USE_STATIC_LIBS "${ZLIB_STATIC_LIBRARY}")
|
||||
endif()
|
||||
else() # For CMake < 3.24 since ZLIB_USE_STATIC_LIBS is not available.
|
||||
if(NOT ZLIB_LIBRARY)
|
||||
if(DEFINED CMAKE_FIND_LIBRARY_PREFIXES)
|
||||
set(_ZLIB_ORIG_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
else()
|
||||
set(_ZLIB_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
|
||||
endif()
|
||||
|
||||
if(DEFINED CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
set(_ZLIB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
|
||||
else()
|
||||
set(_ZLIB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
endif()
|
||||
|
||||
# Prefix/suffix for windows.
|
||||
if(WIN32)
|
||||
list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
|
||||
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a")
|
||||
endif()
|
||||
|
||||
# Check if static lib is preferred.
|
||||
if(ZLIB_STATIC_LIBRARY OR ZLIB_USE_STATIC_LIBS)
|
||||
if(WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(_ZLIB_REQUIRED REQUIRED)
|
||||
# Override REQUIRED if package can be installed
|
||||
if(OCIO_INSTALL_EXT_PACKAGES STREQUAL MISSING)
|
||||
set(_ZLIB_REQUIRED "")
|
||||
endif()
|
||||
|
||||
find_package(ZLIB ${_ZLIB_FIND_VERSION} ${_ZLIB_REQUIRED})
|
||||
|
||||
# Restore the original find library ordering
|
||||
if(DEFINED _ZLIB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES "${_ZLIB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}")
|
||||
else()
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES)
|
||||
endif()
|
||||
|
||||
if(DEFINED _ZLIB_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "${_ZLIB_ORIG_CMAKE_FIND_LIBRARY_PREFIXES}")
|
||||
else()
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL NONE)
|
||||
include(InstallZLIB)
|
||||
endif()
|
||||
###############################################################################
|
||||
|
||||
# minizip-ng
|
||||
# https://github.com/zlib-ng/minizip-ng
|
||||
find_package(minizip-ng 3.0.7 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++
|
||||
@@ -149,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)
|
||||
@@ -177,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)
|
||||
@@ -236,15 +285,18 @@ 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()
|
||||
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
@@ -131,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 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 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 ###
|
||||
|
||||
@@ -262,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,25 +1,27 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
@@ -96,7 +98,6 @@ 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.
|
||||
|
||||
@@ -200,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 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 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 ###
|
||||
|
||||
@@ -330,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 OCIO_INSTALL_EXT_PACKAGES 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,21 +1,29 @@
|
||||
# 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:
|
||||
# Global targets defined by this module:
|
||||
# MINIZIP::minizip-ng - IMPORTED target, if found
|
||||
#
|
||||
# If minizip-ng is not installed in a standard path, you can use the minizip-ng_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, minizip-ng 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 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
|
||||
@@ -23,6 +31,7 @@
|
||||
#
|
||||
# e.g. Setting MZ_BZIP2=ON will cause linking issue since OCIO will not be linked against BZIP2.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
### Try to find package ###
|
||||
|
||||
@@ -40,7 +49,7 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
# Search for minizip-ng-config.cmake
|
||||
find_package(minizip-ng ${minizip-ng_FIND_VERSION} CONFIG QUIET)
|
||||
endif()
|
||||
|
||||
|
||||
if (minizip-ng_FOUND)
|
||||
get_target_property(minizip-ng_INCLUDE_DIR MINIZIP::minizip-ng INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(minizip-ng_LIBRARY MINIZIP::minizip-ng LOCATION)
|
||||
@@ -106,7 +115,9 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
include/minizip-ng
|
||||
include/minizip
|
||||
minizip-ng/include
|
||||
minizip/include
|
||||
)
|
||||
|
||||
# Minizip-ng uses prefix "lib" on all platform by default.
|
||||
@@ -176,120 +187,12 @@ endif()
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
if(NOT TARGET MINIZIP::minizip-ng)
|
||||
|
||||
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 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 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")
|
||||
|
||||
# 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)
|
||||
message(STATUS "Installing minizip-ng: ${minizip-ng_LIBRARY} (version \"${minizip-ng_VERSION}\")")
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Configure target ###
|
||||
|
||||
@@ -302,4 +205,16 @@ if(_minizip-ng_TARGET_CREATE)
|
||||
mark_as_advanced(minizip-ng_INCLUDE_DIR minizip-ng_LIBRARY minizip-ng_VERSION)
|
||||
|
||||
target_link_libraries(MINIZIP::minizip-ng INTERFACE ZLIB::ZLIB)
|
||||
endif()
|
||||
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 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(_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 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 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,96 +64,11 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
### Install package from source ###
|
||||
### Configure target ###
|
||||
|
||||
if(NOT pystring_FOUND AND OCIO_INSTALL_EXT_PACKAGES 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()
|
||||
|
||||
# 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()
|
||||
|
||||
###############################################################################
|
||||
@@ -166,4 +81,4 @@ if(_pystring_TARGET_CREATE)
|
||||
)
|
||||
|
||||
mark_as_advanced(pystring_INCLUDE_DIR pystring_LIBRARY pystring_VERSION)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,25 +1,31 @@
|
||||
# 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.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
@@ -34,16 +40,26 @@ 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
|
||||
@@ -52,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
|
||||
@@ -84,7 +100,7 @@ if(NOT OCIO_INSTALL_EXT_PACKAGES STREQUAL ALL)
|
||||
# Prefer static lib names
|
||||
set(_yaml-cpp_STATIC_LIB_NAMES
|
||||
"${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)
|
||||
@@ -120,144 +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 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 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()
|
||||
|
||||
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()
|
||||
+25
-63
@@ -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,51 +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)
|
||||
|
||||
# IMPORTED_GLOBAL property must be set to TRUE since alisasing a non-global imported target
|
||||
# is not possible until CMake 3.18+.
|
||||
set_target_properties(OpenEXR::OpenEXR PROPERTIES IMPORTED_GLOBAL TRUE)
|
||||
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
|
||||
@@ -85,19 +44,17 @@ if(NOT OpenEXR_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACK
|
||||
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
|
||||
# Not trying to find ZLIB here since it is a required dependency of OCIO.
|
||||
if(NOT ZLIB_FOUND)
|
||||
find_package(ZLIB)
|
||||
if(NOT ZLIB_FOUND)
|
||||
message(STATUS "ZLib is required to build OpenEXR.")
|
||||
return()
|
||||
endif()
|
||||
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()
|
||||
@@ -105,8 +62,8 @@ if(NOT OpenEXR_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACK
|
||||
|
||||
# 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()
|
||||
@@ -118,9 +75,9 @@ if(NOT OpenEXR_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACK
|
||||
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)
|
||||
@@ -153,7 +110,7 @@ if(NOT OpenEXR_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACK
|
||||
-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}
|
||||
)
|
||||
@@ -203,7 +160,8 @@ if(NOT OpenEXR_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACK
|
||||
${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
|
||||
@@ -219,7 +177,9 @@ if(NOT OpenEXR_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACK
|
||||
|
||||
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()
|
||||
|
||||
@@ -241,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"
|
||||
@@ -257,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}
|
||||
+27
-19
@@ -7,17 +7,15 @@
|
||||
# CMake's FindZLIB when installing ZLIB manually.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
# ZLIB_FOUND - If FALSE, do not try to link to zlib
|
||||
# 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 - Properties:
|
||||
# IMPORTED_LOCATION ${ZLIB_LIBRARIES}
|
||||
# INTERFACE_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS}
|
||||
# Global targets defined by this module:
|
||||
# ZLIB::ZLIB
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
|
||||
###############################################################################
|
||||
### Create target
|
||||
@@ -34,8 +32,8 @@ if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGE
|
||||
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")
|
||||
@@ -47,8 +45,8 @@ if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGE
|
||||
|
||||
# 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})
|
||||
endif()
|
||||
@@ -70,6 +68,10 @@ if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGE
|
||||
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
|
||||
@@ -134,11 +136,17 @@ if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGE
|
||||
|
||||
add_dependencies(ZLIB::ZLIB ZLIB_install)
|
||||
|
||||
# Setting those variables to follow the same naming as the other OCIO custom find modules.
|
||||
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()
|
||||
|
||||
|
||||
@@ -152,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()
|
||||
@@ -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()
|
||||
|
||||
# MSVC doesn't have flags
|
||||
if(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -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(F16C_CODE "
|
||||
#include <immintrin.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
_mm_cvtph_ps(_mm_set1_epi16(0x3C00));
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/f16c_test.cpp" "${F16C_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_F16C")
|
||||
try_compile(COMPILER_SUPPORTS_F16C
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/f16c_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_F16C)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_F16C - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_F16C - 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()
|
||||
@@ -7,28 +7,30 @@
|
||||
|
||||
include(PackageUtils)
|
||||
include(SelectLibraryConfigurations)
|
||||
include(Colors)
|
||||
include(ocio_handle_dependency)
|
||||
|
||||
if((OCIO_BUILD_TESTS AND OCIO_BUILD_GPU_TESTS) OR OCIO_BUILD_APPS)
|
||||
set(OCIO_GL_ENABLED ON)
|
||||
set(OCIO_USE_GLVND OFF)
|
||||
set(OCIO_EGL_HEADLESS OFF)
|
||||
|
||||
find_package(OpenGL COMPONENTS OpenGL)
|
||||
ocio_handle_dependency(OpenGL COMPONENTS OpenGL)
|
||||
if(NOT OpenGL_OpenGL_FOUND AND NOT OPENGL_GLU_FOUND)
|
||||
package_root_message(OpenGL)
|
||||
set(OCIO_GL_ENABLED OFF)
|
||||
endif()
|
||||
|
||||
if(NOT APPLE)
|
||||
# On some Linux platform, the glew-config.cmake is found first so make it explicit
|
||||
# to fall back on the regular search if not found.
|
||||
find_package(GLEW CONFIG QUIET)
|
||||
# On some Linux platform, the glew-config.cmake is found first.
|
||||
# PREFER_CONFIG assure that config mode will be used first and fallback to module mode.
|
||||
ocio_handle_dependency( GLEW PREFER_CONFIG
|
||||
MIN_VERSION 2.1.0
|
||||
RECOMMENDED_VERSION 2.1.0
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
if(NOT GLEW_FOUND)
|
||||
find_package(GLEW)
|
||||
if(NOT GLEW_FOUND)
|
||||
package_root_message(GLEW)
|
||||
set(OCIO_GL_ENABLED OFF)
|
||||
endif()
|
||||
package_root_message(GLEW)
|
||||
set(OCIO_GL_ENABLED OFF)
|
||||
else()
|
||||
# Expected variables GLEW_LIBRARIES and GLEW_INCLUDE_DIRS are missing so create
|
||||
# the mandatory one.
|
||||
@@ -67,7 +69,10 @@ if((OCIO_BUILD_TESTS AND OCIO_BUILD_GPU_TESTS) OR OCIO_BUILD_APPS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(GLUT)
|
||||
ocio_handle_dependency( GLUT
|
||||
MIN_VERSION 3.2.1
|
||||
RECOMMENDED_VERSION 3.2.1
|
||||
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
|
||||
if(NOT GLUT_FOUND)
|
||||
package_root_message(GLUT)
|
||||
set(OCIO_GL_ENABLED OFF)
|
||||
@@ -90,7 +95,7 @@ if((OCIO_BUILD_TESTS AND OCIO_BUILD_GPU_TESTS) OR OCIO_BUILD_APPS)
|
||||
message(STATUS "Can't find EGL without GLVND support; can't render headlessly")
|
||||
set(OCIO_USE_HEADLESS OFF)
|
||||
else()
|
||||
find_package(OpenGL COMPONENTS EGL)
|
||||
ocio_handle_dependency(OpenGL COMPONENTS EGL)
|
||||
if(NOT OpenGL_EGL_FOUND)
|
||||
message(WARNING "EGL component missing; can't render headlessly")
|
||||
set(OCIO_USE_HEADLESS OFF)
|
||||
|
||||
@@ -3,33 +3,67 @@
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
set(_cmake_required_flags_old "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(_cmake_cxx_flags_orig "${CMAKE_CXX_FLAGS}")
|
||||
|
||||
if(NOT CMAKE_SIZE_OF_VOID_P EQUAL 8)
|
||||
# As CheckCXXCompilerFlag implicitly uses CMAKE_CXX_FLAGS some custom flags could trigger
|
||||
# unrelated warnings causing a detection failure. So, the code disables all warnings to focus
|
||||
# on the SSE2 detection.
|
||||
if(USE_MSVC)
|
||||
set(CMAKE_REQUIRED_FLAGS "/w /arch:SSE2")
|
||||
elseif(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_REQUIRED_FLAGS "-w -msse2")
|
||||
endif()
|
||||
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()
|
||||
|
||||
check_cxx_source_compiles ("
|
||||
if(MSVC)
|
||||
# x86_64 always has SSE2
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
|
||||
# Simulate the same message we would get by using check_cxx_source_compiles.
|
||||
message(STATUS "x86_64 always support SSE2 - COMPILER_SUPPORTS_SSE2 - Success")
|
||||
# By setting the variable to 1, tuhe check_cxx_source_compiles will be skipped automatically.
|
||||
set(COMPILER_SUPPORTS_SSE2 1)
|
||||
else()
|
||||
check_cxx_compiler_flag("/arch:SSE2" COMPILER_SUPPORTS_SSE2)
|
||||
endif()
|
||||
elseif(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -msse2")
|
||||
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(SSE2_CODE "
|
||||
#include <emmintrin.h>
|
||||
int main ()
|
||||
{
|
||||
|
||||
int main()
|
||||
{
|
||||
__m128d a, b;
|
||||
double vals[2] = {0};
|
||||
a = _mm_loadu_pd (vals);
|
||||
b = _mm_add_pd (a,a);
|
||||
_mm_storeu_pd (vals,b);
|
||||
return (0);
|
||||
}"
|
||||
HAVE_SSE2)
|
||||
}
|
||||
")
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${_cmake_required_flags_old}")
|
||||
unset(_cmake_required_flags_old)
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/sse2_test.cpp" "${SSE2_CODE}")
|
||||
|
||||
mark_as_advanced(HAVE_SSE2)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE2")
|
||||
try_compile(COMPILER_SUPPORTS_SSE2
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/sse2_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_SSE2)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE2 - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE2 - 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()
|
||||
|
||||
# MSVC doesn't have flags
|
||||
if(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -msse3")
|
||||
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(SSE3_CODE "
|
||||
#include <pmmintrin.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
_mm_addsub_ps(_mm_setzero_ps(), _mm_setzero_ps());
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/sse3_test.cpp" "${SSE3_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE3")
|
||||
try_compile(COMPILER_SUPPORTS_SSE3
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/sse3_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_SSE3)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE3 - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE3 - 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()
|
||||
|
||||
# MSVC doesn't have flags
|
||||
if(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -msse4")
|
||||
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(SSE4_CODE "
|
||||
#include <smmintrin.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
_mm_blend_epi16(_mm_setzero_si128(), _mm_setzero_si128(), 0);
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/sse4_test.cpp" "${SSE4_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE4")
|
||||
try_compile(COMPILER_SUPPORTS_SSE4
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/sse4_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_SSE4)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE4 - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE4 - 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()
|
||||
|
||||
# MSVC doesn't have flags
|
||||
if(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -msse4.2")
|
||||
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(SSE42_CODE "
|
||||
#include <nmmintrin.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
_mm_cmpgt_epi64(_mm_set_epi64x(5, 10), _mm_set_epi64x(8, 5));
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/sse42_test.cpp" "${SSE42_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE42")
|
||||
try_compile(COMPILER_SUPPORTS_SSE42
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/sse42_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_SSE42)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE42 - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE42 - 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,70 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
set(_cmake_required_flags_orig "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(_cmake_required_includes_orig "${CMAKE_REQUIRED_INCLUDES}")
|
||||
set(_cmake_osx_architectures_orig "${CMAKE_OSX_ARCHITECTURES}")
|
||||
|
||||
if(APPLE AND COMPILER_SUPPORTS_ARM_NEON)
|
||||
|
||||
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64;x86_64" OR
|
||||
"${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64;arm64")
|
||||
# universal build
|
||||
# Force the test to build under arm64
|
||||
set(CMAKE_OSX_ARCHITECTURES "arm64")
|
||||
endif()
|
||||
|
||||
set(SSE2NEON_CODE "
|
||||
#include <sse2neon.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
// SSE2
|
||||
__m128d a, b;
|
||||
double vals[2] = {0};
|
||||
a = _mm_loadu_pd (vals);
|
||||
b = _mm_add_pd (a,a);
|
||||
_mm_storeu_pd (vals,b);
|
||||
|
||||
// SSE3
|
||||
_mm_addsub_ps(_mm_setzero_ps(), _mm_setzero_ps());
|
||||
|
||||
// SSSE3
|
||||
_mm_shuffle_epi8(_mm_setzero_si128(), _mm_setzero_si128());
|
||||
|
||||
// SSE4
|
||||
_mm_blend_epi16(_mm_setzero_si128(), _mm_setzero_si128(), 0);
|
||||
|
||||
// SSE 4.2
|
||||
_mm_cmpgt_epi64(_mm_set_epi64x(5, 10), _mm_set_epi64x(8, 5));
|
||||
|
||||
return (0);
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/sse2neon_test.cpp" "${SSE2NEON_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE_WITH_SSE2NEON")
|
||||
try_compile(COMPILER_SUPPORTS_SSE_WITH_SSE2NEON
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/sse2neon_test.cpp"
|
||||
COMPILE_DEFINITIONS "-I${sse2neon_INCLUDE_DIR}"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_SSE_WITH_SSE2NEON)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE_WITH_SSE2NEON - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSE_WITH_SSE2NEON - Failed")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS "${_cmake_required_flags_orig}")
|
||||
set(CMAKE_REQUIRED_INCLUDES "${_cmake_required_includes_orig}")
|
||||
set(CMAKE_OSX_ARCHITECTURES "${_cmake_osx_architectures_orig}")
|
||||
|
||||
unset(_cmake_required_flags_orig)
|
||||
unset(_cmake_required_includes_orig)
|
||||
unset(_cmake_osx_architectures_orig)
|
||||
|
||||
@@ -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()
|
||||
|
||||
# MSVC doesn't have flags
|
||||
if(USE_GCC OR USE_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "-w -mssse3")
|
||||
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(SSSE3_CODE "
|
||||
#include <tmmintrin.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
_mm_shuffle_epi8(_mm_setzero_si128(), _mm_setzero_si128());
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/ssse3_test.cpp" "${SSSE3_CODE}")
|
||||
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSSE3")
|
||||
try_compile(COMPILER_SUPPORTS_SSSE3
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp"
|
||||
"${CMAKE_BINARY_DIR}/CMakeTmp/ssse3_test.cpp"
|
||||
)
|
||||
|
||||
if(COMPILER_SUPPORTS_SSSE3)
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSSE3 - Success")
|
||||
else()
|
||||
message(STATUS "Performing Test COMPILER_SUPPORTS_SSSE3 - 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,98 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Check if compiler supports X86 SIMD extensions
|
||||
|
||||
# These checks use try_compile instead of check_cxx_source_compiles because the latter was causing
|
||||
# false positives on Apple ARM architectures.
|
||||
|
||||
include(CheckSupportAVX)
|
||||
include(CheckSupportAVX2)
|
||||
include(CheckSupportAVX512)
|
||||
|
||||
include(CheckSupportSSE42)
|
||||
include(CheckSupportSSE4)
|
||||
include(CheckSupportSSSE3)
|
||||
include(CheckSupportSSE3)
|
||||
include(CheckSupportSSE2)
|
||||
include(CheckSupportF16C)
|
||||
|
||||
if(MSVC)
|
||||
if (COMPILER_SUPPORTS_SSE2)
|
||||
set(OCIO_SSE2_ARGS "/arch:SSE2")
|
||||
endif()
|
||||
|
||||
if (COMPILER_SUPPORTS_AVX)
|
||||
set(OCIO_AVX_ARGS "/arch:AVX")
|
||||
endif()
|
||||
|
||||
if (COMPILER_SUPPORTS_AVX2)
|
||||
set(OCIO_AVX2_ARGS "/arch:AVX2")
|
||||
endif()
|
||||
else()
|
||||
if (COMPILER_SUPPORTS_SSE2)
|
||||
set(OCIO_SSE2_ARGS "-msse2")
|
||||
endif()
|
||||
|
||||
if (COMPILER_SUPPORTS_AVX)
|
||||
set(OCIO_AVX_ARGS "-mavx")
|
||||
endif()
|
||||
|
||||
if (COMPILER_SUPPORTS_AVX2)
|
||||
set(OCIO_AVX2_ARGS "-mavx2" "-mfma")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_AVX512} AND NOT ${COMPILER_SUPPORTS_AVX512})
|
||||
message(STATUS "OCIO_USE_AVX512 requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_AVX512 OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_AVX2} AND NOT ${COMPILER_SUPPORTS_AVX2})
|
||||
message(STATUS "OCIO_USE_AVX2 requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_AVX2 OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_AVX} AND NOT ${COMPILER_SUPPORTS_AVX})
|
||||
message(STATUS "OCIO_USE_AVX requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_AVX OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_SSE42} AND NOT ${COMPILER_SUPPORTS_SSE42})
|
||||
message(STATUS "OCIO_USE_SSE42 requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_SSE42 OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_SSE4} AND NOT ${COMPILER_SUPPORTS_SSE4})
|
||||
message(STATUS "OCIO_USE_SSE4 requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_SSE4 OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_SSSE3} AND NOT ${COMPILER_SUPPORTS_SSSE3})
|
||||
message(STATUS "OCIO_USE_SSSE3 requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_SSSE3 OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_SSE3} AND NOT ${COMPILER_SUPPORTS_SSE3})
|
||||
message(STATUS "OCIO_USE_SSE3 requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_SSE3 OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_SSE2} AND NOT ${COMPILER_SUPPORTS_SSE2})
|
||||
message(STATUS "OCIO_USE_SSE2 requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_SSE2 OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_F16C} AND NOT ${COMPILER_SUPPORTS_F16C})
|
||||
message(STATUS "OCIO_USE_F16C requested but compiler does not support, disabling")
|
||||
set(OCIO_USE_F16C OFF)
|
||||
endif()
|
||||
|
||||
if(${OCIO_USE_F16C})
|
||||
if(NOT MSVC)
|
||||
list(APPEND OCIO_AVX_ARGS -mf16c)
|
||||
list(APPEND OCIO_AVX2_ARGS -mf16c)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,16 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
string (ASCII 27 ColorEsc)
|
||||
|
||||
set(ColorReset "${ColorEsc}[m")
|
||||
|
||||
# Error
|
||||
set(ColorError "${ColorEsc}[31m")
|
||||
# Green
|
||||
set(ColorSuccess "${ColorEsc}[32m")
|
||||
# Yellow
|
||||
set(ColorWarning "${ColorEsc}[33m")
|
||||
set(ColorInfo "${ColorEsc}[34m")
|
||||
|
||||
set(ColorBoldWhite "${ColorEsc}[1;37m")
|
||||
@@ -5,72 +5,118 @@
|
||||
###############################################################################
|
||||
# Define the global compilation and link flags.
|
||||
|
||||
set(PLATFORM_COMPILE_FLAGS "")
|
||||
set(PLATFORM_COMPILE_OPTIONS "")
|
||||
set(PLATFORM_LINK_OPTIONS "")
|
||||
|
||||
###############################################################################
|
||||
# Verify SIMD compatibility
|
||||
|
||||
if(OCIO_USE_SIMD)
|
||||
if (OCIO_ARCH_X86)
|
||||
include(CheckSupportX86SIMD)
|
||||
endif()
|
||||
|
||||
if (OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_ARM_NEON)
|
||||
include(CheckSupportSSEUsingSSE2NEON)
|
||||
if(NOT COMPILER_SUPPORTS_SSE_WITH_SSE2NEON)
|
||||
set(OCIO_USE_SSE2NEON OFF)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
set(OCIO_USE_SSE2 OFF)
|
||||
set(OCIO_USE_SSE3 OFF)
|
||||
set(OCIO_USE_SSSE3 OFF)
|
||||
set(OCIO_USE_SSE4 OFF)
|
||||
set(OCIO_USE_SSE42 OFF)
|
||||
set(OCIO_USE_AVX OFF)
|
||||
set(OCIO_USE_AVX2 OFF)
|
||||
set(OCIO_USE_AVX512 OFF)
|
||||
set(OCIO_USE_F16C OFF)
|
||||
|
||||
set(OCIO_USE_SSE2NEON OFF)
|
||||
endif()
|
||||
|
||||
if (NOT COMPILER_SUPPORTS_SSE2 AND NOT COMPILER_SUPPORTS_SSE_WITH_SSE2NEON AND
|
||||
NOT COMPILER_SUPPORTS_SSE3 AND NOT COMPILER_SUPPORTS_SSSE3 AND
|
||||
NOT COMPILER_SUPPORTS_SSE4 AND NOT COMPILER_SUPPORTS_SSE42 AND
|
||||
NOT COMPILER_SUPPORTS_AVX AND NOT COMPILER_SUPPORTS_AVX2 AND NOT COMPILER_SUPPORTS_AVX512 AND
|
||||
NOT COMPILER_SUPPORTS_F16C)
|
||||
message(STATUS "Disabling SIMD optimizations, as the target doesn't support them")
|
||||
set(OCIO_USE_SIMD OFF)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# Compile flags
|
||||
|
||||
if(USE_MSVC)
|
||||
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /DUSE_MSVC")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/DUSE_MSVC")
|
||||
|
||||
# /we4062 Enables warning in switch when an enumeration value is not explicitly handled.
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /EHsc /DWIN32 /we4062")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/EHsc;/DWIN32;/we4062")
|
||||
|
||||
if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 17)
|
||||
# Inheriting from std::iterator is deprecated starting with C++17 and Yaml 0.6.3 does that.
|
||||
set(PLATFORM_COMPILE_FLAGS
|
||||
"${PLATFORM_COMPILE_FLAGS} /D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING"
|
||||
set(PLATFORM_COMPILE_OPTIONS
|
||||
"${PLATFORM_COMPILE_OPTIONS};/D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Explicitely specify the default warning level i.e. /W3.
|
||||
# Note: Do not use /Wall (i.e. /W4) which adds 'informational' warnings.
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /W3")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/W3")
|
||||
|
||||
# Do enable C4701 (Potentially uninitialized local variable 'name' used), which is level 4.
|
||||
# This is because strtoX-based from_chars leave the value variable unmodified.
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /we4701")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/we4701")
|
||||
|
||||
if(OCIO_WARNING_AS_ERROR)
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} /WX")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/WX")
|
||||
endif()
|
||||
|
||||
elseif(USE_CLANG)
|
||||
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -DUSE_CLANG")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-DUSE_CLANG")
|
||||
|
||||
# Use of 'register' specifier must be removed for C++17 support.
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Wno-deprecated-register")
|
||||
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-Wno-deprecated-register")
|
||||
elseif(USE_GCC)
|
||||
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -DUSE_GCC")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-DUSE_GCC")
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
if(USE_GCC OR USE_CLANG)
|
||||
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Wall")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-Wall")
|
||||
|
||||
# Add more warning detection.
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Wextra")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-Wextra")
|
||||
|
||||
# -Wswitch-enum Enables warning in switch when an enumeration value is not explicitly handled.
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Wswitch-enum")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-Wswitch-enum")
|
||||
|
||||
if(OCIO_WARNING_AS_ERROR)
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Werror")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-Werror")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# TODO: There are still some deprecated methods.
|
||||
set(PLATFORM_COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS} -Wno-deprecated-declarations")
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-Wno-deprecated-declarations")
|
||||
endif()
|
||||
|
||||
if(OCIO_ENABLE_SANITIZER)
|
||||
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};-fno-omit-frame-pointer;-fsanitize=address;-fsanitize=undefined")
|
||||
set(PLATFORM_LINK_OPTIONS "${PLATFORM_LINK_OPTIONS};-fsanitize=address;-fsanitize=undefined")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# An advanced variable will not be displayed in any of the cmake GUIs
|
||||
|
||||
mark_as_advanced(PLATFORM_COMPILE_FLAGS)
|
||||
mark_as_advanced(PLATFORM_COMPILE_OPTIONS)
|
||||
mark_as_advanced(PLATFORM_LINK_OPTIONS)
|
||||
|
||||
|
||||
###############################################################################
|
||||
@@ -83,21 +129,10 @@ set_unless_defined(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
set_unless_defined(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Define if SSE2 can be used.
|
||||
|
||||
include(CheckSupportSSE2)
|
||||
|
||||
if(NOT HAVE_SSE2)
|
||||
message(STATUS "Disabling SSE optimizations, as the target doesn't support them")
|
||||
set(OCIO_USE_SSE OFF)
|
||||
endif(NOT HAVE_SSE2)
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Define RPATH.
|
||||
|
||||
if (UNIX AND NOT CMAKE_SKIP_RPATH)
|
||||
if (UNIX AND NOT CMAKE_SKIP_RPATH AND NOT CMAKE_INSTALL_RPATH)
|
||||
# With the 'usual' install path structure in mind, search from the bin directory
|
||||
# (i.e. a binary loading a dynamic library) and then from the current directory
|
||||
# (i.e. dynamic library loading another dynamic library).
|
||||
|
||||
@@ -206,7 +206,7 @@ if !DO_CONFIGURE!==1 (
|
||||
-DOCIO_BUILD_TESTS=ON^
|
||||
-DOCIO_BUILD_GPU_TESTS=ON^
|
||||
-DOCIO_BUILD_DOCS=OFF^
|
||||
-DOCIO_USE_SSE=ON^
|
||||
-DOCIO_USE_SIMD=ON^
|
||||
-DOCIO_WARNING_AS_ERROR=ON^
|
||||
-DOCIO_BUILD_JAVA=OFF^
|
||||
"!OCIO_PATH!"
|
||||
|
||||
@@ -114,8 +114,8 @@ def configure_file(src_filename, dst_filename):
|
||||
"""
|
||||
logger.info("Configuring file: {} -> {}".format(src_filename, dst_filename))
|
||||
|
||||
# CMAKE_SOURCE_DIR
|
||||
# CMAKE_BINARY_DIR
|
||||
# PROJECT_SOURCE_DIR
|
||||
# PROJECT_BINARY_DIR
|
||||
source_dir = binary_dir = ROOT
|
||||
|
||||
# CMAKE_PROJECT_NAME
|
||||
@@ -145,8 +145,8 @@ def configure_file(src_filename, dst_filename):
|
||||
data = f.read()
|
||||
|
||||
data = data\
|
||||
.replace("@CMAKE_SOURCE_DIR@", source_dir)\
|
||||
.replace("@CMAKE_BINARY_DIR@", binary_dir)\
|
||||
.replace("@PROJECT_SOURCE_DIR@", source_dir)\
|
||||
.replace("@PROJECT_BINARY_DIR@", binary_dir)\
|
||||
.replace("@CMAKE_PROJECT_NAME@", name)\
|
||||
.replace("@CMAKE_PROJECT_VERSION@", version)\
|
||||
.replace("@CMAKE_PROJECT_DESCRIPTION@", desc)\
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
#ifndef INCLUDED_OCIO_AVX_H
|
||||
#define INCLUDED_OCIO_AVX_H
|
||||
|
||||
#include "CPUInfo.h"
|
||||
#if OCIO_USE_AVX
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
#include <OpenColorIO/OpenColorIO.h>
|
||||
#include "BitDepthUtils.h"
|
||||
|
||||
// Macros for alignment declarations
|
||||
#define AVX_SIMD_BYTES 32
|
||||
#define AVX_ALIGN(decl) alignas(AVX_SIMD_BYTES) decl
|
||||
|
||||
namespace OCIO_NAMESPACE
|
||||
{
|
||||
|
||||
inline __m256 avx_movelh_ps(__m256 a, __m256 b)
|
||||
{
|
||||
return _mm256_castpd_ps(_mm256_unpacklo_pd(_mm256_castps_pd(a), _mm256_castps_pd(b)));
|
||||
}
|
||||
|
||||
inline __m256 avx_movehl_ps(__m256 a, __m256 b)
|
||||
{
|
||||
// NOTE: this is a and b are reversed to match sse2 movhlps which is different than unpckhpd
|
||||
return _mm256_castpd_ps(_mm256_unpackhi_pd(_mm256_castps_pd(b), _mm256_castps_pd(a)));
|
||||
}
|
||||
|
||||
inline __m256 avx_clamp(__m256 value, const __m256& maxValue)
|
||||
{
|
||||
value = _mm256_max_ps(value, _mm256_setzero_ps());
|
||||
return _mm256_min_ps(value, maxValue);
|
||||
}
|
||||
|
||||
inline void avxRGBATranspose_4x4_4x4(__m256 row0, __m256 row1, __m256 row2, __m256 row3,
|
||||
__m256 &out_r, __m256 &out_g, __m256 &out_b, __m256 &out_a )
|
||||
{
|
||||
// the rgba transpose result will look this
|
||||
//
|
||||
// 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
|
||||
// r0, g0, b0, a0 | r1, g1, b1, a1 r0, r2, r4, r6 | r1, r3, r5, r7
|
||||
// r2, g2, b2, a2 | r3, g3, b3, a3 <==> g0, g2, g4, g6 | g1, g3, g5, g7
|
||||
// r4, g4, b4, a4 | r5, g5, b5, a5 <==> b0, b2, b4, b6 | b1, b3, b5, b7
|
||||
// r6, g6, b6, a6 | r7, g7, b7, a7 a0, a2, a4, a6 | a1, a4, a5, a7
|
||||
|
||||
// each 128 lane is transposed independently,
|
||||
// the channel values end up with a even/odd shuffled order because of this.
|
||||
// if exact order is important more cross lane shuffling is needed
|
||||
|
||||
__m256 tmp0 = _mm256_unpacklo_ps(row0, row1);
|
||||
__m256 tmp2 = _mm256_unpacklo_ps(row2, row3);
|
||||
__m256 tmp1 = _mm256_unpackhi_ps(row0, row1);
|
||||
__m256 tmp3 = _mm256_unpackhi_ps(row2, row3);
|
||||
|
||||
out_r = avx_movelh_ps(tmp0, tmp2);
|
||||
out_g = avx_movehl_ps(tmp2, tmp0);
|
||||
out_b = avx_movelh_ps(tmp1, tmp3);
|
||||
out_a = avx_movehl_ps(tmp3, tmp1);
|
||||
|
||||
}
|
||||
|
||||
inline __m256i avx_load_u8(__m128i a)
|
||||
{
|
||||
__m128i b = _mm_shuffle_epi32(a, _MM_SHUFFLE(1,0,3,1));
|
||||
b = _mm_cvtepu8_epi32(b);
|
||||
a = _mm_cvtepu8_epi32(a);
|
||||
|
||||
return _mm256_insertf128_si256(_mm256_castsi128_si256(a), b, 1);
|
||||
}
|
||||
|
||||
inline __m128i avx_pack_u8(__m256i a, __m256i b)
|
||||
{
|
||||
const __m128i lo0_shuf = _mm_setr_epi8( 0, 4, 8,12, -1,-1,-1, -1, -1,-1,-1,-1, -1,-1,-1,-1);
|
||||
const __m128i lo1_shuf = _mm_setr_epi8( -1,-1,-1,-1, 0, 4, 8, 12, -1,-1,-1,-1, -1,-1,-1,-1);
|
||||
const __m128i hi0_shuf = _mm_setr_epi8( -1,-1,-1,-1, -1,-1,-1, -1, 0, 4, 8, 12, -1,-1,-1,-1);
|
||||
const __m128i hi1_shuf = _mm_setr_epi8( -1,-1,-1,-1, -1,-1,-1, -1, -1,-1,-1,-1, 0, 4, 8, 12);
|
||||
|
||||
__m128i lo0 = _mm_shuffle_epi8(_mm256_castsi256_si128(a), lo0_shuf);
|
||||
__m128i lo1 = _mm_shuffle_epi8(_mm256_extractf128_si256(a, 1), lo1_shuf);
|
||||
|
||||
__m128i hi0 = _mm_shuffle_epi8(_mm256_castsi256_si128(b), hi0_shuf);
|
||||
__m128i hi1 = _mm_shuffle_epi8(_mm256_extractf128_si256(b, 1), hi1_shuf);
|
||||
|
||||
return _mm_or_si128(_mm_or_si128(_mm_or_si128(lo0, lo1), hi0), hi1);
|
||||
}
|
||||
|
||||
// Note Packing functions perform no 0.0 - 1.0 normalization
|
||||
// but perform 0 - max value clamping for integer formats
|
||||
template<BitDepth BD> struct AVXRGBAPack {};
|
||||
|
||||
template <>
|
||||
struct AVXRGBAPack<BIT_DEPTH_UINT8>
|
||||
{
|
||||
static inline void Load(const uint8_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
__m256i rgba_00_07 = _mm256_loadu_si256((const __m256i*)in);
|
||||
|
||||
__m128i rgba_00_03 =_mm256_castsi256_si128(rgba_00_07);
|
||||
__m128i rgba_04_07 =_mm256_extractf128_si256(rgba_00_07, 1);
|
||||
|
||||
// : 0, 1, 2, 3 | 4, 5, 6, 7 | 8, 9, 10, 11 | 12, 13, 14, 15
|
||||
// rgba_x03 : r0, g0, b0, a0 | r1, g1, b1, a1 | r2, g2, b2, a2 | r3, g3, b3, a3
|
||||
// rgba_x47 : r4, g4, b4, a4 | r5, g5, b5, a5 | r6, g6, b6, a6 | r7, g7, b7, a7
|
||||
|
||||
__m256 rgba0 = _mm256_cvtepi32_ps(avx_load_u8(rgba_00_03));
|
||||
__m256 rgba1 = _mm256_cvtepi32_ps(avx_load_u8(_mm_shuffle_epi32(rgba_00_03, _MM_SHUFFLE(3, 2, 3, 2))));
|
||||
|
||||
__m256 rgba2 = _mm256_cvtepi32_ps(avx_load_u8(rgba_04_07));
|
||||
__m256 rgba3 = _mm256_cvtepi32_ps(avx_load_u8(_mm_shuffle_epi32(rgba_04_07, _MM_SHUFFLE(3, 2, 3, 2))));
|
||||
|
||||
avxRGBATranspose_4x4_4x4(rgba0, rgba1, rgba2, rgba3, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint8_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
const __m256 maxValue = _mm256_set1_ps(255.0f);
|
||||
|
||||
avxRGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
rgba0 = avx_clamp(rgba0, maxValue);
|
||||
rgba1 = avx_clamp(rgba1, maxValue);
|
||||
rgba2 = avx_clamp(rgba2, maxValue);
|
||||
rgba3 = avx_clamp(rgba3, maxValue);
|
||||
|
||||
// NOTE note using cvtps which will round based on MXCSR register defaults to _MM_ROUND_NEAREST
|
||||
__m256i rgba01 = _mm256_cvtps_epi32(rgba0);
|
||||
__m256i rgba23 = _mm256_cvtps_epi32(rgba1);
|
||||
__m256i rgba45 = _mm256_cvtps_epi32(rgba2);
|
||||
__m256i rgba67 = _mm256_cvtps_epi32(rgba3);
|
||||
|
||||
__m128i lo = avx_pack_u8(rgba01, rgba23);
|
||||
__m128i hi = avx_pack_u8(rgba45, rgba67);
|
||||
|
||||
__m256i rgba = _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
|
||||
|
||||
_mm256_storeu_si256((__m256i*)out, rgba);
|
||||
}
|
||||
};
|
||||
|
||||
inline __m256i avx_unpack_u16(__m128i a)
|
||||
{
|
||||
__m128i b = _mm_shuffle_epi32(a, _MM_SHUFFLE(1,0,3,2));
|
||||
b = _mm_cvtepu16_epi32(b);
|
||||
a = _mm_cvtepu16_epi32(a);
|
||||
|
||||
return _mm256_insertf128_si256(_mm256_castsi128_si256(a), b, 1);
|
||||
}
|
||||
|
||||
inline __m128i avx_pack_u16(__m256i a)
|
||||
{
|
||||
const __m128i lo_pack_shuffle16 = _mm_setr_epi8( 0, 1, 4, 5,
|
||||
8, 9, 12, 13,
|
||||
-1, -1, -1, -1,
|
||||
-1, -1, -1, -1);
|
||||
|
||||
const __m128i hi_pack_shuffle16 = _mm_setr_epi8(-1, -1, -1, -1,
|
||||
-1, -1, -1, -1,
|
||||
0, 1, 4, 5,
|
||||
8, 9, 12, 13);
|
||||
|
||||
__m128i hi = _mm256_extractf128_si256(a, 1);
|
||||
__m128i lo = _mm256_castsi256_si128(a);
|
||||
|
||||
lo = _mm_shuffle_epi8(lo, lo_pack_shuffle16);
|
||||
hi = _mm_shuffle_epi8(hi, hi_pack_shuffle16);
|
||||
|
||||
return _mm_or_si128(lo, hi);
|
||||
}
|
||||
|
||||
template<BitDepth BD>
|
||||
struct AVXRGBAPack16
|
||||
{
|
||||
typedef typename BitDepthInfo<BD>::Type Type;
|
||||
|
||||
static inline void Load(const Type *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
// const __m256 scale = _mm256_set1_ps(1.0f / (float)BitDepthInfo<BD>::maxValue);
|
||||
__m256i rgba_00_03 = _mm256_loadu_si256((const __m256i*)(in + 0));
|
||||
__m256i rgba_04_07 = _mm256_loadu_si256((const __m256i*)(in + 16));
|
||||
|
||||
__m256 rgba0 = _mm256_cvtepi32_ps(avx_unpack_u16(_mm256_castsi256_si128(rgba_00_03)));
|
||||
__m256 rgba1 = _mm256_cvtepi32_ps(avx_unpack_u16(_mm256_extractf128_si256(rgba_00_03, 1)));
|
||||
__m256 rgba2 = _mm256_cvtepi32_ps(avx_unpack_u16(_mm256_castsi256_si128(rgba_04_07)));
|
||||
__m256 rgba3 = _mm256_cvtepi32_ps(avx_unpack_u16(_mm256_extractf128_si256(rgba_04_07, 1)));
|
||||
|
||||
avxRGBATranspose_4x4_4x4(rgba0, rgba1, rgba2, rgba3, r, g, b, a);
|
||||
}
|
||||
|
||||
static inline void Store(Type *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
__m128i lo, hi;
|
||||
__m256i rgba;
|
||||
const __m256 maxValue = _mm256_set1_ps((float)BitDepthInfo<BD>::maxValue);
|
||||
|
||||
avxRGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
rgba0 = avx_clamp(rgba0, maxValue);
|
||||
rgba1 = avx_clamp(rgba1, maxValue);
|
||||
rgba2 = avx_clamp(rgba2, maxValue);
|
||||
rgba3 = avx_clamp(rgba3, maxValue);
|
||||
|
||||
// NOTE note using cvtps which will round based on MXCSR register defaults to _MM_ROUND_NEAREST
|
||||
__m256i rgba01 = _mm256_cvtps_epi32(rgba0);
|
||||
__m256i rgba23 = _mm256_cvtps_epi32(rgba1);
|
||||
__m256i rgba45 = _mm256_cvtps_epi32(rgba2);
|
||||
__m256i rgba67 = _mm256_cvtps_epi32(rgba3);
|
||||
|
||||
lo = avx_pack_u16(rgba01);
|
||||
hi = avx_pack_u16(rgba23);
|
||||
|
||||
rgba = _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+0), rgba);
|
||||
|
||||
lo = avx_pack_u16(rgba45);
|
||||
hi = avx_pack_u16(rgba67);
|
||||
|
||||
rgba = _mm256_insertf128_si256(_mm256_castsi128_si256(lo), hi, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+16), rgba);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct AVXRGBAPack<BIT_DEPTH_UINT10>
|
||||
{
|
||||
static inline void Load(const uint16_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
AVXRGBAPack16<BIT_DEPTH_UINT10>::Load(in, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint16_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
AVXRGBAPack16<BIT_DEPTH_UINT10>::Store(out, r, g, b, a);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct AVXRGBAPack<BIT_DEPTH_UINT12>
|
||||
{
|
||||
static inline void Load(const uint16_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
AVXRGBAPack16<BIT_DEPTH_UINT12>::Load(in, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint16_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
AVXRGBAPack16<BIT_DEPTH_UINT12>::Store(out, r, g, b, a);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct AVXRGBAPack<BIT_DEPTH_UINT16>
|
||||
{
|
||||
static inline void Load(const uint16_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
AVXRGBAPack16<BIT_DEPTH_UINT16>::Load(in, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint16_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
AVXRGBAPack16<BIT_DEPTH_UINT16>::Store(out, r, g, b, a);
|
||||
}
|
||||
};
|
||||
|
||||
#if OCIO_USE_F16C
|
||||
|
||||
template <>
|
||||
struct AVXRGBAPack<BIT_DEPTH_F16>
|
||||
{
|
||||
static inline void Load(const half *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
|
||||
__m256i rgba_00_03 = _mm256_loadu_si256((const __m256i*)(in + 0));
|
||||
__m256i rgba_04_07 = _mm256_loadu_si256((const __m256i*)(in + 16));
|
||||
|
||||
__m256 rgba0 = _mm256_cvtph_ps(_mm256_castsi256_si128(rgba_00_03));
|
||||
__m256 rgba1 = _mm256_cvtph_ps(_mm256_extractf128_si256(rgba_00_03, 1));
|
||||
__m256 rgba2 = _mm256_cvtph_ps(_mm256_castsi256_si128(rgba_04_07));
|
||||
__m256 rgba3 = _mm256_cvtph_ps(_mm256_extractf128_si256(rgba_04_07, 1));
|
||||
|
||||
avxRGBATranspose_4x4_4x4(rgba0, rgba1, rgba2, rgba3, r, g, b, a);
|
||||
}
|
||||
|
||||
static inline void Store(half *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
__m256i rgba;
|
||||
|
||||
avxRGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
__m128i rgba00_03 = _mm256_cvtps_ph(rgba0, 0);
|
||||
__m128i rgba04_07 = _mm256_cvtps_ph(rgba1, 0);
|
||||
__m128i rgba08_11 = _mm256_cvtps_ph(rgba2, 0);
|
||||
__m128i rgba12_16 = _mm256_cvtps_ph(rgba3, 0);
|
||||
|
||||
rgba = _mm256_insertf128_si256(_mm256_castsi128_si256(rgba00_03), rgba04_07, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+0), rgba);
|
||||
|
||||
rgba = _mm256_insertf128_si256(_mm256_castsi128_si256(rgba08_11), rgba12_16, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+16), rgba);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <>
|
||||
struct AVXRGBAPack<BIT_DEPTH_F32>
|
||||
{
|
||||
static inline void Load(const float *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
__m256 rgba0 = _mm256_loadu_ps(in + 0);
|
||||
__m256 rgba1 = _mm256_loadu_ps(in + 8);
|
||||
__m256 rgba2 = _mm256_loadu_ps(in + 16);
|
||||
__m256 rgba3 = _mm256_loadu_ps(in + 24);
|
||||
|
||||
avxRGBATranspose_4x4_4x4(rgba0, rgba1, rgba2, rgba3, r, g, b, a);
|
||||
|
||||
}
|
||||
|
||||
static inline void Store(float *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
avxRGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
_mm256_storeu_ps(out + 0, rgba0);
|
||||
_mm256_storeu_ps(out + 8, rgba1);
|
||||
_mm256_storeu_ps(out + 16, rgba2);
|
||||
_mm256_storeu_ps(out + 24, rgba3);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace OCIO_NAMESPACE
|
||||
|
||||
#endif // OCIO_USE_AVX
|
||||
#endif // INCLUDED_OCIO_AVX_H
|
||||
@@ -0,0 +1,305 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
#ifndef INCLUDED_OCIO_AVX2_H
|
||||
#define INCLUDED_OCIO_AVX2_H
|
||||
|
||||
#include "CPUInfo.h"
|
||||
#if OCIO_USE_AVX2
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
#include <OpenColorIO/OpenColorIO.h>
|
||||
#include "BitDepthUtils.h"
|
||||
|
||||
// Macros for alignment declarations
|
||||
#define AVX2_SIMD_BYTES 32
|
||||
#define AVX2_ALIGN(decl) alignas(AVX2_SIMD_BYTES) decl
|
||||
|
||||
namespace OCIO_NAMESPACE
|
||||
{
|
||||
|
||||
inline __m256 avx2_movelh_ps(__m256 a, __m256 b)
|
||||
{
|
||||
return _mm256_castpd_ps(_mm256_unpacklo_pd(_mm256_castps_pd(a), _mm256_castps_pd(b)));
|
||||
}
|
||||
|
||||
inline __m256 avx2_movehl_ps(__m256 a, __m256 b)
|
||||
{
|
||||
// NOTE: this is a and b are reversed to match sse2 movhlps which is different than unpckhpd
|
||||
return _mm256_castpd_ps(_mm256_unpackhi_pd(_mm256_castps_pd(b), _mm256_castps_pd(a)));
|
||||
}
|
||||
|
||||
inline __m256 avx2_clamp(__m256 value, const __m256& maxValue)
|
||||
{
|
||||
value = _mm256_max_ps(value, _mm256_setzero_ps());
|
||||
return _mm256_min_ps(value, maxValue);
|
||||
}
|
||||
|
||||
inline void avx2RGBATranspose_4x4_4x4(__m256 row0, __m256 row1, __m256 row2, __m256 row3,
|
||||
|
||||
__m256 &out_r, __m256 &out_g, __m256 &out_b, __m256 &out_a )
|
||||
{
|
||||
// the rgba transpose result will look this
|
||||
//
|
||||
// 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3
|
||||
// r0, g0, b0, a0 | r1, g1, b1, a1 r0, r2, r4, r6 | r1, r3, r5, r7
|
||||
// r2, g2, b2, a2 | r3, g3, b3, a3 <==> g0, g2, g4, g6 | g1, g3, g5, g7
|
||||
// r4, g4, b4, a4 | r5, g5, b5, a5 <==> b0, b2, b4, b6 | b1, b3, b5, b7
|
||||
// r6, g6, b6, a6 | r7, g7, b7, a7 a0, a2, a4, a6 | a1, a4, a5, a7
|
||||
|
||||
// each 128 lane is transposed independently,
|
||||
// the channel values end up with a even/odd shuffled order because of this.
|
||||
// if exact order is important more cross lane shuffling is needed
|
||||
|
||||
__m256 tmp0 = _mm256_unpacklo_ps(row0, row1);
|
||||
__m256 tmp2 = _mm256_unpacklo_ps(row2, row3);
|
||||
__m256 tmp1 = _mm256_unpackhi_ps(row0, row1);
|
||||
__m256 tmp3 = _mm256_unpackhi_ps(row2, row3);
|
||||
|
||||
out_r = avx2_movelh_ps(tmp0, tmp2);
|
||||
out_g = avx2_movehl_ps(tmp2, tmp0);
|
||||
out_b = avx2_movelh_ps(tmp1, tmp3);
|
||||
out_a = avx2_movehl_ps(tmp3, tmp1);
|
||||
|
||||
}
|
||||
|
||||
// Note Packing functions perform no 0.0 - 1.0 normalization
|
||||
// but perform 0 - max value clamping for integer formats
|
||||
template<BitDepth BD> struct AVX2RGBAPack {};
|
||||
|
||||
template <>
|
||||
struct AVX2RGBAPack<BIT_DEPTH_UINT8>
|
||||
{
|
||||
static inline void Load(const uint8_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
__m256i rgba_00_07 = _mm256_loadu_si256((const __m256i*)in);
|
||||
|
||||
__m128i rgba_00_03 =_mm256_castsi256_si128(rgba_00_07);
|
||||
__m128i rgba_04_07 =_mm256_extractf128_si256(rgba_00_07, 1);
|
||||
|
||||
// : 0, 1, 2, 3 | 4, 5, 6, 7 | 8, 9, 10, 11 | 12, 13, 14, 15
|
||||
// rgba_x03 : r0, g0, b0, a0 | r1, g1, b1, a1 | r2, g2, b2, a2 | r3, g3, b3, a3
|
||||
// rgba_x47 : r4, g4, b4, a4 | r5, g5, b5, a5 | r6, g6, b6, a6 | r7, g7, b7, a7
|
||||
|
||||
__m256 rgba0 = _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(rgba_00_03));
|
||||
__m256 rgba1 = _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(_mm_shuffle_epi32(rgba_00_03, _MM_SHUFFLE(3, 2, 3, 2))));
|
||||
|
||||
__m256 rgba2 = _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(rgba_04_07));
|
||||
__m256 rgba3 = _mm256_cvtepi32_ps(_mm256_cvtepu8_epi32(_mm_shuffle_epi32(rgba_04_07, _MM_SHUFFLE(3, 2, 3, 2))));
|
||||
|
||||
avx2RGBATranspose_4x4_4x4(rgba0, rgba1, rgba2, rgba3, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint8_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
const __m256 maxValue = _mm256_set1_ps(255.0f);
|
||||
|
||||
avx2RGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
rgba0 = avx2_clamp(rgba0, maxValue);
|
||||
rgba1 = avx2_clamp(rgba1, maxValue);
|
||||
rgba2 = avx2_clamp(rgba2, maxValue);
|
||||
rgba3 = avx2_clamp(rgba3, maxValue);
|
||||
|
||||
// NOTE note using cvtps which will round based on MXCSR register defaults to _MM_ROUND_NEAREST
|
||||
__m256i rgba01 = _mm256_cvtps_epi32(rgba0);
|
||||
__m256i rgba23 = _mm256_cvtps_epi32(rgba1);
|
||||
__m256i rgba45 = _mm256_cvtps_epi32(rgba2);
|
||||
__m256i rgba67 = _mm256_cvtps_epi32(rgba3);
|
||||
|
||||
const __m256i rgba_shuf_a = _mm256_setr_epi8( 0, 4, 8, 12, -1,-1,-1, -1, -1,-1,-1,-1, -1,-1,-1,-1,
|
||||
-1,-1,-1, -1, 0, 4, 8, 12, -1,-1,-1,-1, -1,-1,-1,-1);
|
||||
|
||||
const __m256i rgba_shuf_b = _mm256_setr_epi8(-1,-1,-1,-1, -1,-1,-1,-1, 0, 4, 8, 12, -1,-1,-1,-1,
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1, -1, 0, 4, 8, 12);
|
||||
|
||||
rgba01 = _mm256_shuffle_epi8(rgba01, rgba_shuf_a);
|
||||
rgba23 = _mm256_shuffle_epi8(rgba23, rgba_shuf_b);
|
||||
rgba01 = _mm256_or_si256(rgba01, rgba23);
|
||||
|
||||
__m128i lo = _mm_or_si128(_mm256_castsi256_si128(rgba01), _mm256_extractf128_si256(rgba01, 1));
|
||||
|
||||
rgba45 = _mm256_shuffle_epi8(rgba45, rgba_shuf_a);
|
||||
rgba67 = _mm256_shuffle_epi8(rgba67, rgba_shuf_b);
|
||||
rgba45 = _mm256_or_si256(rgba45, rgba67);
|
||||
|
||||
__m128i hi = _mm_or_si128(_mm256_castsi256_si128(rgba45), _mm256_extractf128_si256(rgba45, 1));
|
||||
|
||||
__m256i rgba = _mm256_inserti128_si256(_mm256_castsi128_si256(lo), hi, 1);
|
||||
|
||||
_mm256_storeu_si256((__m256i*)out, rgba);
|
||||
}
|
||||
};
|
||||
|
||||
template<BitDepth BD>
|
||||
struct AVX2RGBAPack16
|
||||
{
|
||||
typedef typename BitDepthInfo<BD>::Type Type;
|
||||
|
||||
static inline void Load(const Type *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
// const __m256 scale = _mm256_set1_ps(1.0f / (float)BitDepthInfo<BD>::maxValue);
|
||||
__m256i rgba_00_03 = _mm256_loadu_si256((const __m256i*)(in + 0));
|
||||
__m256i rgba_04_07 = _mm256_loadu_si256((const __m256i*)(in + 16));
|
||||
|
||||
__m256 rgba0 = _mm256_cvtepi32_ps(_mm256_cvtepu16_epi32(_mm256_castsi256_si128(rgba_00_03)));
|
||||
__m256 rgba1 = _mm256_cvtepi32_ps(_mm256_cvtepu16_epi32(_mm256_extractf128_si256(rgba_00_03, 1)));
|
||||
__m256 rgba2 = _mm256_cvtepi32_ps(_mm256_cvtepu16_epi32(_mm256_castsi256_si128(rgba_04_07)));
|
||||
__m256 rgba3 = _mm256_cvtepi32_ps(_mm256_cvtepu16_epi32(_mm256_extractf128_si256(rgba_04_07, 1)));
|
||||
|
||||
avx2RGBATranspose_4x4_4x4(rgba0, rgba1, rgba2, rgba3, r, g, b, a);
|
||||
}
|
||||
|
||||
static inline void Store(Type *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
__m128i lo, hi;
|
||||
__m256i rgba;
|
||||
const __m256 maxValue = _mm256_set1_ps((float)BitDepthInfo<BD>::maxValue);
|
||||
|
||||
avx2RGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
rgba0 = avx2_clamp(rgba0, maxValue);
|
||||
rgba1 = avx2_clamp(rgba1, maxValue);
|
||||
rgba2 = avx2_clamp(rgba2, maxValue);
|
||||
rgba3 = avx2_clamp(rgba3, maxValue);
|
||||
|
||||
// NOTE note using cvtps which will round based on MXCSR register defaults to _MM_ROUND_NEAREST
|
||||
__m256i rgba01 = _mm256_cvtps_epi32(rgba0);
|
||||
__m256i rgba23 = _mm256_cvtps_epi32(rgba1);
|
||||
__m256i rgba45 = _mm256_cvtps_epi32(rgba2);
|
||||
__m256i rgba67 = _mm256_cvtps_epi32(rgba3);
|
||||
|
||||
const __m256i rgba_shuf = _mm256_setr_epi8( 0, 1, 4, 5, 8, 9, 12, 13, -1,-1,-1,-1, -1,-1, -1 ,-1,
|
||||
-1,-1,-1,-1, -1, -1, -1, -1, 0, 1, 4, 5, 8, 9, 12, 13);
|
||||
|
||||
rgba01 = _mm256_shuffle_epi8(rgba01, rgba_shuf);
|
||||
lo = _mm_or_si128(_mm256_castsi256_si128(rgba01), _mm256_extractf128_si256(rgba01, 1));
|
||||
|
||||
rgba23 = _mm256_shuffle_epi8(rgba23, rgba_shuf);
|
||||
hi = _mm_or_si128(_mm256_castsi256_si128(rgba23), _mm256_extractf128_si256(rgba23, 1));
|
||||
|
||||
rgba = _mm256_inserti128_si256(_mm256_castsi128_si256(lo), hi, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+0), rgba);
|
||||
|
||||
rgba45 = _mm256_shuffle_epi8(rgba45, rgba_shuf);
|
||||
lo = _mm_or_si128(_mm256_castsi256_si128(rgba45), _mm256_extractf128_si256(rgba45, 1));
|
||||
|
||||
rgba67 = _mm256_shuffle_epi8(rgba67, rgba_shuf);
|
||||
hi = _mm_or_si128(_mm256_castsi256_si128(rgba67), _mm256_extractf128_si256(rgba67, 1));
|
||||
|
||||
rgba = _mm256_inserti128_si256(_mm256_castsi128_si256(lo), hi, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+16), rgba);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct AVX2RGBAPack<BIT_DEPTH_UINT10>
|
||||
{
|
||||
static inline void Load(const uint16_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
AVX2RGBAPack16<BIT_DEPTH_UINT10>::Load(in, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint16_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
AVX2RGBAPack16<BIT_DEPTH_UINT10>::Store(out, r, g, b, a);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct AVX2RGBAPack<BIT_DEPTH_UINT12>
|
||||
{
|
||||
static inline void Load(const uint16_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
AVX2RGBAPack16<BIT_DEPTH_UINT12>::Load(in, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint16_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
AVX2RGBAPack16<BIT_DEPTH_UINT12>::Store(out, r, g, b, a);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct AVX2RGBAPack<BIT_DEPTH_UINT16>
|
||||
{
|
||||
static inline void Load(const uint16_t *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
AVX2RGBAPack16<BIT_DEPTH_UINT16>::Load(in, r, g, b, a);
|
||||
}
|
||||
static inline void Store(uint16_t *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
AVX2RGBAPack16<BIT_DEPTH_UINT16>::Store(out, r, g, b, a);
|
||||
}
|
||||
};
|
||||
|
||||
#if OCIO_USE_F16C
|
||||
|
||||
template <>
|
||||
struct AVX2RGBAPack<BIT_DEPTH_F16>
|
||||
{
|
||||
static inline void Load(const half *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
|
||||
__m256i rgba_00_03 = _mm256_loadu_si256((const __m256i*)(in + 0));
|
||||
__m256i rgba_04_07 = _mm256_loadu_si256((const __m256i*)(in + 16));
|
||||
|
||||
__m256 rgba0 = _mm256_cvtph_ps(_mm256_castsi256_si128(rgba_00_03));
|
||||
__m256 rgba1 = _mm256_cvtph_ps(_mm256_extractf128_si256(rgba_00_03, 1));
|
||||
__m256 rgba2 = _mm256_cvtph_ps(_mm256_castsi256_si128(rgba_04_07));
|
||||
__m256 rgba3 = _mm256_cvtph_ps(_mm256_extractf128_si256(rgba_04_07, 1));
|
||||
|
||||
avx2RGBATranspose_4x4_4x4(rgba0, rgba1, rgba2, rgba3, r, g, b, a);
|
||||
}
|
||||
|
||||
static inline void Store(half *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
__m256i rgba;
|
||||
|
||||
avx2RGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
__m128i rgba00_03 = _mm256_cvtps_ph(rgba0, 0);
|
||||
__m128i rgba04_07 = _mm256_cvtps_ph(rgba1, 0);
|
||||
__m128i rgba08_11 = _mm256_cvtps_ph(rgba2, 0);
|
||||
__m128i rgba12_16 = _mm256_cvtps_ph(rgba3, 0);
|
||||
|
||||
rgba = _mm256_inserti128_si256(_mm256_castsi128_si256(rgba00_03), rgba04_07, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+0), rgba);
|
||||
|
||||
rgba = _mm256_inserti128_si256(_mm256_castsi128_si256(rgba08_11), rgba12_16, 1);
|
||||
_mm256_storeu_si256((__m256i*)(out+16), rgba);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <>
|
||||
struct AVX2RGBAPack<BIT_DEPTH_F32>
|
||||
{
|
||||
static inline void Load(const float *in, __m256& r, __m256& g, __m256& b, __m256& a)
|
||||
{
|
||||
const __m256i rgba_idx = _mm256_setr_epi32(0, 8, 16, 24, 4, 12, 20, 28);
|
||||
r = _mm256_i32gather_ps(in + 0, rgba_idx, 4);
|
||||
g = _mm256_i32gather_ps(in + 1, rgba_idx, 4);
|
||||
b = _mm256_i32gather_ps(in + 2, rgba_idx, 4);
|
||||
a = _mm256_i32gather_ps(in + 3, rgba_idx, 4);
|
||||
}
|
||||
|
||||
static inline void Store(float *out, __m256 r, __m256 g, __m256 b, __m256 a)
|
||||
{
|
||||
__m256 rgba0, rgba1, rgba2, rgba3;
|
||||
avx2RGBATranspose_4x4_4x4(r, g, b, a, rgba0, rgba1, rgba2, rgba3);
|
||||
|
||||
_mm256_storeu_ps(out + 0, rgba0);
|
||||
_mm256_storeu_ps(out + 8, rgba1);
|
||||
_mm256_storeu_ps(out + 16, rgba2);
|
||||
_mm256_storeu_ps(out + 24, rgba3);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace OCIO_NAMESPACE
|
||||
|
||||
#endif // OCIO_USE_AVX2
|
||||
#endif // INCLUDED_OCIO_AVX2_H
|
||||
@@ -17,8 +17,10 @@ set(SOURCES
|
||||
ColorSpace.cpp
|
||||
ColorSpaceSet.cpp
|
||||
Config.cpp
|
||||
ConfigUtils.cpp
|
||||
Context.cpp
|
||||
ContextVariableUtils.cpp
|
||||
CPUInfo.cpp
|
||||
CPUProcessor.cpp
|
||||
Display.cpp
|
||||
DynamicProperty.cpp
|
||||
@@ -114,10 +116,16 @@ set(SOURCES
|
||||
ops/log/LogUtils.cpp
|
||||
ops/lut1d/Lut1DOp.cpp
|
||||
ops/lut1d/Lut1DOpCPU.cpp
|
||||
ops/lut1d/Lut1DOpCPU_SSE2.cpp
|
||||
ops/lut1d/Lut1DOpCPU_AVX.cpp
|
||||
ops/lut1d/Lut1DOpCPU_AVX2.cpp
|
||||
ops/lut1d/Lut1DOpData.cpp
|
||||
ops/lut1d/Lut1DOpGPU.cpp
|
||||
ops/lut3d/Lut3DOp.cpp
|
||||
ops/lut3d/Lut3DOpCPU.cpp
|
||||
ops/lut3d/Lut3DOpCPU_SSE2.cpp
|
||||
ops/lut3d/Lut3DOpCPU_AVX.cpp
|
||||
ops/lut3d/Lut3DOpCPU_AVX2.cpp
|
||||
ops/lut3d/Lut3DOpData.cpp
|
||||
ops/lut3d/Lut3DOpGPU.cpp
|
||||
ops/matrix/MatrixOpCPU.cpp
|
||||
@@ -198,6 +206,18 @@ endif()
|
||||
configure_file(res/OpenColorIO.pc.in ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc @ONLY)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenColorIO.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
|
||||
if(OCIO_USE_SIMD AND (OCIO_ARCH_X86 OR OCIO_USE_SSE2NEON))
|
||||
# Note that these files are gated by preprocessors to remove them based on the OCIO_USE_* vars.
|
||||
set_property(SOURCE ops/lut1d/Lut1DOpCPU_SSE2.cpp APPEND PROPERTY COMPILE_OPTIONS ${OCIO_SSE2_ARGS})
|
||||
set_property(SOURCE ops/lut1d/Lut1DOpCPU_AVX.cpp APPEND PROPERTY COMPILE_OPTIONS ${OCIO_AVX_ARGS})
|
||||
set_property(SOURCE ops/lut1d/Lut1DOpCPU_AVX2.cpp APPEND PROPERTY COMPILE_OPTIONS ${OCIO_AVX2_ARGS})
|
||||
set_property(SOURCE ops/lut3d/Lut3DOpCPU_SSE2.cpp APPEND PROPERTY COMPILE_OPTIONS ${OCIO_SSE2_ARGS})
|
||||
set_property(SOURCE ops/lut3d/Lut3DOpCPU_AVX.cpp APPEND PROPERTY COMPILE_OPTIONS ${OCIO_AVX_ARGS})
|
||||
set_property(SOURCE ops/lut3d/Lut3DOpCPU_AVX2.cpp APPEND PROPERTY COMPILE_OPTIONS ${OCIO_AVX2_ARGS})
|
||||
endif()
|
||||
|
||||
configure_file(CPUInfoConfig.h.in CPUInfoConfig.h)
|
||||
|
||||
add_library(OpenColorIO ${SOURCES})
|
||||
|
||||
# Require at least a C++11 compatible compiler for consumer projects.
|
||||
@@ -215,17 +235,17 @@ if(BUILD_SHARED_LIBS AND WIN32)
|
||||
endif()
|
||||
|
||||
|
||||
set(HEADER_LOCATION "${CMAKE_SOURCE_DIR}/include/OpenColorIO")
|
||||
set(HEADER_LOCATION "${PROJECT_SOURCE_DIR}/include/OpenColorIO")
|
||||
file(GLOB_RECURSE INSTALL_HEADERS "${HEADER_LOCATION}/*.h")
|
||||
|
||||
# Some part of the build process expect to find the ABI header here,
|
||||
# notably the documentation.
|
||||
set(ABI_HEADER_LOCATION "${CMAKE_BINARY_DIR}/include/OpenColorIO")
|
||||
set(ABI_HEADER_LOCATION "${PROJECT_BINARY_DIR}/include/OpenColorIO")
|
||||
list(APPEND INSTALL_HEADERS ${ABI_HEADER_LOCATION}/OpenColorABI.h)
|
||||
configure_file("${HEADER_LOCATION}/OpenColorABI.h.in" "${ABI_HEADER_LOCATION}/OpenColorABI.h" @ONLY)
|
||||
|
||||
# Built-in configs
|
||||
set(CONFIGS_HEADER_LOCATION "${CMAKE_BINARY_DIR}/generated_include")
|
||||
set(CONFIGS_HEADER_LOCATION "${PROJECT_BINARY_DIR}/generated_include")
|
||||
file(GLOB CONFIGS_PATHS "builtinconfigs/configs/*.ocio")
|
||||
# Loop through the .ocio config files.
|
||||
foreach(C ${CONFIGS_PATHS})
|
||||
@@ -246,7 +266,7 @@ foreach(C ${CONFIGS_PATHS})
|
||||
|
||||
# Append 0x00 to null-terminated the string.
|
||||
string(APPEND FORMATTED_HEX ",0x00")
|
||||
|
||||
|
||||
# Set the dynamically named variable "${CONFIG_NAME}" to the config in HEX.
|
||||
set(${CONFIG_NAME} ${FORMATTED_HEX})
|
||||
endforeach()
|
||||
@@ -269,6 +289,7 @@ set(BUILD_INCLUDES
|
||||
${HEADER_LOCATION}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${ABI_HEADER_LOCATION}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_include_directories(OpenColorIO
|
||||
@@ -288,10 +309,14 @@ target_link_libraries(OpenColorIO
|
||||
"$<BUILD_INTERFACE:utils::from_chars>"
|
||||
"$<BUILD_INTERFACE:utils::strings>"
|
||||
"$<BUILD_INTERFACE:xxHash>"
|
||||
yaml-cpp
|
||||
${YAML_CPP_LIBRARIES}
|
||||
MINIZIP::minizip-ng
|
||||
)
|
||||
|
||||
if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_SSE_WITH_SSE2NEON)
|
||||
target_link_libraries(OpenColorIO PRIVATE $<BUILD_INTERFACE:sse2neon>)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(OpenColorIO
|
||||
PRIVATE
|
||||
@@ -322,13 +347,6 @@ if(BUILD_SHARED_LIBS OR (OCIO_BUILD_PYTHON AND UNIX))
|
||||
set_property(TARGET OpenColorIO PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
if(OCIO_USE_SSE)
|
||||
target_compile_definitions(OpenColorIO
|
||||
PRIVATE
|
||||
USE_SSE
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC AND BUILD_TYPE_DEBUG AND BUILD_SHARED_LIBS)
|
||||
set_target_properties(OpenColorIO PROPERTIES
|
||||
PDB_NAME ${PROJECT_NAME}${OCIO_LIBNAME_SUFFIX}_${OpenColorIO_VERSION_MAJOR}_${OpenColorIO_VERSION_MINOR}
|
||||
@@ -353,20 +371,13 @@ if(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(OpenColorIO PROPERTIES
|
||||
OUTPUT_NAME ${PROJECT_NAME}${OCIO_LIBNAME_SUFFIX}
|
||||
COMPILE_FLAGS "${PLATFORM_COMPILE_FLAGS}"
|
||||
VERSION ${OpenColorIO_VERSION}
|
||||
SOVERSION ${SOVERSION}
|
||||
PUBLIC_HEADER "${INSTALL_HEADERS}"
|
||||
)
|
||||
set(CUSTOM_LINK_FLAGS ${PLATFORM_LINK_OPTIONS})
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Also hide all the symbols of dependent libraries to prevent clashes if
|
||||
# an app using this project is linked against other versions of our
|
||||
# dependencies.
|
||||
set_property (TARGET OpenColorIO
|
||||
APPEND PROPERTY LINK_FLAGS "-Wl,--exclude-libs,ALL")
|
||||
set(CUSTOM_LINK_FLAGS "${CUSTOM_LINK_FLAGS};-Wl,--exclude-libs,ALL")
|
||||
elseif(APPLE)
|
||||
if (expat_LIBRARY)
|
||||
get_filename_component(_expat_LIBDIR "${expat_LIBRARY}" DIRECTORY)
|
||||
@@ -378,28 +389,41 @@ elseif(APPLE)
|
||||
|
||||
|
||||
# Check for minizip first since our Findminizip module sets minizip-ng_LIBRARY.
|
||||
if (minizip_LIBRARY)
|
||||
if (minizip_LIBRARY OR minizip-ng_COMPAT)
|
||||
get_filename_component(_minizip-ng_LIBDIR "${minizip_LIBRARY}" DIRECTORY)
|
||||
set(_minizip-ng_NAME "minizip")
|
||||
elseif(minizip-ng_LIBRARY)
|
||||
get_filename_component(_minizip-ng_LIBDIR "${minizip-ng_LIBRARY}" DIRECTORY)
|
||||
set(_minizip-ng_NAME "minizip-ng")
|
||||
set(_minizip-ng_NAME "minizip-ng")
|
||||
endif()
|
||||
|
||||
if (_minizip-ng_LIBDIR)
|
||||
# Add the path to CMake list of search paths for libraries.
|
||||
list(APPEND _OCIO_LINK_FLAGS_LIST_ "-Wl,-L${_minizip-ng_LIBDIR}")
|
||||
# Hide the minizip-ng symbols.
|
||||
list(APPEND _OCIO_LINK_FLAGS_LIST_ "-Wl,-hidden-l${_minizip-ng_NAME}")
|
||||
endif()
|
||||
list(APPEND _OCIO_LINK_FLAGS_LIST_ "-Wl,-hidden-l${_minizip-ng_NAME}")
|
||||
endif()
|
||||
|
||||
if (_OCIO_LINK_FLAGS_LIST_)
|
||||
list(JOIN _OCIO_LINK_FLAGS_LIST_ " " _OCIO_LINK_FLAGS_LIST_)
|
||||
set_property (TARGET OpenColorIO
|
||||
APPEND PROPERTY LINK_FLAGS "${_OCIO_LINK_FLAGS_LIST_}")
|
||||
endif()
|
||||
list(JOIN _OCIO_LINK_FLAGS_LIST_ ";" _OCIO_LINK_FLAGS_LIST_)
|
||||
set(CUSTOM_LINK_FLAGS "${CUSTOM_LINK_FLAGS};${_OCIO_LINK_FLAGS_LIST_}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (OCIO_USE_SOVERSION)
|
||||
set_target_properties(OpenColorIO PROPERTIES
|
||||
VERSION ${OpenColorIO_VERSION}
|
||||
SOVERSION ${SOVERSION}
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(OpenColorIO PROPERTIES
|
||||
OUTPUT_NAME ${PROJECT_NAME}${OCIO_LIBNAME_SUFFIX}
|
||||
COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS}"
|
||||
LINK_OPTIONS "${CUSTOM_LINK_FLAGS}"
|
||||
PUBLIC_HEADER "${INSTALL_HEADERS}"
|
||||
)
|
||||
|
||||
if(MSVC AND BUILD_SHARED_LIBS)
|
||||
# Install the pdb file if any.
|
||||
install(FILES $<TARGET_PDB_FILE:${PROJECT_NAME}> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
#include "CPUInfo.h"
|
||||
#include <string.h>
|
||||
|
||||
#if _WIN32
|
||||
#include <limits.h>
|
||||
#include <intrin.h>
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef __int64 int64_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
namespace OCIO_NAMESPACE
|
||||
{
|
||||
|
||||
#if !defined(__aarch64__) && OCIO_ARCH_X86 // Intel-based processor or Apple Rosetta x86_64.
|
||||
|
||||
namespace {
|
||||
|
||||
union CPUIDResult
|
||||
{
|
||||
int i[4];
|
||||
char c[16];
|
||||
struct {
|
||||
uint32_t eax;
|
||||
uint32_t ebx;
|
||||
uint32_t ecx;
|
||||
uint32_t edx;
|
||||
} reg;
|
||||
};
|
||||
|
||||
static inline int64_t xgetbv()
|
||||
{
|
||||
int index = 0;
|
||||
#if _MSC_VER
|
||||
return _xgetbv(index);
|
||||
#else
|
||||
int eax = 0;
|
||||
int edx = 0;
|
||||
__asm__ volatile (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index));
|
||||
return (int64_t)edx << 32 | (int64_t)eax;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void cpuid(int index, int *data)
|
||||
{
|
||||
#if _MSC_VER
|
||||
__cpuid(data, index);
|
||||
#elif OCIO_ARCH_X86_32
|
||||
__asm__ volatile (
|
||||
"mov %%ebx, %%esi \n\t"
|
||||
"cpuid \n\t"
|
||||
"xchg %%ebx, %%esi"
|
||||
: "=a" (data[0]), "=S" (data[1]), "=c" (data[2]), "=d" (data[3])
|
||||
: "0" (index), "2"(0));
|
||||
#else
|
||||
__asm__ volatile (
|
||||
"mov %%rbx, %%rsi \n\t"
|
||||
"cpuid \n\t"
|
||||
"xchg %%rbx, %%rsi"
|
||||
: "=a" (data[0]), "=S" (data[1]), "=c" (data[2]), "=d" (data[3])
|
||||
: "0" (index), "2"(0));
|
||||
#endif
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
CPUInfo::CPUInfo()
|
||||
{
|
||||
flags = 0, family = 0, model = 0;
|
||||
memset(name, 0, sizeof(name));
|
||||
memset(vendor, 0, sizeof(vendor));
|
||||
|
||||
CPUIDResult info;
|
||||
uint32_t max_std_level, max_ext_level;
|
||||
int64_t xcr = 0;
|
||||
|
||||
cpuid(0, info.i);
|
||||
max_std_level = info.i[0];
|
||||
memcpy(vendor + 0, &info.i[1], 4);
|
||||
memcpy(vendor + 4, &info.i[3], 4);
|
||||
memcpy(vendor + 8, &info.i[2], 4);
|
||||
|
||||
if (max_std_level >= 1)
|
||||
{
|
||||
cpuid(1, info.i);
|
||||
family = ((info.reg.eax >> 8) & 0xf) + ((info.reg.eax >> 20) & 0xff);
|
||||
model = ((info.reg.eax >> 4) & 0xf) + ((info.reg.eax >> 12) & 0xf0);
|
||||
|
||||
if (info.reg.edx & (1 << 26))
|
||||
flags |= X86_CPU_FLAG_SSE2;
|
||||
|
||||
if (info.reg.ecx & 1)
|
||||
flags |= X86_CPU_FLAG_SSE3;
|
||||
|
||||
if (info.reg.ecx & 0x00000200)
|
||||
flags |= X86_CPU_FLAG_SSSE3;
|
||||
|
||||
if (info.reg.ecx & 0x00080000)
|
||||
flags |= X86_CPU_FLAG_SSE4;
|
||||
|
||||
if (info.reg.ecx & 0x00100000)
|
||||
flags |= X86_CPU_FLAG_SSE42;
|
||||
|
||||
/* Check OSXSAVE and AVX bits */
|
||||
if ((info.reg.ecx & 0x18000000) == 0x18000000)
|
||||
{
|
||||
xcr = xgetbv();
|
||||
if((xcr & 0x6) == 0x6) {
|
||||
flags |= X86_CPU_FLAG_AVX;
|
||||
|
||||
if(info.reg.ecx & 0x20000000) {
|
||||
flags |= X86_CPU_FLAG_F16C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (max_std_level >= 7)
|
||||
{
|
||||
cpuid(7, info.i);
|
||||
|
||||
if ((flags & X86_CPU_FLAG_AVX) && (info.reg.ebx & 0x00000020))
|
||||
flags |= X86_CPU_FLAG_AVX2;
|
||||
|
||||
/* OPMASK/ZMM state */
|
||||
if ((xcr & 0xe0) == 0xe0) {
|
||||
if ((flags & X86_CPU_FLAG_AVX2) && ((info.reg.ebx & 0xd0030000) == 0xd0030000))
|
||||
flags |= X86_CPU_FLAG_AVX512;
|
||||
}
|
||||
}
|
||||
|
||||
cpuid(0x80000000, info.i);
|
||||
max_ext_level = info.i[0];
|
||||
|
||||
if (max_ext_level >= 0x80000001)
|
||||
{
|
||||
cpuid(0x80000001, info.i);
|
||||
if (!strncmp(vendor, "AuthenticAMD", 12)) {
|
||||
|
||||
/* Athlon64, some Opteron, and some Sempron processors */
|
||||
if (flags & X86_CPU_FLAG_SSE2 && !(info.reg.ecx & 0x00000040))
|
||||
flags |= X86_CPU_FLAG_SSE2_SLOW;
|
||||
|
||||
/* Bulldozer and Jaguar based CPUs */
|
||||
if ((family == 0x15 || family == 0x16) && (flags & X86_CPU_FLAG_AVX))
|
||||
flags |= X86_CPU_FLAG_AVX_SLOW;
|
||||
|
||||
/* Zen 3 and earlier have slow gather */
|
||||
if ((family <= 0x19) && (flags & X86_CPU_FLAG_AVX2))
|
||||
flags |= X86_CPU_FLAG_AVX2_SLOWGATHER;
|
||||
}
|
||||
}
|
||||
|
||||
if (!strncmp(vendor, "GenuineIntel", 12))
|
||||
{
|
||||
if (family == 6 && (model == 9 || model == 13 || model == 14))
|
||||
{
|
||||
if (flags & X86_CPU_FLAG_SSE2)
|
||||
flags |= X86_CPU_FLAG_SSE2_SLOW;
|
||||
|
||||
if (flags & X86_CPU_FLAG_SSE3)
|
||||
flags |= X86_CPU_FLAG_SSE3_SLOW;
|
||||
}
|
||||
|
||||
/* Conroe has a slow shuffle unit */
|
||||
if ((flags & X86_CPU_FLAG_SSSE3) && !(flags & X86_CPU_FLAG_SSE4) && family == 6 && model < 23)
|
||||
flags |= X86_CPU_FLAG_SSSE3_SLOW;
|
||||
|
||||
/* Haswell has slow gather */
|
||||
if ((flags & X86_CPU_FLAG_AVX2) && family == 6 && model < 70)
|
||||
flags |= X86_CPU_FLAG_AVX2_SLOWGATHER;
|
||||
}
|
||||
|
||||
// get cpu brand string
|
||||
for(int index = 0; index < 3; index++)
|
||||
{
|
||||
cpuid(0x80000002 + index, (int *)(name + 16*index));
|
||||
}
|
||||
}
|
||||
|
||||
CPUInfo& CPUInfo::instance()
|
||||
{
|
||||
static CPUInfo singleton = CPUInfo();
|
||||
return singleton;
|
||||
}
|
||||
#elif defined(__aarch64__) // ARM Processor or Apple ARM.
|
||||
CPUInfo::CPUInfo()
|
||||
{
|
||||
flags = 0;
|
||||
memset(name, 0, sizeof(name));
|
||||
|
||||
snprintf(name, sizeof(name), "%s", "ARM");
|
||||
|
||||
// SSE2NEON library supports SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2.
|
||||
// It does not support any AVX instructions.
|
||||
if (OCIO_USE_SSE2)
|
||||
{
|
||||
flags |= X86_CPU_FLAG_SSE2;
|
||||
flags |= X86_CPU_FLAG_SSE3;
|
||||
flags |= X86_CPU_FLAG_SSSE3;
|
||||
flags |= X86_CPU_FLAG_SSE4;
|
||||
flags |= X86_CPU_FLAG_SSE42;
|
||||
}
|
||||
}
|
||||
|
||||
CPUInfo& CPUInfo::instance()
|
||||
{
|
||||
static CPUInfo singleton = CPUInfo();
|
||||
return singleton;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace OCIO_NAMESPACE
|
||||
@@ -0,0 +1,125 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
#ifndef CPUInfo_H
|
||||
#define CPUInfo_H
|
||||
|
||||
#include <OpenColorIO/OpenColorIO.h>
|
||||
#include "CPUInfoConfig.h"
|
||||
|
||||
namespace OCIO_NAMESPACE
|
||||
{
|
||||
|
||||
#define X86_CPU_FLAG_SSE2 (1 << 0) // SSE2 functions
|
||||
#define X86_CPU_FLAG_SSE2_SLOW (1 << 1) // SSE2 supported, but usually not faster than regular MMX/SSE (e.g. Core1)
|
||||
|
||||
#define X86_CPU_FLAG_SSE3 (1 << 2) // Prescott SSE3 functions
|
||||
#define X86_CPU_FLAG_SSE3_SLOW (1 << 3) // SSE3 supported, but usually not faster than regular MMX/SSE (e.g. Core1)
|
||||
|
||||
#define X86_CPU_FLAG_SSSE3 (1 << 4) // Conroe SSSE3 functions
|
||||
#define X86_CPU_FLAG_SSSE3_SLOW (1 << 5) // SSSE3 supported, but usually not faster than SSE2
|
||||
|
||||
#define X86_CPU_FLAG_SSE4 (1 << 6) // Penryn SSE4.1 functions
|
||||
#define X86_CPU_FLAG_SSE42 (1 << 7) // Nehalem SSE4.2 functions
|
||||
|
||||
#define X86_CPU_FLAG_AVX (1 << 8) // AVX functions: requires OS support even if YMM registers aren't used
|
||||
#define X86_CPU_FLAG_AVX_SLOW (1 << 9) // AVX supported, but slow when using YMM registers (e.g. Bulldozer)
|
||||
|
||||
#define X86_CPU_FLAG_AVX2 (1 << 10) // AVX2 functions: requires OS support even if YMM registers aren't used
|
||||
#define X86_CPU_FLAG_AVX2_SLOWGATHER (1 << 11) // CPU has slow gathers.
|
||||
|
||||
#define X86_CPU_FLAG_AVX512 (1 << 12) // AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used
|
||||
|
||||
#define X86_CPU_FLAG_F16C (1 << 13) // CPU Has FP16C half float, AVX2 should always have this??
|
||||
|
||||
#define x86_check_flags(cpuext) \
|
||||
(OCIO_USE_ ## cpuext && ((flags) & X86_CPU_FLAG_ ## cpuext))
|
||||
|
||||
#if !defined(__aarch64__) && OCIO_ARCH_X86 // Intel-based processor or Apple Rosetta x86_64.
|
||||
|
||||
struct CPUInfo
|
||||
{
|
||||
unsigned int flags;
|
||||
int family;
|
||||
int model;
|
||||
char name[65];
|
||||
char vendor[13];
|
||||
|
||||
CPUInfo();
|
||||
|
||||
static CPUInfo& instance();
|
||||
|
||||
const char *getName() const { return name;}
|
||||
const char *getVendor() const { return vendor; }
|
||||
|
||||
bool hasSSE2() const { return x86_check_flags(SSE2); }
|
||||
bool SSE2Slow() const { return (OCIO_USE_SSE2 && (flags & X86_CPU_FLAG_SSE2_SLOW)); }
|
||||
|
||||
bool hasSSE3() const { return x86_check_flags(SSE3); }
|
||||
bool SSE3Slow() const { return (OCIO_USE_SSE3 && (flags & X86_CPU_FLAG_SSE3_SLOW)); }
|
||||
|
||||
bool hasSSSE3() const { return x86_check_flags(SSSE3); }
|
||||
bool SSSE3Slow() const { return (OCIO_USE_SSSE3 && (flags & X86_CPU_FLAG_SSSE3_SLOW)); }
|
||||
|
||||
bool hasSSE4() const { return x86_check_flags(SSE4); }
|
||||
bool hasSSE42() const { return x86_check_flags(SSE42); }
|
||||
|
||||
bool hasAVX() const { return x86_check_flags(AVX); }
|
||||
bool AVXSlow() const { return (OCIO_USE_AVX && (flags & X86_CPU_FLAG_AVX_SLOW)); }
|
||||
|
||||
bool hasAVX2() const { return x86_check_flags(AVX2); }
|
||||
bool AVX2SlowGather() const { return (OCIO_USE_AVX2 && (flags & X86_CPU_FLAG_AVX2_SLOWGATHER)); }
|
||||
|
||||
bool hasAVX512() const { return x86_check_flags(AVX512); }
|
||||
|
||||
bool hasF16C() const { return x86_check_flags(F16C); }
|
||||
|
||||
};
|
||||
|
||||
#undef x86_check_flags
|
||||
|
||||
#elif defined(__aarch64__) // ARM Processor or Apple ARM.
|
||||
|
||||
#define check_flags(cpuext) \
|
||||
(OCIO_USE_ ## cpuext && ((flags) & X86_CPU_FLAG_ ## cpuext))
|
||||
|
||||
struct CPUInfo
|
||||
{
|
||||
unsigned int flags;
|
||||
char name[65];
|
||||
|
||||
CPUInfo();
|
||||
|
||||
static CPUInfo& instance();
|
||||
|
||||
bool hasSSE2() const { return x86_check_flags(SSE2); }
|
||||
bool SSE2Slow() const { return false; }
|
||||
|
||||
bool hasSSE3() const { return x86_check_flags(SSE3); }
|
||||
bool SSE3Slow() const { return false; }
|
||||
|
||||
bool hasSSSE3() const { return x86_check_flags(SSSE3); }
|
||||
bool SSSE3Slow() const { return false; }
|
||||
|
||||
bool hasSSE4() const { return x86_check_flags(SSE4); }
|
||||
bool hasSSE42() const { return false; }
|
||||
|
||||
// Apple M1 does not support AVX SIMD instructions through Rosetta.
|
||||
// SSE2NEON library does not supports AVX SIMD instructions.
|
||||
bool hasAVX() const { return false; }
|
||||
bool AVXSlow() const { return false; }
|
||||
bool hasAVX2() const { return false; }
|
||||
bool AVX2SlowGather() const { return false; }
|
||||
bool hasAVX512() const { return false; }
|
||||
bool hasF16C() const { return false; }
|
||||
|
||||
};
|
||||
|
||||
#undef x86_check_flags
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace OCIO_NAMESPACE
|
||||
|
||||
#endif // CPUInfo_H
|
||||
@@ -0,0 +1,54 @@
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// Copyright Contributors to the OpenColorIO Project.
|
||||
|
||||
|
||||
#cmakedefine01 OCIO_ARCH_X86
|
||||
#cmakedefine01 OCIO_ARCH_X86_32
|
||||
|
||||
// Relevant only for arm64 architecture.
|
||||
#if defined(__aarch64__)
|
||||
#cmakedefine01 OCIO_USE_SSE2NEON
|
||||
#else
|
||||
#define OCIO_USE_SSE2NEON 0
|
||||
#endif
|
||||
|
||||
// On the Apple platform, a universal build is created for both x86_64 and arm64 architectures.
|
||||
// CMake will run only one "configure" step, build for x86_64 and arm64, and then create a
|
||||
// single binary that includes both architectures.
|
||||
|
||||
// This means that for a universal build, the OCIO_USE_SSEx, OCIO_USE_AVXx, OCIO_USE_F16C, etc.
|
||||
// flags can be enabled simultaneously. Therefore, we need to check whether we are currently
|
||||
// building the x86_64 side or the arm64 side. This can be done by checking the OCIO_ARCH_X86 and
|
||||
// aarch64 defines.
|
||||
|
||||
// Building for x86_64 processor on a non-ARM host architecture
|
||||
// OR Building on/for an ARM architecture and using SSE2NEON.
|
||||
#if (OCIO_ARCH_X86 && !defined(__aarch64__)) || (defined(__aarch64__) && OCIO_USE_SSE2NEON)
|
||||
#cmakedefine01 OCIO_USE_SSE2
|
||||
#cmakedefine01 OCIO_USE_SSE3
|
||||
#cmakedefine01 OCIO_USE_SSSE3
|
||||
#cmakedefine01 OCIO_USE_SSE4
|
||||
#cmakedefine01 OCIO_USE_SSE42
|
||||
#else // non-intel based architecture or ARM architecture without OCIO_USE_SSE2NEON=ON
|
||||
// Overwrite the values from cmake as these will not be supported on a non-intel architecture
|
||||
// or arm64 with sse2neon disabled.
|
||||
#define OCIO_USE_SSE2 0
|
||||
#define OCIO_USE_SSE3 0
|
||||
#define OCIO_USE_SSSE3 0
|
||||
#define OCIO_USE_SSE4 0
|
||||
#define OCIO_USE_SSE42 0
|
||||
#endif
|
||||
|
||||
// Building for x86_64 processor on a non-ARM host architecture
|
||||
#if OCIO_ARCH_X86 && !defined(__aarch64__)
|
||||
#cmakedefine01 OCIO_USE_AVX
|
||||
#cmakedefine01 OCIO_USE_AVX2
|
||||
#cmakedefine01 OCIO_USE_AVX512
|
||||
#cmakedefine01 OCIO_USE_F16C
|
||||
#else // non-intel based architecture
|
||||
// Overwrite the values from cmake as these will not be supported on a non-intel architecture.
|
||||
#define OCIO_USE_AVX 0
|
||||
#define OCIO_USE_AVX2 0
|
||||
#define OCIO_USE_AVX512 0
|
||||
#define OCIO_USE_F16C 0
|
||||
#endif
|
||||
@@ -239,6 +239,52 @@ case in: \
|
||||
throw Exception("Unsupported bit-depths");
|
||||
}
|
||||
|
||||
bool CPUProcessor::Impl::isDynamic() const noexcept
|
||||
{
|
||||
if (m_inBitDepthOp->isDynamic())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const auto & op : m_cpuOps)
|
||||
{
|
||||
if (op->isDynamic())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_outBitDepthOp->isDynamic())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CPUProcessor::Impl::hasDynamicProperty(DynamicPropertyType type) const noexcept
|
||||
{
|
||||
if (m_inBitDepthOp->hasDynamicProperty(type))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const auto & op : m_cpuOps)
|
||||
{
|
||||
if (op->hasDynamicProperty(type))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_outBitDepthOp->hasDynamicProperty(type))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
DynamicPropertyRcPtr CPUProcessor::Impl::getDynamicProperty(DynamicPropertyType type) const
|
||||
{
|
||||
if (m_inBitDepthOp->hasDynamicProperty(type))
|
||||
@@ -472,6 +518,16 @@ BitDepth CPUProcessor::getOutputBitDepth() const
|
||||
return getImpl()->getOutputBitDepth();
|
||||
}
|
||||
|
||||
bool CPUProcessor::isDynamic() const noexcept
|
||||
{
|
||||
return getImpl()->isDynamic();
|
||||
}
|
||||
|
||||
bool CPUProcessor::hasDynamicProperty(DynamicPropertyType type) const noexcept
|
||||
{
|
||||
return getImpl()->hasDynamicProperty(type);
|
||||
}
|
||||
|
||||
DynamicPropertyRcPtr CPUProcessor::getDynamicProperty(DynamicPropertyType type) const
|
||||
{
|
||||
return getImpl()->getDynamicProperty(type);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user