Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Use standard CMAKE_INSTALL_INCLUDEDIR #347

Merged
merged 2 commits into from
Nov 17, 2022

Conversation

KiruyaMomochi
Copy link
Contributor

@KiruyaMomochi KiruyaMomochi commented Nov 16, 2022

Current code uses hard-coded include or CMAKE_INSTALL_INCDIR to specify included directories. It makes the installed target not work with Nix, which tries to split headers into a different package.

https://github.com/NixOS/nixpkgs/blob/7cb6229334cecda7592a6df2a23a2d19549044f1/pkgs/build-support/setup-hooks/multiple-outputs.sh#L150-L165

CMAKE_INSTALL_INCLUDEDIR is CMake’s recommended standard for setting header location. It allows package maintainers like Nix to control the install destination by setting appropriate cache variables.

https://github.com/NixOS/nixpkgs/blob/7cb6229334cecda7592a6df2a23a2d19549044f1/pkgs/development/tools/build-managers/cmake/setup-hook.sh#L91-L103

Current code uses hard-coded `include` or `CMAKE_INSTALL_INCDIR` to specify included directories. It makes the installed target not work with Nix, which tries to split headers into a different package. `CMAKE_INSTALL_INCLUDEDIR` is CMake’s recommended standard for setting header location. It allows package maintainers like Nix to control the install destination by setting appropriate cache variables.
@CLAassistant
Copy link

CLAassistant commented Nov 16, 2022

CLA assistant check
All committers have signed the CLA.

@KiruyaMomochi KiruyaMomochi marked this pull request as ready for review November 16, 2022 17:47
@rpavlik
Copy link
Contributor

rpavlik commented Nov 16, 2022

Good catch, I'm not sure why we weren't using that right, I definitely know and have used CMAKE_INSTALL_INCLUDEDIR. We do have to override it if we're packaging for an Android AAR file.

Copy link
Contributor

@rpavlik rpavlik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was slightly nervous this would break the AAR/prefab generation for Android, but I tested locally and it looks fine. Thanks!

@rpavlik
Copy link
Contributor

rpavlik commented Nov 16, 2022

Would you mind adding a changelog fragment in the changes/sdk directory named pr.347.gh.OpenXR-SDK-Source.md ?

@rpavlik rpavlik added the needs changelog fragment Someone, preferably the submitter, needs to add a changelog fragment describing this. label Nov 16, 2022
@KiruyaMomochi KiruyaMomochi changed the title cmake: use standard CMAKE_INSTALL_INCLUDEDIR cmake: Use standard CMAKE_INSTALL_INCLUDEDIR Nov 17, 2022
@rpavlik
Copy link
Contributor

rpavlik commented Nov 17, 2022

Awesome, thanks!

@rpavlik rpavlik merged commit 574312e into KhronosGroup:main Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changelog fragment Someone, preferably the submitter, needs to add a changelog fragment describing this.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants