Commit 62510085 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Fixing code to locate wrapping executables using targets, if possible.

When building projects dependending on VTK, we ran into issues since some
variables were expected to be declared e.g. VTK_WRAP_PYTHON_INIT_EXE,
VTK_WRAP_HIERARCHY_EXE. These are unnnecessary since they are imported targets
and should be used if present. Updated code to use the targets directly if
found.

Change-Id: I74b5996671e195b02bd65b85b71a2e33bd3ca2da
parent 1706d5f0
......@@ -3,7 +3,11 @@ include(vtkWrapPython)
function(vtk_add_python_wrapping module_name module_srcs module_hdrs)
if(NOT VTK_WRAP_PYTHON_INIT_EXE)
message(FATAL_ERROR "VTK must be built with Python wrapping turned on.")
if (TARGET vtkWrapPythonInit)
set (VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit)
else()
message(FATAL_ERROR "VTK must be built with Python wrapping turned on.")
endif()
endif()
# Need to add the Wrapping/Python to the include directory
set(_python_include_dirs
......
......@@ -3,7 +3,11 @@
#
macro(VTK_WRAP_HIERARCHY TARGET OUTPUT_DIR SOURCES)
if(NOT VTK_WRAP_HIERARCHY_EXE)
message(SEND_ERROR "VTK_WRAP_HIERARCHY_EXE not specified when calling VTK_WRAP_HIERARCHY")
if (TARGET vtkWrapHierarchy)
set (VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy)
else ()
message(SEND_ERROR "VTK_WRAP_HIERARCHY_EXE not specified when calling VTK_WRAP_HIERARCHY")
endif()
endif()
# The shell into which nmake.exe executes the custom command has some issues
......
......@@ -4,7 +4,6 @@ project(VTK)
set(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake")
set(CMAKE_MODULE_PATH ${VTK_CMAKE_DIR} ${CMAKE_MODULE_PATH})
SET(VTK_ENCODESTRING_EXE vtkEncodeString)
include(vtkModuleMacros)
......
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