Skip to content

Commit

Permalink
[Conan] Fixed hdf5 linking errors on MSVC 2019.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Jan 15, 2020
1 parent ddf4abb commit 393b525
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Applications/DataExplorer/NetCdfDialog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ target_link_libraries(NetCdfDialogLib
${HDF5_HL_LIBRARIES}
${HDF5_LIBRARIES}
PRIVATE MathLib)
if(OGS_USE_CONAN AND MSVC)
target_link_libraries(NetCdfDialogLib PUBLIC ${CONAN_LIBS})
endif()
set_property(TARGET NetCdfDialogLib PROPERTY FOLDER "DataExplorer")

# Workaround for system installed VTK (tested on arch)
Expand Down
3 changes: 3 additions & 0 deletions Applications/Utils/FileConverter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ if(TARGET NetCdfConverter)
${NETCDF_LIBRARIES_C}
${HDF5_HL_LIBRARIES}
${HDF5_LIBRARIES})
if(OGS_USE_CONAN AND MSVC)
target_link_libraries(NetCdfConverter ${CONAN_LIBS})
endif()
endif()
8 changes: 7 additions & 1 deletion scripts/cmake/Find.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ if(OGS_USE_NETCDF)
set(NETCDF_ROOT ${CONAN_NETCDF-C_ROOT})
set(NETCDF_CXX_ROOT ${CONAN_NETCDF-CXX_ROOT})
find_package(NetCDF REQUIRED)
find_package(HDF5 REQUIRED COMPONENTS C HL)
if(OGS_USE_CONAN AND MSVC)
set(HDF5_DIR ${CONAN_HDF5_ROOT}/cmake/hdf5)
find_package(HDF5 REQUIRED COMPONENTS C HL NO_MODULE)
else()
find_package(HDF5 REQUIRED COMPONENTS C HL)
endif()

endif()

# lapack
Expand Down

0 comments on commit 393b525

Please sign in to comment.