Skip to content

Honor CMAKE_INSTALL_INCLUDEDIR in exported header paths - #258

Open
Alb3e3 wants to merge 1 commit into
google:mainfrom
Alb3e3:fix/export-installed-header-paths
Open

Honor CMAKE_INSTALL_INCLUDEDIR in exported header paths#258
Alb3e3 wants to merge 1 commit into
google:mainfrom
Alb3e3:fix/export-installed-header-paths

Conversation

@Alb3e3

Copy link
Copy Markdown

Fixes#206.

The install rules honor CMAKE_INSTALL_INCLUDEDIR, but the exported target still
points its public header sources and include directory at <prefix>/include.
An external CMake consumer therefore fails to configure when headers are
installed in a separate prefix or a custom relative directory.

Use CMAKE_INSTALL_INCLUDEDIR for those exported paths and load GNUInstallDirs
before constructing the target. This preserves the default layout and relative
path relocation without dropping the public header sources.

Verified the original failure with an installed-package consumer. After the
change, that consumer builds and roundtrips data with default, custom relative,
absolute split-prefix, relocated default, and shared-library split-prefix
installations. All 25 unit tests and a shortened run of all benchmarks pass
with GCC 15.2 and CMake 3.31.6 on Linux.

AI assistance was used to prepare this patch and run local validation.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support for headers in a split prefix broken between 1.2.1 and 1.2.2

1 participant

@Alb3e3