Skip to content
Snippets Groups Projects
Commit b4963b88 authored by Aron Helser's avatar Aron Helser
Browse files

Python: cmake module install rule fix for Python 3

.pyc files are now in a __pycache__ directory, and include
the python version and interpreter in the filename. Use a
glob to copy them during install.
parent 63977b90
No related branches found
No related tags found
No related merge requests found
......@@ -191,11 +191,22 @@ function (vtk_module_python_module name)
# add install rules.
if (NOT _no_install AND NOT VTK_INSTALL_NO_RUNTIME)
install(FILES "${VTK_BUILD_PYTHON_MODULE_DIR}/${_name}"
"${VTK_BUILD_PYTHON_MODULE_DIR}/${_name_we}.pyc"
"${VTK_BUILD_PYTHON_MODULE_DIR}/${_name_we}.pyo"
DESTINATION "${VTK_INSTALL_PYTHON_MODULE_DIR}"
COMPONENT "Runtime")
if(VTK_PYTHON_VERSION VERSION_LESS 3)
install(FILES "${VTK_BUILD_PYTHON_MODULE_DIR}/${_name}"
"${VTK_BUILD_PYTHON_MODULE_DIR}/${_name_we}.pyc"
"${VTK_BUILD_PYTHON_MODULE_DIR}/${_name_we}.pyo"
DESTINATION "${VTK_INSTALL_PYTHON_MODULE_DIR}"
COMPONENT "Runtime")
else()
# python 3 uses a different directory for .pyc files, and .pyo files are gone.
install(FILES "${VTK_BUILD_PYTHON_MODULE_DIR}/${_name}"
DESTINATION "${VTK_INSTALL_PYTHON_MODULE_DIR}"
COMPONENT "Runtime")
file(GLOB file_matches "${VTK_BUILD_PYTHON_MODULE_DIR}/__pycache__/${_name_we}.*.pyc")
install(FILES ${file_matches}
DESTINATION "${VTK_INSTALL_PYTHON_MODULE_DIR}/__pycache__"
COMPONENT "Runtime")
endif()
endif()
endif() # NOT _use_system
endforeach()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment