Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow choice of specific python release #1410

Merged
merged 3 commits into from
Jun 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ option(OCIO_BUILD_FROZEN_DOCS "Specify whether to build frozen documentation, ne
option(OCIO_BUILD_DOCS "Specify whether to build documentation" ${OCIO_BUILD_FROZEN_DOCS})

option(OCIO_BUILD_PYTHON "Specify whether to build python bindings" ON)
set (OCIO_PYTHON_VERSION "" CACHE STRING
"Preferred Python version (if any) in case multiple are available")

option(OCIO_BUILD_JAVA "Specify whether to build java bindings" OFF)

option(OCIO_WARNING_AS_ERROR "Set build error level for CI testing" OFF)
Expand Down
24 changes: 11 additions & 13 deletions share/cmake/modules/FindExtPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,9 @@ if(OCIO_BUILD_APPS)
find_package(lcms2 2.2 REQUIRED)
endif()

if(OCIO_BUILD_PYTHON)

# NOTE: Depending of the compiler version pybind11 2.4.3 does not compile
# with C++17 so, if you change the pybind11 version update the code to
# compile pybind11 and dependencies with C++17 or higher i.e. remove the
# cap of C++ version in FindPybind11.cmake and
# src/bindings/python/CMakeLists.txt.

# pybind11
# https://github.com/pybind/pybind11
find_package(pybind11 2.6.1 REQUIRED)
endif()
if (OCIO_PYTHON_VERSION AND NOT OCIO_BUILD_PYTHON)
message (WARNING "OCIO_PYTHON_VERSION=${OCIO_PYTHON_VERSION} but OCIO_BUILD_PYTHON is off.")
endif ()

if(OCIO_BUILD_PYTHON OR OCIO_BUILD_DOCS)

Expand All @@ -76,5 +67,12 @@ if(OCIO_BUILD_PYTHON OR OCIO_BUILD_DOCS)
endif()

# Python
find_package(Python REQUIRED COMPONENTS ${_Python_COMPONENTS})
find_package(Python ${OCIO_PYTHON_VERSION} REQUIRED
COMPONENTS ${_Python_COMPONENTS})

if(OCIO_BUILD_PYTHON)
# pybind11
# https://github.com/pybind/pybind11
find_package(pybind11 2.6.1 REQUIRED)
endif()
endif()