mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
This commit is contained in:
parent
ca1e08a1a4
commit
bc4edf6db3
@ -179,29 +179,46 @@ add_subdirectory(GeoMech/GeoMechDataModel)
|
|||||||
|
|
||||||
#
|
#
|
||||||
# HDF5
|
# HDF5
|
||||||
|
#
|
||||||
option(RESINSIGHT_ENABLE_HDF5 "Use HDF5" OFF)
|
option(RESINSIGHT_ENABLE_HDF5 "Use HDF5" OFF)
|
||||||
if(RESINSIGHT_ENABLE_HDF5)
|
if(RESINSIGHT_ENABLE_HDF5)
|
||||||
add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB)
|
if(MSVC)
|
||||||
find_package(HDF5 REQUIRED COMPONENTS CXX)
|
# Must specyfy libraries manually
|
||||||
if (HDF5_FOUND)
|
# Using find_package causes linking of zlib, and crashes with linking of zlib defined by Qt
|
||||||
add_definitions(${HDF5_DEFINITIONS})
|
|
||||||
include_directories(${HDF5_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
|
set(RESINSIGHT_HDF5_INCLUDE_DIR "" CACHE PATH "Path to HDF5 includes")
|
||||||
|
set(RESINSIGHT_HDF5_LIBRARY_DIR "" CACHE PATH "Path to HDF5 libraries")
|
||||||
|
|
||||||
|
include_directories(${RESINSIGHT_HDF5_INCLUDE_DIR})
|
||||||
|
|
||||||
list(APPEND THIRD_PARTY_LIBRARIES
|
list(APPEND THIRD_PARTY_LIBRARIES
|
||||||
${HDF5_LIBRARIES}
|
# libzlib.lib is not included here, as it is linked implicitly by Qt
|
||||||
|
|
||||||
|
${RESINSIGHT_HDF5_LIBRARY_DIR}/libhdf5.lib
|
||||||
|
${RESINSIGHT_HDF5_LIBRARY_DIR}/libhdf5_cpp.lib
|
||||||
|
${RESINSIGHT_HDF5_LIBRARY_DIR}/libszip.lib
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB)
|
||||||
|
find_package(HDF5 REQUIRED COMPONENTS CXX)
|
||||||
|
if (HDF5_FOUND)
|
||||||
|
add_definitions(${HDF5_DEFINITIONS})
|
||||||
|
include_directories(${HDF5_INCLUDE_DIRS})
|
||||||
|
|
||||||
list( APPEND CPP_SOURCES
|
list(APPEND THIRD_PARTY_LIBRARIES
|
||||||
FileInterface/RifHdf5Reader.h
|
${HDF5_LIBRARIES}
|
||||||
FileInterface/RifHdf5Reader.cpp
|
)
|
||||||
)
|
endif()
|
||||||
|
|
||||||
source_group( "FileInterface" FILES FileInterface/RifHdf5Reader.h FileInterface/RifHdf5Reader.cpp )
|
|
||||||
|
|
||||||
add_definitions(-DUSE_HDF5)
|
|
||||||
# TODO add_subdirectory(HDF/Hdf5Reader)
|
|
||||||
message( STATUS "Linking HD5 libraries : ${HDF5_LIBRARIES}" )
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
list( APPEND CPP_SOURCES
|
||||||
|
FileInterface/RifHdf5Reader.h
|
||||||
|
FileInterface/RifHdf5Reader.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
source_group( "FileInterface" FILES FileInterface/RifHdf5Reader.h FileInterface/RifHdf5Reader.cpp )
|
||||||
|
|
||||||
|
add_definitions(-DUSE_HDF5)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user