Skip to content

Update CMakeLists.txt to correct output directory for generated git v…#10

Merged
Katze719 merged 1 commit intomainfrom
use-correct-dirs
Dec 3, 2025
Merged

Update CMakeLists.txt to correct output directory for generated git v…#10
Katze719 merged 1 commit intomainfrom
use-correct-dirs

Conversation

@Katze719
Copy link
Member

@Katze719 Katze719 commented Dec 3, 2025

…ersion and refine compile commands condition

  • Changed the output directory for the generated git version from ${CMAKE_SOURCE_DIR} to ${CMAKE_CURRENT_SOURCE_DIR} to ensure proper path resolution.
  • Updated the condition for exporting compile commands to check if the project is top-level, enhancing the build configuration logic.

…ersion and refine compile commands condition

- Changed the output directory for the generated git version from `${CMAKE_SOURCE_DIR}` to `${CMAKE_CURRENT_SOURCE_DIR}` to ensure proper path resolution.
- Updated the condition for exporting compile commands to check if the project is top-level, enhancing the build configuration logic.
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

This PR improves the CMake configuration for the cpp-core library by addressing path resolution issues and enhancing build logic for use as a subdirectory. The changes ensure proper behavior both when building the project standalone and when it's included as a subdirectory of another project.

Key Changes:

  • Updated the output directory for generated git version files to use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR for correct path resolution
  • Added PROJECT_IS_TOP_LEVEL check to the compile commands export condition to prevent unwanted file copying when used as a subdirectory

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

@Katze719 Katze719 merged commit f75f3d8 into main Dec 3, 2025
6 checks passed
@Katze719 Katze719 deleted the use-correct-dirs branch December 3, 2025 20:18
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.

3 participants