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

Fix python module install destination #400

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 6 additions & 2 deletions src/python/PyImathNumpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ if(TARGET Python2::Python AND
LIBRARY_OUTPUT_NAME "imathnumpy"
DEBUG_POSTFIX ""
)
install(TARGETS imathnumpy_python2 DESTINATION ${PyImath_Python2_SITEARCH_REL})
install(TARGETS imathnumpy_python2
DESTINATION "${CMAKE_INSTALL_BINDIR}/python${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}/site-packages"
)
endif()

if(TARGET Python3::Python AND
Expand All @@ -48,5 +50,7 @@ if(TARGET Python3::Python AND
LIBRARY_OUTPUT_NAME "imathnumpy"
DEBUG_POSTFIX ""
)
install(TARGETS imathnumpy_python3 DESTINATION ${PyImath_Python3_SITEARCH_REL})
install(TARGETS imathnumpy_python3
DESTINATION "${CMAKE_INSTALL_BINDIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages"
)
endif()
16 changes: 8 additions & 8 deletions src/python/config/ModuleDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ function(PYIMATH_ADD_LIBRARY_PRIV libname)
)

add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [](url)


install(TARGETS ${libname}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endfunction()

# NB: This function has a number if specific names / variables
Expand Down Expand Up @@ -130,7 +124,10 @@ function(PYIMATH_DEFINE_MODULE modname)
LIBRARY_OUTPUT_NAME "${modname}"
DEBUG_POSTFIX ""
)
install(TARGETS ${modname}_python2 DESTINATION ${PyImath_Python2_SITEARCH_REL})
install(TARGETS ${modname}_python2
EXPORT ${PROJECT_NAME}
DESTINATION "${CMAKE_INSTALL_BINDIR}/python${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}/site-packages"
)
endif()
else()
if(TARGET Python3::Python)
Expand All @@ -157,7 +154,10 @@ function(PYIMATH_DEFINE_MODULE modname)
LIBRARY_OUTPUT_NAME "${modname}"
DEBUG_POSTFIX ""
)
install(TARGETS ${modname}_python3 DESTINATION ${PyImath_Python3_SITEARCH_REL})
install(TARGETS ${modname}_python3
EXPORT ${PROJECT_NAME}
DESTINATION "${CMAKE_INSTALL_BINDIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages"
)
endif()
endif()
endfunction()
Loading