Commit 14e73bd9 authored by Sebastien Jourdain's avatar Sebastien Jourdain

Add CMake cache option for VTK_BUILD_PYTHON_MODULE_DIR

This property allow ParaView to override the default VTK
value ($BUILD/Wrapping/Python/) to be where ParaView
expect its Python modules to be build.

Change-Id: I5c2cc016356d7a4320f9f5c999225835abcd6bb1
parent 4f25c6a1
......@@ -94,7 +94,7 @@ function(VTK_CREATE_SIP_MODULE KIT WRAP_SRCS)
TARGET_LINK_LIBRARIES(vtk${KIT}PythonSIP vtk${KIT}PythonD)
get_target_property(lib_loc vtk${KIT}PythonSIP LOCATION)
ADD_CUSTOM_COMMAND(TARGET vtk${KIT}PythonSIP POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${lib_loc}" "${VTK_BINARY_DIR}/Wrapping/Python/vtk/"
COMMAND ${CMAKE_COMMAND} -E copy "${lib_loc}" "${VTK_BUILD_PYTHON_MODULE_DIR}/vtk/"
)
IF(NOT VTK_INSTALL_NO_LIBRARIES)
......
......@@ -119,7 +119,11 @@ if(NOT VTK_INSTALL_PYTHON_MODULE_DIR)
PATH "Directory where python modules will be installed")
mark_as_advanced(VTK_INSTALL_PYTHON_MODULE_DIR)
endif()
if(NOT VTK_BUILD_PYTHON_MODULE_DIR)
set (VTK_BUILD_PYTHON_MODULE_DIR "-NOTFOUND" CACHE
PATH "Directory where python modules will be put inside the build tree")
mark_as_advanced(VTK_BUILD_PYTHON_MODULE_DIR)
endif()
if (CMAKE_CROSSCOMPILING AND NOT COMPILE_TOOLS_IMPORTED)
# if CMAKE_CROSSCOMPILING is true, we need to import build-tools targets.
find_package(VTKCompileTools REQUIRED)
......
......@@ -9,11 +9,8 @@ if(NOT VTK_USE_SYSTEM_AUTOBAHN)
include(vtkPythonPackages)
# Extract path where python module should be copied
get_property(pymodule_build_dir GLOBAL PROPERTY VTK_PYMODULE_BUILD_DIR)
set(AutobahnPython_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/autobahn")
set(AutobahnPython_BINARY_DIR "${pymodule_build_dir}/autobahn")
set(AutobahnPython_BINARY_DIR "${VTK_BUILD_PYTHON_MODULE_DIR}/autobahn")
build_python_package("AutobahnPython" ${AutobahnPython_SOURCE_DIR}
${AutobahnPython_BINARY_DIR})
......
......@@ -9,11 +9,8 @@ if(NOT VTK_USE_SYSTEM_TWISTED)
include(vtkPythonPackages)
# Extract path where python module should be copied
get_property(pymodule_build_dir GLOBAL PROPERTY VTK_PYMODULE_BUILD_DIR)
set(Twisted_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/twisted")
set(Twisted_BINARY_DIR "${pymodule_build_dir}/twisted")
set(Twisted_BINARY_DIR "${VTK_BUILD_PYTHON_MODULE_DIR}/twisted")
build_python_package("Twisted" ${Twisted_SOURCE_DIR} ${Twisted_BINARY_DIR})
......
......@@ -9,11 +9,8 @@ if(NOT VTK_USE_SYSTEM_ZOPE)
include(vtkPythonPackages)
# Extract path where python module should be copied
get_property(pymodule_build_dir GLOBAL PROPERTY VTK_PYMODULE_BUILD_DIR)
set(zope_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zope")
set(zope_BINARY_DIR "${pymodule_build_dir}/zope")
set(zope_BINARY_DIR "${VTK_BUILD_PYTHON_MODULE_DIR}/zope")
build_python_package("zope" ${zope_SOURCE_DIR} ${zope_BINARY_DIR})
......
......@@ -32,5 +32,10 @@ if (NOT VTK_INSTALL_PYTHON_MODULE_DIR)
CACHE
PATH "Directory where python modules will be installed" FORCE)
endif()
set_property(GLOBAL PROPERTY VTK_PYMODULE_BUILD_DIR
"${VTK_BINARY_DIR}/Wrapping/Python/")
if (NOT VTK_BUILD_PYTHON_MODULE_DIR)
set(VTK_BUILD_PYTHON_MODULE_DIR
"${VTK_BINARY_DIR}/Wrapping/Python"
CACHE
PATH "Directory where python modules will be built" FORCE)
endif()
......@@ -5,11 +5,8 @@ find_package(PythonInterp)
include(vtkPythonPackages)
# Extract path where python module should be copied
get_property(pymodule_build_dir GLOBAL PROPERTY VTK_PYMODULE_BUILD_DIR)
set(vtkWebPython_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(vtkWebPython_BINARY_DIR "${pymodule_build_dir}/vtk/web")
set(vtkWebPython_BINARY_DIR "${VTK_BUILD_PYTHON_MODULE_DIR}/vtk/web")
build_python_package("vtkWebPython" ${vtkWebPython_SOURCE_DIR}
${vtkWebPython_BINARY_DIR})
......
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