From bf843c54f06e9fe49ad4a2f49c49cc8b06a9bc44 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:36:20 -0500 Subject: [PATCH] Fix Fortran pkconfig to indicate full path of modules (#4593) --- fortran/src/CMakeLists.txt | 9 ++++++++- hl/fortran/src/CMakeLists.txt | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index cb0ff44f907..c94abaa6c53 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -583,7 +583,14 @@ set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) set (_PKG_CONFIG_LIBDIR \${exec_prefix}/${HDF5_INSTALL_LIB_DIR}) set (_PKG_CONFIG_INCLUDEDIR \${prefix}/${HDF5_INSTALL_INCLUDE_DIR}) -set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_MODULE_DIR}) +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_MODULE_DIR}/shared) +else () + set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_MODULE_DIR}/static) +endif () +if (NOT HDF5_INSTALL_MOD_FORTRAN MATCHES "NO") + set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_INCLUDE_DIR}) +endif () set (_PKG_CONFIG_LIBNAME "${HDF5_F90_LIB_NAME}") set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") set (PKG_CONFIG_LIBNAME "${HDF5_F90_LIB_NAME}") diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 6ebe08bdc6f..60226c81ab1 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -322,7 +322,14 @@ set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) set (_PKG_CONFIG_EXEC_PREFIX \${prefix}) set (_PKG_CONFIG_LIBDIR \${exec_prefix}/${HDF5_INSTALL_LIB_DIR}) set (_PKG_CONFIG_INCLUDEDIR \${prefix}/${HDF5_INSTALL_INCLUDE_DIR}) -set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_MODULE_DIR}) +if (BUILD_SHARED_LIBS) + set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_MODULE_DIR}/shared) +else () + set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_MODULE_DIR}/static) +endif () +if (NOT HDF5_INSTALL_MOD_FORTRAN MATCHES "NO") + set (_PKG_CONFIG_MODULEDIR \${prefix}/${HDF5_INSTALL_INCLUDE_DIR}) +endif () set (_PKG_CONFIG_LIBNAME "${HDF5_HL_F90_LIB_NAME}") set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}") set (PKG_CONFIG_LIBNAME "${HDF5_HL_F90_LIB_NAME}")