From ba3eb7852c86d220d6449c26d48f599db0d50e7f Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 3 Jun 2021 19:19:08 +0300 Subject: [PATCH] bos #24363 [CEA 24049] SalomeFindHDF5 does not return HDF5_CXX_LIBRARY --- cmake/FindSalomeHDF5.cmake | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/cmake/FindSalomeHDF5.cmake b/cmake/FindSalomeHDF5.cmake index 1a4b27e..8f5d51e 100644 --- a/cmake/FindSalomeHDF5.cmake +++ b/cmake/FindSalomeHDF5.cmake @@ -44,10 +44,28 @@ SET(HDF5_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS};${HDF5_INCLUDE_DIR}") # Same story with libraries - if in CONFIG mode, HDF5_LIBRARIES is not defined: IF(NOT DEFINED HDF5_LIBRARIES) IF(TARGET hdf5) - SET(HDF5_LIBRARIES hdf5) + SET(HDF5_C_LIBRARIES hdf5) ELSEIF(TARGET hdf5::hdf5-shared) - SET(HDF5_LIBRARIES hdf5::hdf5-shared) + SET(HDF5_C_LIBRARIES hdf5::hdf5-shared) ENDIF() + IF(TARGET hdf5_cpp) + SET(HDF5_CXX_LIBRARIES hdf5_cpp) + ELSEIF(TARGET hdf5::hdf5-shared) + SET(HDF5_CXX_LIBRARIES hdf5::hdf5_cpp-shared) + ENDIF() + IF(TARGET hdf5_hl) + SET(HDF5_C_HL_LIBRARIES hdf5_hl) + ELSEIF(TARGET hdf5::hdf5_hl-shared) + SET(HDF5_C_HL_LIBRARIES hdf5::hdf5_hl-shared) + ENDIF() + IF(TARGET hdf5_hl_cpp) + SET(HDF5_CXX_HL_LIBRARIES hdf5_hl_cpp) + ELSEIF(TARGET hdf5::hdf5_hl_cpp-shared) + SET(HDF5_CXX_HL_LIBRARIES hdf5::hdf5_hl_cpp-shared) + ENDIF() + # Note: now we only set HDF5_LIBRARIES to CXX libraries as it's enough for SALOME. + # In future, we probably must list all libraries from requested components. + SET(HDF5_LIBRARIES ${HDF5_CXX_LIBRARIES}) ENDIF() ## -- 2.39.2