diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 8608c678062..4b1a2d66c46 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -209,7 +209,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5c++ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 120dc1a42d6..ae815f244ac 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -556,7 +556,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_Fortran_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5fc diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 1eac9fe9228..e4886567d10 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -120,7 +120,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++ diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 38529b4c70e..4f0b45167b8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -353,7 +353,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_Fortran_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_Fortran_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_Fortran_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5hlfc diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 785bdcfc784..427424ea50b 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -152,7 +152,11 @@ install ( ) if (NOT WIN32 AND NOT MINGW) - set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5hlcc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a2d4c3736e8..0d2d960fd07 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1352,7 +1352,11 @@ install ( ) if (NOT WIN32) - set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER}) + else () + set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER}) + endif () configure_file ( ${HDF_RESOURCES_DIR}/libh5cc.in ${HDF5_BINARY_DIR}/CMakeFiles/h5cc @@ -1364,6 +1368,20 @@ if (NOT WIN32) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE COMPONENT libraries ) + if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) + #legacy requires a different name + configure_file ( + ${HDF_RESOURCES_DIR}/libh5cc.in + ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc + @ONLY + ) + install ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc + DESTINATION ${HDF5_INSTALL_BIN_DIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + COMPONENT libraries + ) + endif () endif () #-----------------------------------------------------------------------------