Skip to content

Conversation

@fundawang
Copy link
Contributor

https://cmake.org/cmake/help/latest/module/FindPython3.html

cmake output Python3_SITEARCH variable for installation. Using this as default value seems more safe than current hardcode path.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 1, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: cary-ilm / name: Cary Phillips (c5d6a5f)

@kmilos
Copy link

kmilos commented Nov 3, 2025

AFAICT, this returns an absolute path. For relocatable installs, one wants a relative one, like the one present.

x-ref AcademySoftwareFoundation/OpenColorIO#1724

cary-ilm added a commit to cary-ilm/Imath that referenced this pull request Nov 17, 2025
Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in AcademySoftwareFoundation#523.

Signed-off-by: Cary Phillips <[email protected]>
cary-ilm added a commit to cary-ilm/Imath that referenced this pull request Nov 17, 2025
Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in AcademySoftwareFoundation#523.

Signed-off-by: Cary Phillips <[email protected]>
cary-ilm added a commit to cary-ilm/Imath that referenced this pull request Nov 17, 2025
Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in AcademySoftwareFoundation#523.

Signed-off-by: Cary Phillips <[email protected]>
cary-ilm pushed a commit to cary-ilm/Imath that referenced this pull request Nov 17, 2025
Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in AcademySoftwareFoundation#523.

Signed-off-by: Cary Phillips <[email protected]>
cary-ilm pushed a commit to cary-ilm/Imath that referenced this pull request Nov 17, 2025
Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in AcademySoftwareFoundation#523.

Signed-off-by: Cary Phillips <[email protected]>
cary-ilm pushed a commit to cary-ilm/Imath that referenced this pull request Nov 17, 2025
Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in AcademySoftwareFoundation#523.

Signed-off-by: Cary Phillips <[email protected]>
cary-ilm added a commit that referenced this pull request Nov 25, 2025
* Set PYTHON_INSTALL_DIR based on Python3_SITEARCH

Python3_SIETARCH is relative, but PYTHON_INSTALL_DIR is absolute. So
strip the Python3_PREFIS from Python3_SITEARCH to form a relative path.

This is preferable to the current hardcoded path, but is also
preferable to using an absolute path, as suggested in #523.

Signed-off-by: Cary Phillips <[email protected]>

* Update src/pybind11/PyBindImath/CMakeLists.txt

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Cary Phillips <[email protected]>

* Update src/python/CMakeLists.txt

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Cary Phillips <[email protected]>

---------

Signed-off-by: Cary Phillips <[email protected]>
Co-authored-by: Funda Wang <[email protected]>
Co-authored-by: Copilot <[email protected]>
@cary-ilm
Copy link
Member

Closing this in favor of #528.

@cary-ilm cary-ilm closed this Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants