Commit 8918f03d authored by Dave DeMarle's avatar Dave DeMarle
Browse files

Make it possible to use vtknetcdf4 with external hdf5.

Change-Id: I807b319b438a08dcd6236c9e149a5941859e14ab
parent 05972ce0
...@@ -803,8 +803,11 @@ MARK_AS_ADVANCED(VTK_OPENGL_HAS_OSMESA ...@@ -803,8 +803,11 @@ MARK_AS_ADVANCED(VTK_OPENGL_HAS_OSMESA
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Provide options to use system versions of third-party libraries. # Provide options to use system versions of third-party libraries.
VTK_THIRD_PARTY_OPTION(ZLIB zlib) VTK_THIRD_PARTY_OPTION(ZLIB zlib)
set(HDF5_FIND_COMPONENTS "HL;C")
VTK_THIRD_PARTY_OPTION(HDF5 hdf5) VTK_THIRD_PARTY_OPTION(HDF5 hdf5)
INCLUDE(vtkHDF5Library) INCLUDE(vtkHDF5Library)
IF(VTK_USE_GL2PS) IF(VTK_USE_GL2PS)
VTK_THIRD_PARTY_OPTION(GL2PS gl2ps) VTK_THIRD_PARTY_OPTION(GL2PS gl2ps)
ENDIF(VTK_USE_GL2PS) ENDIF(VTK_USE_GL2PS)
......
...@@ -229,11 +229,11 @@ mark_as_advanced(NETCDF_ENABLE_CXX) ...@@ -229,11 +229,11 @@ mark_as_advanced(NETCDF_ENABLE_CXX)
SET(CXX NETCDF_ENABLE_CXX) SET(CXX NETCDF_ENABLE_CXX)
OPTION(NETCDF_ENABLE_NETCDF4 "Build netcdf version 4 API" ON) OPTION(NETCDF_ENABLE_NETCDF4 "Build netcdf version 4 API" ON)
IF (NOT HDF5_BUILD_HL_LIB AND NETCDF_ENABLE_NETCDF4) if (NETCDF_ENABLE_NETCDF4 AND NOT (HDF5_BUILD_HL_LIB OR HDF5_hdf5_hl_LIBRARY))
message("ENABLE_NETCDF4 not allowed because netcdf4 functionality requires HDF5_BUILD_HL_LIB.") message("ENABLE_NETCDF4 not allowed because NETCDF4 requires HDF5_HL.")
SET(NETCDF_ENABLE_NETCDF4 OFF CACHE BOOL "Build netcdf version 4 API" FORCE) SET(NETCDF_ENABLE_NETCDF4 OFF CACHE BOOL "Build netcdf version 4 API" FORCE)
ENDIF (NOT HDF5_BUILD_HL_LIB AND NETCDF_ENABLE_NETCDF4) endif (NETCDF_ENABLE_NETCDF4 AND NOT (HDF5_BUILD_HL_LIB OR HDF5_hdf5_hl_LIBRARY))
mark_as_advanced(NETCDF_ENABLE_NETCDF4) mark_as_advanced(NETCDF_ENABLE_NETCDF4)
SET(USE_NETCDF4 ${NETCDF_ENABLE_NETCDF4} CACHE INTERNAL "" FORCE) SET(USE_NETCDF4 ${NETCDF_ENABLE_NETCDF4} CACHE INTERNAL "" FORCE)
if (NETCDF_ENABLE_NETCDF4) if (NETCDF_ENABLE_NETCDF4)
...@@ -335,8 +335,13 @@ VTK_ADD_LIBRARY(vtkNetCDF ...@@ -335,8 +335,13 @@ VTK_ADD_LIBRARY(vtkNetCDF
${netcdf_src4_SOURCES} ${netcdf_src4_SOURCES}
${netcdf_dispatch_SOURCES} ${netcdf_dispatch_SOURCES}
${netcdf_liblib_SOURCES}) ${netcdf_liblib_SOURCES})
IF (NETCDF_ENABLE_NETCDF4) IF (NETCDF_ENABLE_NETCDF4)
TARGET_LINK_LIBRARIES(vtkNetCDF ${VTK_HDF5_LIBRARIES}) if (VTK_USE_SYSTEM_HDF5)
TARGET_LINK_LIBRARIES(vtkNetCDF ${HDF5_hdf5_LIBRARY} ${HDF5_hdf5_hl_LIBRARY})
else()
TARGET_LINK_LIBRARIES(vtkNetCDF ${VTK_HDF5_LIBRARIES})
endif()
ENDIF (NETCDF_ENABLE_NETCDF4) ENDIF (NETCDF_ENABLE_NETCDF4)
VTK_ADD_LIBRARY(vtkNetCDF_cxx ${netcdf_cxx_SOURCES}) VTK_ADD_LIBRARY(vtkNetCDF_cxx ${netcdf_cxx_SOURCES})
......
Supports Markdown
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