From 42ff83ccf2cf88514e1432bee79386ded3c04ca5 Mon Sep 17 00:00:00 2001 From: gdd Date: Thu, 13 Jun 2013 16:44:12 +0000 Subject: [PATCH] Possibility to use HDF5 compiled with CMake (and with MPI support) --- CMakeLists.txt | 4 ++-- salome_adm/cmake_files/FindSalomeHDF5.cmake | 6 ++++++ salome_adm/cmake_files/FindSalomeMPI.cmake | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fd90c7cc..d6431f5fb 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,9 +76,9 @@ find_package(SalomeBOOST) # optional prerequisites -if(SALOME_USE_MPI OR HDF5_IS_PARALLEL) +if(SALOME_USE_MPI OR HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL) find_package(SalomeMPI) -endif(SALOME_USE_MPI OR HDF5_IS_PARALLEL) +endif(SALOME_USE_MPI OR HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL) if(SALOME_USE_CORBA) find_package(OMNIORB) diff --git a/salome_adm/cmake_files/FindSalomeHDF5.cmake b/salome_adm/cmake_files/FindSalomeHDF5.cmake index 3745a99b7..e59ea8115 100644 --- a/salome_adm/cmake_files/FindSalomeHDF5.cmake +++ b/salome_adm/cmake_files/FindSalomeHDF5.cmake @@ -20,6 +20,12 @@ # HDF5 detection for Salome set(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to Hdf5 directory") + +# If HDF5 is compiled with CMake, we use the config file +if(EXISTS ${HDF5_ROOT_DIR}/share/cmake/hdf5) + INCLUDE(${HDF5_ROOT_DIR}/share/cmake/hdf5/hdf5-config.cmake) +endif(EXISTS ${HDF5_ROOT_DIR}/share/cmake/hdf5) + if(EXISTS ${HDF5_ROOT_DIR}) set(CMAKE_INCLUDE_PATH ${HDF5_ROOT_DIR}/include) set(CMAKE_LIBRARY_PATH ${HDF5_ROOT_DIR}/lib) diff --git a/salome_adm/cmake_files/FindSalomeMPI.cmake b/salome_adm/cmake_files/FindSalomeMPI.cmake index 2b3062367..b1fdb8894 100644 --- a/salome_adm/cmake_files/FindSalomeMPI.cmake +++ b/salome_adm/cmake_files/FindSalomeMPI.cmake @@ -26,7 +26,7 @@ if(EXISTS ${MPI_ROOT_DIR}) set(CMAKE_PROGRAM_PATH ${MPI_ROOT_DIR}/bin) endif(EXISTS ${MPI_ROOT_DIR}) find_package(MPI REQUIRED) -if(HDF5_IS_PARALLEL) +if(HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL) set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS} ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH} ) set(HDF5_LIBRARIES ${HDF5_LIBRARIES} ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES}) -endif(HDF5_IS_PARALLEL) +endif(HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL) -- 2.39.2