Skip to content

COMP: Update to newer find_package(Python3) support #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMake/vtkMacroKitPythonWrap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ macro(vtkMacroKitPythonWrap)

if(VTK_WRAP_PYTHON AND BUILD_SHARED_LIBS)

# Tell vtkWrapPython.cmake to set VTK_PYTHON_LIBRARIES for us.
# Tell vtkWrapPython.cmake to set VTK_Python3_LIBRARIES for us.
set(VTK_WRAP_PYTHON_FIND_LIBS 1)
include(vtkWrapPython)

Expand Down Expand Up @@ -283,7 +283,7 @@ macro(vtkMacroKitPythonWrap)
${MY_KIT_NAME}PythonD
${MY_KIT_NAME}
${VTK_PYTHON_CORE}
${VTK_PYTHON_LIBRARIES}
${VTK_Python3_LIBRARIES}
${VTK_KIT_PYTHON_LIBRARIES}
${MY_KIT_PYTHON_LIBRARIES}
)
Expand Down Expand Up @@ -344,7 +344,7 @@ macro(vtkMacroKitPythonWrap)
target_link_libraries(${MY_KIT_NAME}Python
PRIVATE
${MY_KIT_NAME}
${VTK_PYTHON_LIBRARIES}
${VTK_Python3_LIBRARIES}
VTK::WrappingPythonCore
VTK::Python
)
Expand Down
10 changes: 5 additions & 5 deletions CMake/vtkWrapPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ if(VTK_WRAP_PYTHON_FIND_LIBS)
else()
set(_QUIET_LIBRARY "REQUIRED")
endif()
find_package(PythonLibs ${_QUIET_LIBRARY})
find_package(Python3 COMPONENTS Development ${_QUIET_LIBRARY})

# Use separate debug/optimized libraries if they are different.
if(PYTHON_DEBUG_LIBRARY)
if("${PYTHON_DEBUG_LIBRARY}" STREQUAL "${PYTHON_LIBRARY}")
set(VTK_PYTHON_LIBRARIES ${PYTHON_LIBRARY})
set(VTK_Python3_LIBRARIES ${PYTHON_LIBRARY})
else()
set(VTK_PYTHON_LIBRARIES
set(VTK_Python3_LIBRARIES
optimized ${PYTHON_LIBRARY}
debug ${PYTHON_DEBUG_LIBRARY})
endif()
Expand All @@ -207,7 +207,7 @@ if(VTK_WRAP_PYTHON_FIND_LIBS)
endif()
endif()
else()
set(VTK_PYTHON_LIBRARIES ${PYTHON_LIBRARY})
set(VTK_Python3_LIBRARIES ${PYTHON_LIBRARY})
endif()

# Some python installations on UNIX need to link to extra libraries
Expand All @@ -224,7 +224,7 @@ if(VTK_WRAP_PYTHON_FIND_LIBS)
endif()

# Include any extra libraries for python.
set(VTK_PYTHON_LIBRARIES ${VTK_PYTHON_LIBRARIES} ${PYTHON_EXTRA_LIBS})
set(VTK_Python3_LIBRARIES ${VTK_Python3_LIBRARIES} ${PYTHON_EXTRA_LIBS})
endif()

# Determine the location of the supplied header in the include_dirs supplied.
Expand Down
2 changes: 0 additions & 2 deletions Testing/vtkParallelTransportTest1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ int vtkParallelTransportTest1(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])

// Test computation with a straight line input (zero curvature)

double lineDirection[3] = { 0.0, 0.0, 1.0 };
vtkNew<vtkLineSource> line;
line->SetPoint1(10,20,30);
line->SetPoint1(30,70,-80);
Expand Down Expand Up @@ -97,7 +96,6 @@ int vtkParallelTransportTest1(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
vtkPointData* pointData = parallelTransportFrame->GetOutput()->GetPointData();
vtkDoubleArray* normalsArray = vtkDoubleArray::SafeDownCast(pointData->GetArray("Normals"));
vtkDoubleArray* binormalsArray = vtkDoubleArray::SafeDownCast(pointData->GetArray("Binormals"));
vtkDoubleArray* tangentsArray = vtkDoubleArray::SafeDownCast(pointData->GetArray("Tangents"));
double constantBinormal[3] = { 0.0, 0.0, 0.0 };
binormalsArray->GetTypedTuple(0, constantBinormal);
for (vtkIdType tupleIndex = 1; tupleIndex < normalsArray->GetNumberOfTuples(); tupleIndex++)
Expand Down