diff --git a/Applications/DataExplorer/NetCdfDialog/CMakeLists.txt b/Applications/DataExplorer/NetCdfDialog/CMakeLists.txt index a473593e20f2154fe5059c0236bc8ef9e5dedd23..b932c64fef14a009070edba23e897ab56239ba7b 100644 --- a/Applications/DataExplorer/NetCdfDialog/CMakeLists.txt +++ b/Applications/DataExplorer/NetCdfDialog/CMakeLists.txt @@ -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) diff --git a/Applications/Utils/FileConverter/CMakeLists.txt b/Applications/Utils/FileConverter/CMakeLists.txt index 28882437a085b8131fe26d1786240fbcb41b3acb..4d5aec825fb3218386ab8a80c32419bd3e3fd5bd 100644 --- a/Applications/Utils/FileConverter/CMakeLists.txt +++ b/Applications/Utils/FileConverter/CMakeLists.txt @@ -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() diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 475652a1bdf1b8452efe92647501b08fa68e3248..ff9508ac5fe2cf2ceb20f568319627f7d136331a 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -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