Skip to content

cmake: include GNUInstallDirs before install interface paths#345

Open
fallintoplace wants to merge 1 commit into
NVIDIA:developfrom
fallintoplace:fix/gnuinstalldirs-before-target-include
Open

cmake: include GNUInstallDirs before install interface paths#345
fallintoplace wants to merge 1 commit into
NVIDIA:developfrom
fallintoplace:fix/gnuinstalldirs-before-target-include

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Why

CMAKE_INSTALL_INCLUDEDIR could be empty when used in target_include_directories() before GNUInstallDirs is included, causing invalid installed include paths for package consumers.

What changed

  • Move include(GNUInstallDirs) to immediately after project() so CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_BINDIR, and CMAKE_INSTALL_INCLUDEDIR are defined before any usage.

Validation

No tests were run per request.

Summary by CodeRabbit

  • Chores
    • Streamlined the build setup for installation paths, making standard install directories available earlier in the configuration process.
    • Removed a redundant configuration step to keep packaging and export handling cleaner and more consistent.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b6abf539-c14d-4c7a-8e79-f84fb87e06d9

📥 Commits

Reviewing files that changed from the base of the PR and between 52119ee and d093754.

📒 Files selected for processing (1)
  • CMakeLists.txt

📝 Walkthrough

Walkthrough

The include(GNUInstallDirs) statement in CMakeLists.txt was moved earlier in the file, with the previously later, redundant occurrence removed. No functional or exported entity changes were made.

Changes

CMake Include Reorganization

Layer / File(s) Summary
Move GNUInstallDirs include earlier
CMakeLists.txt
include(GNUInstallDirs) is added earlier in the file with explanatory comments; the duplicate later include before the packaging section is removed.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change to move GNUInstallDirs earlier so install interface paths are defined before use.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Warning

⚠️ This pull request shows signs of AI-generated slop (redundant_comments). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

Sign up for free to 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.

1 participant