mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1676 Remove option RESINSIGHT_ENABLE_HDF5
Always link HDF library files if HDF is available. Windows : Use root folder to HDF as path for include and library files
This commit is contained in:
@@ -180,24 +180,26 @@ add_subdirectory(GeoMech/GeoMechDataModel)
|
|||||||
#
|
#
|
||||||
# HDF5
|
# HDF5
|
||||||
#
|
#
|
||||||
option(RESINSIGHT_ENABLE_HDF5 "Use HDF5" OFF)
|
|
||||||
if(RESINSIGHT_ENABLE_HDF5)
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Must specyfy libraries manually
|
# Must specyfy libraries manually
|
||||||
# Using find_package causes linking of zlib, and crashes with linking of zlib defined by Qt
|
# Using find_package causes linking of zlib, and crashes with linking of zlib defined by Qt
|
||||||
|
|
||||||
set(RESINSIGHT_HDF5_INCLUDE_DIR "" CACHE PATH "Path to HDF5 includes")
|
set(RESINSIGHT_HDF5_DIR "" CACHE PATH "Path to HDF5")
|
||||||
set(RESINSIGHT_HDF5_LIBRARY_DIR "" CACHE PATH "Path to HDF5 libraries")
|
if(NOT ${RESINSIGHT_HDF5_DIR} EQUAL "")
|
||||||
|
|
||||||
include_directories(${RESINSIGHT_HDF5_INCLUDE_DIR})
|
include_directories(${RESINSIGHT_HDF5_DIR}/include)
|
||||||
|
|
||||||
list(APPEND THIRD_PARTY_LIBRARIES
|
list(APPEND THIRD_PARTY_LIBRARIES
|
||||||
# libzlib.lib is not included here, as it is linked implicitly by Qt
|
# libzlib.lib is not included here, as it is linked implicitly by Qt
|
||||||
|
|
||||||
${RESINSIGHT_HDF5_LIBRARY_DIR}/libhdf5.lib
|
${RESINSIGHT_HDF5_DIR}/lib/libhdf5.lib
|
||||||
${RESINSIGHT_HDF5_LIBRARY_DIR}/libhdf5_cpp.lib
|
${RESINSIGHT_HDF5_DIR}/lib/libhdf5_cpp.lib
|
||||||
${RESINSIGHT_HDF5_LIBRARY_DIR}/libszip.lib
|
${RESINSIGHT_HDF5_DIR}/lib/libszip.lib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(RESINSIGHT_USE_HDF5 1)
|
||||||
|
message( STATUS "Using HDF5 from : ${RESINSIGHT_HDF5_DIR}" )
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB)
|
add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB)
|
||||||
find_package(HDF5 REQUIRED COMPONENTS CXX)
|
find_package(HDF5 REQUIRED COMPONENTS CXX)
|
||||||
@@ -208,9 +210,13 @@ if(RESINSIGHT_ENABLE_HDF5)
|
|||||||
list(APPEND THIRD_PARTY_LIBRARIES
|
list(APPEND THIRD_PARTY_LIBRARIES
|
||||||
${HDF5_LIBRARIES}
|
${HDF5_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(RESINSIGHT_USE_HDF5 1)
|
||||||
|
message( STATUS "Using HDF5 libraries : ${HDF5_LIBRARIES}" )
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (${RESINSIGHT_USE_HDF5})
|
||||||
list( APPEND CPP_SOURCES
|
list( APPEND CPP_SOURCES
|
||||||
FileInterface/RifHdf5Reader.h
|
FileInterface/RifHdf5Reader.h
|
||||||
FileInterface/RifHdf5Reader.cpp
|
FileInterface/RifHdf5Reader.cpp
|
||||||
|
|||||||
Reference in New Issue
Block a user