Commit 57e79ada authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

python3: support non-sytem python3 on unix/windows

parent fe4f2594
...@@ -49,7 +49,6 @@ function (superbuild_find_projects var) ...@@ -49,7 +49,6 @@ function (superbuild_find_projects var)
freetype freetype
hdf5 hdf5
ispc ispc
lapack
las las
matplotlib matplotlib
mpi mpi
...@@ -65,12 +64,14 @@ function (superbuild_find_projects var) ...@@ -65,12 +64,14 @@ function (superbuild_find_projects var)
paraviewwebflow paraviewwebflow
paraviewwebvisualizer paraviewwebvisualizer
png png
pythonattrs
pythonautobahn pythonautobahn
pythonconstantly pythonconstantly
pythoncycler pythoncycler
pythondateutil pythondateutil
pythonhyperlink pythonhyperlink
pythonincremental pythonincremental
pythonkiwisolver
pythonmako pythonmako
pythonpygments pythonpygments
pythonpyparsing pythonpyparsing
...@@ -97,9 +98,11 @@ function (superbuild_find_projects var) ...@@ -97,9 +98,11 @@ function (superbuild_find_projects var)
if (UNIX) if (UNIX)
list(APPEND projects list(APPEND projects
cosmotools cosmotools
ffi
ffmpeg ffmpeg
fortran fortran
genericio genericio
lapack
libxml2 libxml2
mili mili
scipy) scipy)
......
...@@ -68,7 +68,10 @@ endmacro () ...@@ -68,7 +68,10 @@ endmacro ()
check_for_python_module(numpy numpy) check_for_python_module(numpy numpy)
check_for_python_module(numpy pkg_resources) check_for_python_module(numpy pkg_resources)
check_for_python_module(scipy scipy) check_for_python_module(scipy scipy)
check_for_python_module(pythonkiwisolver kiwisolver)
check_for_python_module(matplotlib matplotlib) check_for_python_module(matplotlib matplotlib)
check_for_python_module(matplotlib mpl_toolkits)
check_for_python_module(pythonattrs attr)
check_for_python_module(pythonpygments pygments) check_for_python_module(pythonpygments pygments)
check_for_python_module(pythonsix six) check_for_python_module(pythonsix six)
check_for_python_module(pythonautobahn autobahn) check_for_python_module(pythonautobahn autobahn)
......
...@@ -141,6 +141,10 @@ if (python_enabled) ...@@ -141,6 +141,10 @@ if (python_enabled)
include(python2.functions) include(python2.functions)
superbuild_install_superbuild_python2( superbuild_install_superbuild_python2(
LIBSUFFIX "/python${superbuild_python_version}") LIBSUFFIX "/python${superbuild_python_version}")
elseif (python3_built_by_superbuild)
include(python3.functions)
superbuild_install_superbuild_python3(
LIBSUFFIX "/python${superbuild_python_version}")
endif () endif ()
# Add extra paths to MODULE_DIRECTORIES here (.../local/lib/python${superbuild_python_version}/dist-packages) # Add extra paths to MODULE_DIRECTORIES here (.../local/lib/python${superbuild_python_version}/dist-packages)
......
...@@ -31,9 +31,14 @@ if (Qt5_DIR) ...@@ -31,9 +31,14 @@ if (Qt5_DIR)
endif () endif ()
set(exclude_regexes) set(exclude_regexes)
if (python3_enabled AND NOT python3_built_by_superbuild) if (python3_enabled)
if (python3_built_by_superbuild)
list(APPEND library_paths
"${superbuild_install_location}/Python")
else()
list(APPEND exclude_regexes list(APPEND exclude_regexes
".*python3[0-9]+.dll") ".*python3[0-9]+.dll")
endif()
endif () endif ()
# Install paraview executables to bin. # Install paraview executables to bin.
...@@ -123,41 +128,54 @@ if (python_enabled) ...@@ -123,41 +128,54 @@ if (python_enabled)
if (python2_built_by_superbuild) if (python2_built_by_superbuild)
include(python2.functions) include(python2.functions)
superbuild_install_superbuild_python2() superbuild_install_superbuild_python2()
elseif (python3_built_by_superbuild)
include(python3.functions)
superbuild_install_superbuild_python3()
endif () endif ()
if (python3_enabled)
set(python_prefix "Python")
else()
set(python_prefix "bin")
endif()
superbuild_windows_install_python( superbuild_windows_install_python(
MODULES paraview MODULES paraview
vtk vtk
vtkmodules vtkmodules
${python_modules} ${python_modules}
MODULE_DIRECTORIES "${superbuild_install_location}/bin/Lib/site-packages" MODULE_DIRECTORIES "${superbuild_install_location}/${python_prefix}/Lib/site-packages"
"${superbuild_install_location}/bin/Lib/site-packages"
"${superbuild_install_location}/lib/site-packages" "${superbuild_install_location}/lib/site-packages"
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages" "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
"${superbuild_install_location}/lib/paraview-${paraview_version_major}.${paraview_version_minor}/site-packages" "${superbuild_install_location}/lib/paraview-${paraview_version_major}.${paraview_version_minor}/site-packages"
SEARCH_DIRECTORIES "${superbuild_install_location}/lib" SEARCH_DIRECTORIES "${superbuild_install_location}/lib"
"${superbuild_install_location}/bin" "${superbuild_install_location}/bin"
"${superbuild_install_location}/${python_prefix}"
EXCLUDE_REGEXES ${exclude_regexes}) EXCLUDE_REGEXES ${exclude_regexes})
if (matplotlib_built_by_superbuild) if (matplotlib_built_by_superbuild)
install( install(
DIRECTORY "${superbuild_install_location}/bin/Lib/site-packages/matplotlib/mpl-data/" DIRECTORY "${superbuild_install_location}/${python_prefix}/Lib/site-packages/matplotlib/mpl-data/"
DESTINATION "bin/Lib/site-packages/matplotlib/mpl-data" DESTINATION "bin/Lib/site-packages/matplotlib/mpl-data"
COMPONENT superbuild) COMPONENT superbuild)
endif () endif ()
endif ()
if (paraviewweb_enabled)
if (pywin32_built_by_superbuild) if (pywin32_built_by_superbuild)
install( install(
DIRECTORY "${superbuild_install_location}/bin/Lib/site-packages/win32" DIRECTORY "${superbuild_install_location}/${python_prefix}/Lib/site-packages/win32"
DESTINATION "bin/Lib/site-packages" DESTINATION "bin/Lib/site-packages"
COMPONENT "superbuild") COMPONENT "superbuild")
install( install(
FILES "${superbuild_install_location}/bin/Lib/site-packages/pywin32.pth" FILES "${superbuild_install_location}/${python_prefix}/Lib/site-packages/pywin32.pth"
"${superbuild_install_location}/bin/Lib/site-packages/pywin32.version.txt" "${superbuild_install_location}/${python_prefix}/Lib/site-packages/pywin32.version.txt"
DESTINATION "bin/Lib/site-packages" DESTINATION "bin/Lib/site-packages"
COMPONENT "superbuild") COMPONENT "superbuild")
endif () endif ()
endif ()
if (paraviewweb_enabled)
install( install(
DIRECTORY "${superbuild_install_location}/share/paraview/web" DIRECTORY "${superbuild_install_location}/share/paraview/web"
DESTINATION "share/paraview-${paraview_version}" DESTINATION "share/paraview-${paraview_version}"
......
Subproject commit af264cb2aa83883de4448fb220bb517a72d63085 Subproject commit 1c9636588eff7b17a35cf94cf22a185560a89aff
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment