Merged
Conversation
…ersion parsing utilities in CMake. Update CMakeLists.txt to include version setup and remove hardcoded version numbers.
Contributor
There was a problem hiding this comment.
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.txtto store the project version. - Updates
config.h.into use a single-lineVERSION_STRING. - Introduces
cmake/Version.cmakewith parsing and setup functions. - Modifies
CMakeLists.txtto 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_filewith 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 preventconfigure_filefrom substituting correctly. It should be@libCacheSim_VERSION_MAJOR@. Apply the same change forVERSION_MINORandVERSION_PATCH.
#define VERSION_MAJOR @libCacheSim_VERSION_MAJOR @
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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