Commit ee55a52a authored by Chris Harris's avatar Chris Harris
Browse files

Changes to Xdmf2 to work with VTK6

parent fd026392
......@@ -10,6 +10,7 @@ SET(VTK_INSTALL_PACKAGE_DIR_CM24 ${PV_INSTALL_LIB_DIR})
IF (PARAVIEW_USE_MPI)
SET(XDMF_BUILD_MPI 1)
INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH})
IF (MPI_LIBRARY)
SET(XDMF2_MPI_LIBRARIES ${MPI_LIBRARY})
ENDIF (MPI_LIBRARY)
......@@ -25,13 +26,9 @@ IF(NOT BUILD_SHARED_LIBS)
ENDIF(NOT BUILD_SHARED_LIBS)
SET(XDMF_BUILD_VTK 1)
IF(VTK_USE_SYSTEM_LIBXML2)
SET(LIBXML2_LIBRARY ${LIBXML2_LIBRARIES})
SET(VTKLIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIR})
ELSE(VTK_USE_SYSTEM_LIBXML2)
SET(LIBXML2_LIBRARY vtklibxml2)
SET(VTKLIBXML2_INCLUDE_DIR ${ParaView_BINARY_DIR}/VTK/Utilities/vtklibxml2)
ENDIF(VTK_USE_SYSTEM_LIBXML2)
set(LIBXML2_LIBRARY ${vtklibxml2_LIBRARIES})
set(VTKLIBXML2_INCLUDE_DIRS ${vtklibxml2_INCLUDE_DIRS})
SET(HDF5_LIBRARY ${PARAVIEW_HDF5_LIBRARIES})
IF(VTK_USE_SYSTEM_EXPAT)
......@@ -64,6 +61,8 @@ ELSE(BUILD_SHARED_LIBS)
ENDIF(XDMF_INSTALL_NO_DEVELOPMENT)
ENDIF(BUILD_SHARED_LIBS)
include_directories(vtkhdf5_INCLUDE_DIRS)
IF(EXISTS "${HDF5_CONFIG}")
INCLUDE("${HDF5_CONFIG}")
ADD_DEFINITIONS(${HDF5_EXTRA_FLAGS})
......
......@@ -11,6 +11,9 @@ IF(PV_INSTALL_INCLUDE_DIR)
SET(XDMF_INSTALL_INCLUDE_DIR ${PV_INSTALL_INCLUDE_DIR})
ENDIF(PV_INSTALL_INCLUDE_DIR)
include(${ParaView_CMAKE_DIR}/VTKMono/vtkTargetExportMacros.cmake)
include(${ParaView_CMAKE_DIR}/VTKMono/vtkExportKit.cmake)
# This Needs to be done since Xdmf/CMakeLists.txt !=
# PV/Utils/Xdmf2/CMakeLists.txt
# Because INSTALL_* commands require a leading / and because INSTALL (cmake
......@@ -86,7 +89,7 @@ SET_SOURCE_FILES_PROPERTIES(
)
SET(VTK_BINARY_DIR "${Xdmf_BINARY_DIR}/vtk")
INCLUDE(${VTK_CMAKE_DIR}/vtkExportKit.cmake)
INCLUDE(${ParaView_CMAKE_DIR}/VTKMono/vtkExportKit.cmake)
VTK_EXPORT_KIT("Xdmf" "XDMF" "${Xdmf_SRCS}")
SET(VTK_BINARY_DIR "${Xdmf_BINARY_DIR}/vtk")
......@@ -99,13 +102,16 @@ IF (VTK_FOUND)
SET(LIBTYPE STATIC)
ENDIF(VTK_BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
VTK_ADD_LIBRARY(vtkXdmf ${LIBTYPE} ${Xdmf_SRCS})
PVVTK_ADD_LIBRARY(vtkXdmf ${LIBTYPE} ${Xdmf_SRCS})
add_dependencies(vtkXdmf vtklibxml2)
set(_xdmf_link_lib vtkIOCore Xdmf vtkRenderingOpenGL)
IF(VTK_USE_PARALLEL)
TARGET_LINK_LIBRARIES(vtkXdmf vtkIO Xdmf vtkRendering vtkParallel)
ELSE(VTK_USE_PARALLEL)
TARGET_LINK_LIBRARIES(vtkXdmf vtkIO Xdmf vtkRendering)
list(APPEND _xdmf_link_lib vtkParallelCore)
ENDIF(VTK_USE_PARALLEL)
target_link_libraries(vtkXdmf ${_xdmf_link_lib})
IF (VTK_USE_MPI)
# Needed for mpich 2
ADD_DEFINITIONS("-DMPICH_IGNORE_CXX_SEEK")
......@@ -122,7 +128,7 @@ ENDIF(XDMF_BUILD_MPI)
IF(VTK_WRAP_TCL)
INCLUDE(${VTK_CMAKE_DIR}/vtkWrapTcl.cmake OPTIONAL)
VTK_WRAP_TCL2(vtk${PROJECT_NAME}TCL XdmfTCL_SRCS ${Xdmf_SRCS})
VTK_ADD_LIBRARY(vtk${PROJECT_NAME}TCL ${LIBTYPE} ${XdmfTCL_SRCS} ${Xdmf_SRCS})
PVVTK_ADD_LIBRARY(vtk${PROJECT_NAME}TCL ${LIBTYPE} ${XdmfTCL_SRCS} ${Xdmf_SRCS})
IF(VTK_USE_PARALLEL)
TARGET_LINK_LIBRARIES(vtk${PROJECT_NAME}TCL vtkIOTCL vtkRenderingTCL vtkParallelTCL Xdmf)
ELSE(VTK_USE_PARALLEL)
......@@ -135,7 +141,7 @@ ENDIF(XDMF_BUILD_MPI)
IF(VTK_WRAP_PYTHON)
INCLUDE(${VTK_CMAKE_DIR}/vtkWrapPython.cmake OPTIONAL)
VTK_WRAP_PYTHON2(vtk${PROJECT_NAME}Python XdmfPython_SRCS ${Xdmf_SRCS})
VTK_ADD_LIBRARY(vtk${PROJECT_NAME}Python MODULE ${XdmfPython_SRCS} ${Xdmf_SRCS})
PVVTK_ADD_LIBRARY(vtk${PROJECT_NAME}Python MODULE ${XdmfPython_SRCS} ${Xdmf_SRCS})
IF(VTK_USE_PARALLEL)
TARGET_LINK_LIBRARIES(vtk${PROJECT_NAME}Python vtkIOPythonD vtkRenderingPythonD vtkParallelPythonD Xdmf)
ELSE(VTK_USE_PARALLEL)
......
ADD_EXECUTABLE(XdmfTestVTKIO XdmfTestVTKIO.cxx)
TARGET_LINK_LIBRARIES(XdmfTestVTKIO vtkIO vtkCommon vtkFiltering vtkGraphics vtkXdmf)
TARGET_LINK_LIBRARIES(XdmfTestVTKIO vtkIOCore vtkCommonCore vtkXdmf)
ADD_TEST(XdmfTestVTKIO ${EXECUTABLE_OUTPUT_PATH}/XdmfTestVTKIO)
......@@ -104,11 +104,11 @@ struct vtkXdmfWriterInternal
CellType(const CellType& ct) : VTKType(ct.VTKType), NumPoints(ct.NumPoints) {}
vtkIdType VTKType;
vtkIdType NumPoints;
vtkstd_bool operator<(const CellType& ct) const
bool operator<(const CellType& ct) const
{
return this->VTKType < ct.VTKType || (this->VTKType == ct.VTKType && this->NumPoints < ct.NumPoints);
}
vtkstd_bool operator==(const CellType& ct) const
bool operator==(const CellType& ct) const
{
return this->VTKType == ct.VTKType && this->NumPoints == ct.NumPoints;
}
......
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