Commit 28bd67ab authored by David Partyka's avatar David Partyka
Browse files

Merge branch 'vtkhdf5'

parents 5f897005 16f67adf
#
# Find the native HDF5 includes and library
#
# HDF5_INCLUDE_DIR - where to find H5public.h, etc.
# HDF5_LIBRARIES - List of fully qualified libraries to link against when using hdf5.
# HDF5_FOUND - Do not attempt to use hdf5 if "no" or undefined.
FIND_PATH(HDF5_INCLUDE_DIR H5public.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(HDF5_LIBRARY hdf5
/usr/local/lib
/usr/lib
)
IF(HDF5_INCLUDE_DIR)
IF(HDF5_LIBRARY)
SET( HDF5_LIBRARIES ${HDF5_LIBRARY} )
SET( HDF5_FOUND "YES" )
ENDIF(HDF5_LIBRARY)
ENDIF(HDF5_INCLUDE_DIR)
#########################################################################
# Configure HDF5
IF(VTK_USE_SYSTEM_HDF5)
find_package(HDF5 REQUIRED)
find_package(ZLIB)
SET(VTK_HDF5_LIBRARIES ${HDF5_LIBRARIES})
ELSE(VTK_USE_SYSTEM_HDF5)
# Tell hdf5 that we are manually overriding certain settings
SET(HDF5_EXTERNALLY_CONFIGURED ON)
# Avoid duplicating names of installed libraries
SET(HDF5_EXTERNAL_LIB_PREFIX "vtk")
# Export configuration to this export variable
SET(HDF5_EXPORTED_TARGETS ${VTK_INSTALL_EXPORT_NAME})
# Silence HDF5's warnings. We'll let them get fixed upstream
# and merge in updates as necessary.
SET(HDF5_DISABLE_COMPILER_WARNINGS ON CACHE BOOL "Disable HDF5 warnings" FORCE)
SET(HDF5_INSTALL_NO_DEVELOPMENT ${VTK_INSTALL_NO_DEVELOPMENT})
SET(HDF5_INSTALL_BIN_DIR ${VTK_INSTALL_BIN_DIR})
SET(HDF5_INSTALL_LIB_DIR ${VTK_INSTALL_LIB_DIR})
SET(HDF5_INSTALL_INCLUDE_DIR ${VTK_INSTALL_INCLUDE_DIR})
SET(HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE)
# Setup all necessary overrides for zlib so that HDF5 uses our
# internally compiled zlib rather than any other version
IF(HDF5_ENABLE_Z_LIB_SUPPORT)
# We must tell the main HDF5 library that it depends on our zlib
SET(HDF5_LIB_DEPENDENCIES vtkzlib)
# Override the zlib header file
IF(VTK_USE_SYSTEM_ZLIB)
SET(H5_ZLIB_HEADER "zlib.h")
ELSE(VTK_USE_SYSTEM_ZLIB)
SET(H5_ZLIB_HEADER "vtk_zlib.h")
# Set vars that FindZlib would have set if used in sub project
SET(ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}")
SET(ZLIB_LIBRARIES vtkzlib)
ENDIF(VTK_USE_SYSTEM_ZLIB)
ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT)
MARK_AS_ADVANCED(
H5_SET_LIB_OPTIONS
H5_LEGACY_NAMING
HDF5_ENABLE_COVERAGE
HDF5_DISABLE_COMPILER_WARNINGS
HDF5_ENABLE_PARALLEL
HDF5_USE_16_API_DEFAULT
HDF5_USE_FILTER_FLETCHER32
HDF5_USE_FILTER_NBIT
HDF5_USE_FILTER_SCALEOFFSET
HDF5_USE_FILTER_SHUFFLE
HDF5_ENABLE_Z_LIB_SUPPORT
HDF5_ENABLE_SZIP_SUPPORT
HDF5_ENABLE_SZIP_ENCODING
HDF5_ENABLE_THREADSAFE
HDF5_ENABLE_TRACE
HDF5_USE_H5DUMP_PACKED_BITS
HDF5_BUILD_FORTRAN
HDF5_BUILD_EXAMPLES
HDF5_BUILD_CPP_LIB
HDF5_BUILD_TOOLS
HDF5_BUILD_HL_LIB
HDF5_Enable_Clear_File_Buffers
HDF5_Enable_Instrument
HDF5_STRICT_FORMAT_CHECKS
HDF5_METADATA_TRACE_FILE
HDF5_WANT_DATA_ACCURACY
HDF5_WANT_DCONV_EXCEPTION
HDF5_ENABLE_LARGE_FILE
HDF5_STREAM_VFD
HDF5_ENABLE_HSIZET
H5_SET_LIB_OPTIONS
HDF5_BUILD_WITH_INSTALL_NAME
HDF5_PACKAGE_EXTLIBS
)
ENDIF(VTK_USE_SYSTEM_HDF5)
\ No newline at end of file
......@@ -48,7 +48,12 @@ ENDMACRO(VTK_THIRD_PARTY_INCLUDE2)
#-----------------------------------------------------------------------------
MACRO(VTK_THIRD_PARTY_SUBDIR upper lower)
IF(NOT VTK_USE_SYSTEM_${upper})
# we don't want to build third party tests.
SET(__vtk_build_testing ${BUILD_TESTING})
SET(BUILD_TESTING OFF)
ADD_SUBDIRECTORY(${lower})
# restore BUILD_TESTING
SET (BUILD_TESTING ${__vtk_build_testing})
ENDIF(NOT VTK_USE_SYSTEM_${upper})
ENDMACRO(VTK_THIRD_PARTY_SUBDIR)
......
......@@ -748,6 +748,8 @@ MARK_AS_ADVANCED(VTK_OPENGL_HAS_OSMESA
#-----------------------------------------------------------------------------
# Provide options to use system versions of third-party libraries.
VTK_THIRD_PARTY_OPTION(ZLIB zlib)
VTK_THIRD_PARTY_OPTION(HDF5 hdf5)
INCLUDE(vtkHDF5Library)
IF(VTK_USE_GL2PS)
VTK_THIRD_PARTY_OPTION(GL2PS gl2ps)
ENDIF(VTK_USE_GL2PS)
......
......@@ -5,6 +5,7 @@ SET_PROPERTY(GLOBAL APPEND PROPERTY VTK_TARGETS vtksys)
# Build third-party utilities.
VTK_THIRD_PARTY_SUBDIR(ZLIB vtkzlib)
VTK_THIRD_PARTY_SUBDIR(HDF5 vtkhdf5)
IF(VTK_USE_GL2PS)
VTK_THIRD_PARTY_SUBDIR(GL2PS vtkgl2ps)
ENDIF(VTK_USE_GL2PS)
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtk_hdf5.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef __vtk_hdf5_h
#define __vtk_hdf5_h
/* Use the zlib library configured for VTK. */
#include "vtkToolkits.h"
#ifdef VTK_USE_SYSTEM_HDF5
# include <hdf5.h>
#else
# include <vtkhdf5/src/hdf5.h>
#endif
#endif
......@@ -528,6 +528,14 @@ ENDIF (HDF5_BUILD_HL_LIB)
#-----------------------------------------------------------------------------
CONFIGURE_FILE (${HDF5_SOURCE_DIR}/Resources/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY)
#-----------------------------------------------------------------------------
# Generate the HDF5Config file containing build settings used by externaly
#-----------------------------------------------------------------------------
CONFIGURE_FILE (
${HDF5_SOURCE_DIR}/Resources/HDF5Config.cmake.in
${HDF5_BINARY_DIR}/vtkHDF5Config.cmake @ONLY
)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
# HDF5 Config file for CMake
#
SET(HDF5_INCLUDE_DIRS "@HDF5_INCLUDE_DIRECTORIES@i" )
SET(HDF5_INCLUDE_DIRS "@HDF5_INCLUDE_DIRECTORIES@" )
SET(HDF5_LIBRARIES "@HDF5_LIBRARIES@" )
SET(HDF5_LINK_DIRECTORIES "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@" )
......
......@@ -189,7 +189,8 @@ SET(VTK_TIFF_LIBRARIES "@VTK_TIFF_LIBRARIES@")
SET(VTK_EXPAT_LIBRARIES "@VTK_EXPAT_LIBRARIES@")
SET(VTK_FREETYPE_LIBRARIES "@VTK_FREETYPE_LIBRARIES@")
SET(VTK_LIBXML2_LIBRARIES "@VTK_LIBXML2_LIBRARIES@")
SET(VTK_LIBPROJ4_LIBRARIES "@VTK_LIBPROJ4_LIBRARIES@")
SET(VTK_LIBPROJ4_LIBRARIES "@VTK_LIBPROJ4_LIBRARIES@")
SET(VTK_HDF5_LIBRARIES "@VTK_HDF5_LIBRARIES@")
# The VTK Qt configuration.
IF(VTK_USE_QVTK)
......
......@@ -201,6 +201,7 @@ VTK_THIRD_PARTY_INCLUDE(NetCDF vtknetcdf)
VTK_THIRD_PARTY_INCLUDE(Exodus2 vtkexodus2/include)
VTK_THIRD_PARTY_INCLUDE(MATERIALLIBRARY MaterialLibrary)
VTK_THIRD_PARTY_INCLUDE(VERDICT verdict)
VTK_THIRD_PARTY_INCLUDE(HDF5 vtkhdf5/src)
IF(VTK_USE_PARALLEL)
VTK_THIRD_PARTY_INCLUDE(Cosmo Cosmo)
VTK_THIRD_PARTY_INCLUDE(VPIC VPIC)
......
......@@ -113,6 +113,7 @@
/* Whether VTK is using its own utility libraries. */
#cmakedefine VTK_USE_SYSTEM_PNG
#cmakedefine VTK_USE_SYSTEM_ZLIB
#cmakedefine VTK_USE_SYSTEM_HDF5
#cmakedefine VTK_USE_SYSTEM_JPEG
#cmakedefine VTK_USE_SYSTEM_TIFF
#cmakedefine VTK_USE_SYSTEM_EXPAT
......
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