Skip to content

Commit

Permalink
Add "COMPONENT python" to install() the python bindings and tell scik…
Browse files Browse the repository at this point in the history
…it-build-core to only install the python component

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
  • Loading branch information
JeanChristopheMorinPerso committed Feb 16, 2024
1 parent 68470dd commit 2d1cbde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ test = ["pytest"]
[tool.scikit-build]
wheel.expand-macos-universal-tags = true
sdist.exclude = [".github", "src/test", "src/examples", "website", "ASWF", "bazel", "share"]

# Only build the PyOpenEXR (cmake --build --target PyOpenEXR).
cmake.targets = ["PyOpenEXR"]
# Only install the "python" component (cmake --install --component python).
# This makes sure that only files makred as "python" component are installed.
install.components = ["python"]

# Enable experimental features if any are available
# In this case we need custom local plugin to get
# the project version from cmake.
experimental = true
metadata.version.provider = "openexr_skbuild_plugin"
metadata.version.provider-path = "./src/wrappers/python"


[tool.scikit-build.cmake.define]
OPENEXR_INSTALL = 'OFF'
OPENEXR_BUILD_PYTHON = 'ON'
Expand Down
4 changes: 2 additions & 2 deletions src/wrappers/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ if(SKBUILD)
set(PYTHON_INSTALL_DIR ${SKBUILD_PLATLIB_DIR})
endif()

install(TARGETS PyOpenEXR DESTINATION ${PYTHON_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Imath.py DESTINATION ${PYTHON_INSTALL_DIR})
install(TARGETS PyOpenEXR DESTINATION ${PYTHON_INSTALL_DIR} COMPONENT python)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Imath.py DESTINATION ${PYTHON_INSTALL_DIR} COMPONENT python)

if(BUILD_TESTING AND OPENEXR_TEST_PYTHON)

Expand Down

0 comments on commit 2d1cbde

Please sign in to comment.