Skip to content

Avoid CMAKE_SOURCE_DIR#183

Merged
derobins merged 6 commits intodevelopfrom
derobins/project_source_dir
Feb 12, 2026
Merged

Avoid CMAKE_SOURCE_DIR#183
derobins merged 6 commits intodevelopfrom
derobins/project_source_dir

Conversation

@derobins
Copy link
Collaborator

@derobins derobins commented Feb 7, 2026

If hipFile is used as a subproject in another project, CMAKE_SOURCE_DIR will point to the root of that project instead of ours, which could break the build. These changes use alternative paths to address this.

Part of AIHIPFILE-129

Copilot AI review requested due to automatic review settings February 7, 2026 01:48
@derobins derobins requested a review from gaoikawa as a code owner February 7, 2026 01:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates CMake path references to work correctly when this repository is included as a subproject, avoiding accidental resolution to a parent project’s root.

Changes:

  • Replaced CMAKE_SOURCE_DIR with PROJECT_SOURCE_DIR across several CMake modules.
  • Updated module path and various file/directory references (coverage include, headers, examples, docs input, shared includes, license path).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cmake/AISUseGTest.cmake Updates coverage include file path to use project root.
cmake/AISInstall.cmake Installs headers/examples and sets CPack license path from project root.
cmake/AISDocumentation.cmake Points Doxygen input at the project’s include directory.
cmake/AISAddLibraries.cmake Uses project root for adding the shared include directory.
cmake/AISAddExecutable.cmake Uses project root for adding the shared include directory.
CMakeLists.txt Sets CMAKE_MODULE_PATH relative to the project root.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@derobins derobins changed the title CMAKE_SOURCE_DIR --> PROJECT_SOURCE_DIR Avoid CMAKE_SOURCE_DIR Feb 7, 2026
Copilot AI review requested due to automatic review settings February 7, 2026 02:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@derobins derobins marked this pull request as draft February 9, 2026 14:25
@derobins derobins force-pushed the derobins/project_source_dir branch from 6922745 to 3c241a7 Compare February 9, 2026 17:51
If hipFile is used as a subproject in another project,
`CMAKE_SOURCE_DIR` will point to the root of *that* project
instead of ours. `PROJECT_SOURCE_DIR` will point to *our*
project root, which is the root of the repo.
Copilot AI review requested due to automatic review settings February 11, 2026 22:25
@derobins derobins force-pushed the derobins/project_source_dir branch from 3c241a7 to 041f49c Compare February 11, 2026 22:25
@derobins derobins marked this pull request as ready for review February 11, 2026 22:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 11, 2026 22:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@derobins derobins merged commit 370110a into develop Feb 12, 2026
33 of 36 checks passed
@derobins derobins deleted the derobins/project_source_dir branch February 12, 2026 17:21
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.

2 participants