Skip to content

Conversation

@Katze719
Copy link
Member

@Katze719 Katze719 commented Dec 2, 2025

  • Replaced the manual versioning system with automated versioning using the cmake-git-versioning module, enhancing maintainability.
  • Updated CMakeLists.txt to utilize the new versioning approach and removed the obsolete get_version_from_git.cmake script.
  • Changed the version header from version.h to version.hpp to align with C++ naming conventions.
  • Added CPM.cmake for improved package management and dependency handling.

These changes streamline the build process and improve version management based on Git tags.

- Replaced the manual versioning system with automated versioning using the `cmake-git-versioning` module, enhancing maintainability.
- Updated `CMakeLists.txt` to utilize the new versioning approach and removed the obsolete `get_version_from_git.cmake` script.
- Changed the version header from `version.h` to `version.hpp` to align with C++ naming conventions.
- Added `CPM.cmake` for improved package management and dependency handling.

These changes streamline the build process and improve version management based on Git tags.
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 refactors the CMake build configuration to replace a manual Git-based versioning system with an automated solution using the cmake-git-versioning module from an external repository. The changes introduce CPM.cmake for dependency management and update the version file naming convention from .h to .hpp.

Key Changes:

  • Replaced custom get_version_from_git.cmake script with cmake-git-versioning external module
  • Added CPM.cmake (1363 lines) for package management
  • Updated .gitignore to track version.hpp instead of version.h

Reviewed changes

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

Show a summary per file
File Description
CMakeLists.txt Refactored to use cmake-git-versioning module; removed manual version configuration; updated to fetch dependency via CPM
cmake/CPM.cmake Added CMake Package Manager for dependency handling
cmake/get_version_from_git.cmake Removed custom Git versioning script (replaced by external module)
include/cpp_core/version.h.in Removed template file (replaced by cmake-git-versioning output)
.gitignore Updated to ignore version.hpp instead of version.h

Critical Issues Found:

  • File naming inconsistency: The .gitignore and PR description indicate a switch to version.hpp, but all existing code still references version.h, which will cause build failures
  • CMake variable syntax error: Line 15 uses incorrect variable reference syntax that may not work with CMake
  • Project initialization order: External dependencies are fetched before calling project(), which violates CMake best practices

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

- Changed header file references from `version.h` to `version.hpp` in `cpp_core.h`, `serial.h`, and `get_version.h` to maintain consistency with C++ naming conventions.
- Added a new `Version` struct in `get_version.h` to encapsulate version information, improving clarity and usability when accessing version details.

These modifications enhance code organization and align with recent refactoring efforts.
@Katze719 Katze719 merged commit 72c5347 into main Dec 3, 2025
@Katze719 Katze719 deleted the use-version-module branch December 3, 2025 07:51
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