Salome HOME
CMake: bug fix in HDF5 detection. Making CONFIG mode and MODULE mode consistent:
authorbruneton <bruneton>
Fri, 19 Jul 2013 13:09:52 +0000 (13:09 +0000)
committerbruneton <bruneton>
Fri, 19 Jul 2013 13:09:52 +0000 (13:09 +0000)
both give out variables HDF5_LIBRARIES and HDF5_INCLUDE_DIRS

salome_adm/cmake_files/FindSalomeHDF5.cmake

index b00b1b4216a4378ad49228bd934694d13445777a..a65e40f9bfef4f75f0c4fb19f7b7e0689d91593f 100644 (file)
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(HDF5 HDF5_INCLUDE_DIR 1)
 MARK_AS_ADVANCED(FORCE HDF5_INCLUDE_DIR HDF5_LIB)
 
+# Stupidly enough, CONFIG mode and MODULE mode for HDF5 do not return the same thing ...!
+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)
+  SET(HDF5_LIBRARIES hdf5)
+ENDIF()
+
 ##
 ## 7. Specific to HDF5 only:
 ## Expose MPI configuration to the rest of the world