Skip to content

Building problems by using add_subdirectory #1

@Febbe

Description

@Febbe

It is not possible to build against hdf5 when the lib is added with add_subdirectory. The header file H5pubconf.h can not be found the include_dirs.
All generated header files with public visibility should be configured into an extra directory like ${CMAKE_CURRENT_BUILD_DIR}/generated/h5 and this dir should be included with

target_include_directories(mylib PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_BUILD_DIR}/generated>
  $<INSTALL_INTERFACE:include/mylib>  # <prefix>/include/mylib
)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions