Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ jobs:
set -x

# debugging code to help confirm the dlls are in the path
#IMATH_PYD=$(cygpath -u "$PYTHON_INSTALL_DIR/imath.pyd")
#IMATH_PYD=$(cygpath -u "$PYTHON_INSTALL_DIR/imath.cp39-win_amd64.pyd")
#if [[ -f "$IMATH_PYD" ]]; then
# objdump -p "$IMATH_PYD" | grep 'DLL Name'
#fi
Expand Down
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.linux.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.so.$SOVERSION.$MAJO
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.linux.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ lib/libPyImath_d.so
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.linux.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.a
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.linux.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath.so
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.linux.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.so.$SOVERSION.$MAJO
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.linux.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.so.$SOVERSION.$MAJO
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-x86_64-linux-gnu.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.macos.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.dylib
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.macos.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath_d.dylib
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.macos.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.a
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.macos.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.dylib
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.macos.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ lib/libPyImath_Python$PYTHONMAJOR_$PYTHONMINOR-$MAJOR_$MINOR.dylib
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.so
python/imathnumpy.so
python/imath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/imathnumpy.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
python/pybindimath.cpython-$PYTHONMAJOR$PYTHONMINOR-darwin.so
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.windows.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ lib/cmake/Imath/PyImathTargets.cmake
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.pyd
python/imathnumpy.pyd
python/imath.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
python/imathnumpy.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
python/pybindimath.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.windows.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ lib/cmake/Imath/PyImathTargets.cmake
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.pyd
python/imathnumpy.pyd
python/imath.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
python/imathnumpy.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
python/pybindimath.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
4 changes: 2 additions & 2 deletions share/ci/install_manifest/install_manifest.windows.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ lib/cmake/Imath/PyImathTargets.cmake
lib/pkgconfig/Imath.pc
lib/pkgconfig/PyBindImath.pc
lib/pkgconfig/PyImath.pc
python/imath.pyd
python/imathnumpy.pyd
python/imath.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
python/imathnumpy.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
python/pybindimath.cp$PYTHONMAJOR$PYTHONMINOR-win_amd64.pyd
13 changes: 13 additions & 0 deletions src/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ set(PYIMATH_LIB_SUFFIX

set(PYIMATH_OUTPUT_SUBDIR Imath CACHE STRING "Destination sub-folder of the path for install of PyImath headers")

#
# Python extension suffix.
# In cmake 3.17+ `Python_add_library` will handle this automatically
# and then this code can be removed.
#

# Example suffix is '.cp311-win_amd64.pyd'.
execute_process(
COMMAND "${Python3_EXECUTABLE}" -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"
OUTPUT_VARIABLE PYIMATH_EXTENSION_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)

#
# PyImath and PyImathNumpy
#
Expand Down
6 changes: 1 addition & 5 deletions src/python/PyImath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,7 @@ set(PYIMATH_MODULE_SOURCES

add_library(${PYIMATH_MODULE} MODULE ${PYIMATH_MODULE_SOURCES})

if(WIN32)
# Ensure correct module extension on Windows
set_target_properties(${PYIMATH_MODULE} PROPERTIES SUFFIX ".pyd")
endif()

set_target_properties(${PYIMATH_MODULE} PROPERTIES SUFFIX "${PYIMATH_EXTENSION_SUFFIX}")
set_target_properties(${PYIMATH_MODULE} PROPERTIES
OUTPUT_NAME ${PYIMATH_MODULE_NAME} # override the _d suffix for Debug builds
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python${Python3_VERSION_MAJOR}_${Python3_VERSION_MINOR}/"
Expand Down
6 changes: 1 addition & 5 deletions src/python/PyImathNumpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ set(PYIMATHNUMPY_MODULE_SOURCES imathnumpymodule.cpp)
set(CMAKE_DEBUG_POSTFIX "")

add_library(${PYIMATHNUMPY_MODULE} MODULE ${PYIMATHNUMPY_MODULE_SOURCES})

# Ensure correct module extension on Windows
if(WIN32)
set_target_properties(${PYIMATHNUMPY_MODULE} PROPERTIES SUFFIX ".pyd")
endif()
set_target_properties(${PYIMATHNUMPY_MODULE} PROPERTIES SUFFIX "${PYIMATH_EXTENSION_SUFFIX}")

set_target_properties(${PYIMATHNUMPY_MODULE} PROPERTIES
PREFIX ""
Expand Down