diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt index 4e5ad235cd..ec3edd5417 100644 --- a/ApplicationCode/CMakeLists.txt +++ b/ApplicationCode/CMakeLists.txt @@ -237,9 +237,21 @@ if (RESINSIGHT_FOUND_HDF5) FileInterface/RifHdf5Reader.cpp ) + add_definitions(-DUSE_HDF5) + + if(MSVC) + add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB) + + include_directories(${RESINSIGHT_HDF5_DIR}/include) + else() + add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB) + add_definitions(${HDF5_DEFINITIONS}) + + include_directories(${HDF5_INCLUDE_DIRS}) + endif() # MSVC + source_group( "FileInterface" FILES FileInterface/RifHdf5Reader.h FileInterface/RifHdf5Reader.cpp ) - add_definitions(-DUSE_HDF5) endif() if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_SOURING) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36f0bce33e..9f3ada9dfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,10 +164,6 @@ mark_as_advanced(FORCE RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_SOURING) if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_SOURING) if(MSVC) if(NOT ${RESINSIGHT_HDF5_DIR} EQUAL "") - add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB) - - include_directories(${RESINSIGHT_HDF5_DIR}/include) - list(APPEND EXTERNAL_LINK_LIBRARIES ${RESINSIGHT_HDF5_DIR}/lib/hdf5.lib ${RESINSIGHT_HDF5_DIR}/lib/hdf5_cpp.lib @@ -181,10 +177,6 @@ if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_SOURING) else() find_package(HDF5 COMPONENTS CXX) if (HDF5_FOUND) - add_definitions(-DH5_BUILT_AS_DYNAMIC_LIB) - add_definitions(${HDF5_DEFINITIONS}) - include_directories(${HDF5_INCLUDE_DIRS}) - list(APPEND EXTERNAL_LINK_LIBRARIES ${HDF5_LIBRARIES} ) @@ -198,7 +190,6 @@ if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_SOURING) message( STATUS "Bundling of HDF5 libraries is enabled" ) endif() # RESINSIGHT_HDF5_BUNDLE_LIBRARIES - else() message( WARNING "Use of HDF5 is enabled, but no HDF5 is found." ) endif() # HDF5_FOUND