Skip to content

fix version#198

Merged
1a1a11a merged 3 commits intodevelopfrom
1a1a11a/fix_version
Jun 18, 2025
Merged

fix version#198
1a1a11a merged 3 commits intodevelopfrom
1a1a11a/fix_version

Conversation

@1a1a11a
Copy link
Copy Markdown
Owner

@1a1a11a 1a1a11a commented Jun 18, 2025

…ersion parsing utilities in CMake. Update CMakeLists.txt to include version setup and remove hardcoded version numbers.

…ersion parsing utilities in CMake. Update CMakeLists.txt to include version setup and remove hardcoded version numbers.
@1a1a11a 1a1a11a requested a review from Copilot June 18, 2025 20:34
Copy link
Copy Markdown
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 introduces a flexible version management system by adding a standalone version file and corresponding CMake utilities, removing hardcoded version values.

  • Adds version.txt to store the project version.
  • Updates config.h.in to use a single-line VERSION_STRING.
  • Introduces cmake/Version.cmake with parsing and setup functions.
  • Modifies CMakeLists.txt to include and invoke the new version utilities.

Reviewed Changes

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

File Description
version.txt Add file containing the current version string.
libCacheSim/include/config.h.in Simplify VERSION_STRING macro into a single line.
cmake/Version.cmake Add parse_version_from_file and setup_project_version functions.
CMakeLists.txt Include version utilities and replace hardcoded version definitions.
Comments suppressed due to low confidence (3)

cmake/Version.cmake:4

  • Consider adding CMake-based tests or a minimal executable target to verify parse_version_from_file with valid, invalid, and missing version files to ensure the parsing logic works as expected and prevent regressions.
function(parse_version_from_file VERSION_FILE VERSION_MAJOR_VAR VERSION_MINOR_VAR VERSION_PATCH_VAR)

version.txt:1

  • version.txt appears to contain an extra leading character (1 ). It should only include the version string, e.g., 1.0.1, with no prefix.
1.0.1

libCacheSim/include/config.h.in:3

  • There is an extra space before the closing @ in the placeholder, which will prevent configure_file from substituting correctly. It should be @libCacheSim_VERSION_MAJOR@. Apply the same change for VERSION_MINOR and VERSION_PATCH.
#define VERSION_MAJOR @libCacheSim_VERSION_MAJOR @

@1a1a11a 1a1a11a merged commit 50d2a17 into develop Jun 18, 2025
7 of 8 checks passed
@1a1a11a 1a1a11a deleted the 1a1a11a/fix_version branch June 18, 2025 20:47
@sonarqubecloud
Copy link
Copy Markdown

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