Skip to content

CMake linking: Issue using Fortran include paths #5513

@lte678

Description

@lte678

Description
When linking the library including Fortran bindings with CMake, the HDF5_INCLUDE_DIR_FORTRAN is incorrectly set.

This means that the Fortran compiler will throw warnings when looking for the non-existent directory, and .mod files cannot be linked.

I might do something like this:

find_package(HDF5 NAMES hdf5 COMPONENTS C Fortran shared)
include_directories(${HDF5_INCLUDE_DIR_FORTRAN})

Expected behavior
I expect the HDF5_INCLUDE_DIR_FORTRAN to be one of /usr/include/mod/{shared, static}, but instead it is /usr/include/{shared, static}

Platform

  • HDF5 version: 1.14.6-4
  • Arch Linux, Kernel 6.14.4-arch1-1
  • gfortran 15.1.1
  • CMake 4.0.1 using Makefiles

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions