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