summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-07-26 16:02:40 (GMT)
committerGitHub <noreply@github.com>2022-07-26 16:02:40 (GMT)
commit06363958513ad26b2c21cd99858183c97e6d223a (patch)
tree941a6beb2c1372f1955562c6712fd91c22be834b /fortran
parentb0240030f5dd1c3da65fd66b76fcdfe13604489c (diff)
downloadhdf5-06363958513ad26b2c21cd99858183c97e6d223a.zip
hdf5-06363958513ad26b2c21cd99858183c97e6d223a.tar.gz
hdf5-06363958513ad26b2c21cd99858183c97e6d223a.tar.bz2
Implement improved CMake fortran module folder from GH#1411 (#1922)
* Implement improved CMake fortran module folder from GH#1411 * Update docs * Fix whitespace * Fix name case
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/CMakeLists.txt11
-rw-r--r--fortran/src/Makefile.am8
-rw-r--r--fortran/src/h5fc.in3
3 files changed, 12 insertions, 10 deletions
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 639391e..9f35fa5 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -320,7 +320,7 @@ if (NOT ONLY_SHARED_LIBS)
add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES})
target_include_directories (${HDF5_F90_LIB_TARGET}
PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${HDF5_INSTALL_MODULE_DIR}/static>"
)
target_compile_options(${HDF5_F90_LIB_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}")
target_compile_definitions(${HDF5_F90_LIB_TARGET}
@@ -354,7 +354,7 @@ if (BUILD_SHARED_LIBS)
add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED})
target_include_directories (${HDF5_F90_LIBSH_TARGET}
PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${HDF5_INSTALL_MODULE_DIR}/shared>"
)
target_compile_options(${HDF5_F90_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_Fortran_FLAGS}")
target_compile_definitions(${HDF5_F90_LIBSH_TARGET}
@@ -447,7 +447,7 @@ if (NOT ONLY_SHARED_LIBS)
FILES
${mod_files}
DESTINATION
- ${HDF5_INSTALL_INCLUDE_DIR}/static
+ ${HDF5_INSTALL_MODULE_DIR}/static
COMPONENT
fortheaders
)
@@ -490,7 +490,7 @@ if (BUILD_SHARED_LIBS)
FILES
${modsh_files}
DESTINATION
- ${HDF5_INSTALL_INCLUDE_DIR}/shared
+ ${HDF5_INSTALL_MODULE_DIR}/shared
COMPONENT
fortheaders
)
@@ -539,6 +539,7 @@ set (_PKG_CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
set (_PKG_CONFIG_EXEC_PREFIX \${prefix})
set (_PKG_CONFIG_LIBDIR \${exec_prefix}/lib)
set (_PKG_CONFIG_INCLUDEDIR \${prefix}/include)
+set (_PKG_CONFIG_MODULEDIR \${prefix}/mod)
set (_PKG_CONFIG_LIBNAME "${HDF5_F90_LIB_CORENAME}")
set (_PKG_CONFIG_VERSION "${HDF5_PACKAGE_VERSION}")
@@ -555,7 +556,7 @@ set (_PKG_CONFIG_REQUIRES "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}")
set (_PKG_CONFIG_REQUIRES_PRIVATE "${HDF5_LIB_CORENAME}-${HDF5_PACKAGE_VERSION}")
configure_file (
- ${HDF_CONFIG_DIR}/libhdf5.pc.in
+ ${HDF_CONFIG_DIR}/libhdf5.fpc.in
${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_F90_LIB_CORENAME}.pc
@ONLY
)
diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am
index 65ffa0c..94fcb5a 100644
--- a/fortran/src/Makefile.am
+++ b/fortran/src/Makefile.am
@@ -22,7 +22,7 @@ include $(top_srcdir)/config/lt_vers.am
# Include src directory in both Fortran and C flags (C compiler is used
# for linking).
AM_CPPFLAGS+=-I$(top_srcdir)/src
-AM_FCFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/fortran/src
+AM_FCFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/fortran/src $(F9XMODFLAG)$(fmoddir)
AM_FCLIBS=$(LIBHDF5)
@@ -72,15 +72,15 @@ clean-local:
install-data-local:
@if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \
- $(CP) $(top_builddir)/$(subdir)/*.$(F9XMODEXT) $(DESTDIR)$(includedir)/. ; \
+ $(CP) $(top_builddir)/$(subdir)/*.$(F9XMODEXT) $(DESTDIR)$(fmoddir)/. ; \
fi
$(CP) $(top_builddir)/$(subdir)/H5f90i_gen.h $(DESTDIR)$(includedir)/.
$(CP) $(top_srcdir)/fortran/src/H5f90i.h $(DESTDIR)$(includedir)/.
uninstall-local:
@if test -n "$(F9XMODEXT)" -a "X$(F9XMODEXT)" != "Xo"; then \
- if test -f "$(includedir)/hdf5.$(F9XMODEXT)" -o -f "$(includedir)/HDF5.$(F9XMODEXT)"; then \
- set -x; $(RM) $(DESTDIR)$(includedir)/*.$(F9XMODEXT); \
+ if test -f "$(fmoddir)/hdf5.$(F9XMODEXT)" -o -f "$(fmoddir)/HDF5.$(F9XMODEXT)"; then \
+ set -x; $(RM) $(DESTDIR)$(fmoddir)/*.$(F9XMODEXT); \
fi; \
fi; \
$(RM) $(DESTDIR)$(bindir)/$(H5FC_NAME)
diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in
index 79401f8..d9fc1f5 100644
--- a/fortran/src/h5fc.in
+++ b/fortran/src/h5fc.in
@@ -26,6 +26,7 @@ prefix="@prefix@"
exec_prefix="@exec_prefix@"
libdir="@libdir@"
includedir="@includedir@"
+fmoddir="@fmoddir@"
HL="@HL@"
############################################################################
@@ -278,7 +279,7 @@ done
# It's possible that there isn't a modules flag...
fmodules=""
if test -n "$F9XMODFLAG"; then
- fmodules="${F9XMODFLAG}${includedir}"
+ fmodules="${F9XMODFLAG}${fmoddir}"
fi
if test "x$do_compile" = "xyes"; then