Commit 4cbab227 authored by Ben Boeckel's avatar Ben Boeckel Committed by Cory Quammen

python: update packaging to support 3.x

(cherry picked from commit b70dcb96)
parent 597165a7
......@@ -94,7 +94,7 @@ endif ()
if (python_enabled)
file(GLOB egg_dirs
"${superbuild_install_location}/lib/python2.7/site-packages/*.egg/")
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/*.egg/")
superbuild_apple_install_python(
"\${CMAKE_INSTALL_PREFIX}"
"${paraview_appname}"
......@@ -104,7 +104,7 @@ if (python_enabled)
${python_modules}
MODULE_DIRECTORIES
"${superbuild_install_location}/Applications/paraview.app/Contents/Python"
"${superbuild_install_location}/lib/python2.7/site-packages"
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
${egg_dirs}
SEARCH_DIRECTORIES
"${superbuild_install_location}/Applications/paraview.app/Contents/Libraries"
......@@ -112,7 +112,7 @@ if (python_enabled)
if (matplotlib_enabled)
install(
DIRECTORY "${superbuild_install_location}/lib/python2.7/site-packages/matplotlib/mpl-data/"
DIRECTORY "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/matplotlib/mpl-data/"
DESTINATION "${paraview_appname}/Contents/Python/matplotlib/mpl-data"
COMPONENT superbuild)
endif ()
......
......@@ -136,12 +136,14 @@ endif ()
if (python_enabled)
file(GLOB egg_dirs
"${superbuild_install_location}/lib/python2.7/site-packages/*.egg/")
include(python.functions)
superbuild_install_superbuild_python(
LIBSUFFIX "/python2.7")
"${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/*.egg/")
if (python2_built_by_superbuild)
include(python2.functions)
superbuild_install_superbuild_python2(
LIBSUFFIX "/python${superbuild_python_version}")
endif ()
# Add extra paths to MODULE_DIRECTORIES here (.../local/lib/python2.7/dist-packages)
# Add extra paths to MODULE_DIRECTORIES here (.../local/lib/python${superbuild_python_version}/dist-packages)
# is a workaround to an issue when building against system python. When we move to
# Python3, we should make sure all the python modules get installed to the same
# location to begin with.
......@@ -155,14 +157,14 @@ if (python_enabled)
${python_modules}
INCLUDE_REGEXES ${include_regexes}
EXCLUDE_REGEXES ${exclude_regexes}
MODULE_DIRECTORIES "${superbuild_install_location}/lib/python2.7/site-packages"
MODULE_DIRECTORIES "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
${egg_dirs}
LOADER_PATHS "${library_paths}")
if (matplotlib_built_by_superbuild)
install(
DIRECTORY "${superbuild_install_location}/lib/python2.7/site-packages/matplotlib/mpl-data/"
DESTINATION "lib/python2.7/site-packages/matplotlib/mpl-data"
DIRECTORY "${superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/matplotlib/mpl-data/"
DESTINATION "lib/python${superbuild_python_version}/site-packages/matplotlib/mpl-data"
COMPONENT superbuild)
endif ()
endif ()
......
......@@ -31,8 +31,8 @@ endforeach ()
if (python_enabled)
# Install ParaView Python libraries and any non-ParaView Python libraries.
install(
DIRECTORY "${superbuild_install_location}/lib/python2.7/"
DESTINATION "lib/python2.7/"
DIRECTORY "${superbuild_install_location}/lib/python${superbuild_python_version}/"
DESTINATION "lib/python${superbuild_python_version}/"
COMPONENT superbuild
USE_SOURCE_PERMISSIONS
PATTERN "__pycache__" EXCLUDE
......@@ -42,7 +42,7 @@ if (python_enabled)
# Install python binaries and symlinks
if (python_built_by_superbuild)
install(
PROGRAMS "${superbuild_install_location}/bin/python2.7-config"
PROGRAMS "${superbuild_install_location}/bin/python${superbuild_python_version}-config"
"${superbuild_install_location}/bin/python2"
"${superbuild_install_location}/bin/python2-config"
"${superbuild_install_location}/bin/python"
......@@ -50,7 +50,7 @@ if (python_enabled)
DESTINATION bin
COMPONENT superbuild)
list(APPEND binaries_to_install
"${superbuild_install_location}/bin/python2.7")
"${superbuild_install_location}/bin/python${superbuild_python_version}")
endif()
endif()
......@@ -83,9 +83,9 @@ list(REMOVE_DUPLICATES libraries_referenced_by_cmake)
if (python_enabled)
# Now grab extra python SOs
file(GLOB_RECURSE paraview_python_modules
"${real_superbuild_install_location}/lib/python2.7/site-packages/*${CMAKE_SHARED_MODULE_SUFFIX}")
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/site-packages/*${CMAKE_SHARED_MODULE_SUFFIX}")
file(GLOB_RECURSE python_modules
"${real_superbuild_install_location}/lib/python2.7/*${CMAKE_SHARED_MODULE_SUFFIX}")
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/*${CMAKE_SHARED_MODULE_SUFFIX}")
else ()
set(paraview_python_modules)
set(python_modules)
......@@ -174,9 +174,9 @@ include(GetPrerequisites)
set(all_binaries)
set(dependency_search_paths
"${real_superbuild_install_location}/lib"
"${real_superbuild_install_location}/lib/python2.7"
"${real_superbuild_install_location}/lib/python2.7/site-packages"
"${real_superbuild_install_location}/lib/python2.7/lib-dynload")
"${real_superbuild_install_location}/lib/python${superbuild_python_version}"
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/site-packages"
"${real_superbuild_install_location}/lib/python${superbuild_python_version}/lib-dynload")
if(libraries_to_install)
list(SORT libraries_to_install)
endif()
......
......@@ -113,8 +113,8 @@ if (visrtx_enabled)
endif ()
if (python_enabled)
include(python.functions)
superbuild_install_superbuild_python()
include(python2.functions)
superbuild_install_superbuild_python2()
superbuild_windows_install_python(
MODULES paraview
......@@ -123,7 +123,7 @@ if (python_enabled)
${python_modules}
MODULE_DIRECTORIES "${superbuild_install_location}/bin/Lib/site-packages"
"${superbuild_install_location}/lib/site-packages"
"${superbuild_install_location}/lib/python2.7/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"
SEARCH_DIRECTORIES "${superbuild_install_location}/lib"
"${superbuild_install_location}/bin")
......
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