[Build] Updated VTR Versioning #3179
Open
+377
−89
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.
The way VTR was setting its version information was slightly non-standard and was potentially causing issues when VTR was being built using sudo and then used by a non-sudoer. The reason this process is so complicated is because we want the versioning information to change if anything is modified in the repository or a new commit is created.
Rylie Pavlik provides a CMake module to do exactly this, which is also used by the OpenROAD project. I updated our build process to use this CMake module.
This also resolved an issue where VTR's version was printing v9.0.0; while our revision was showing v8.0.0. Now they both show v9.0.0.
Resolves #3173
This is what

vpr --version
looked like before this change:This is what it looks like now:

Notice that the revision now says v9.0.0.
Making any changes on the branch with a commit will change this version (by incrementing the number of commits since v9.0.0). Making any changes on the branch without a commit will change this version by adding "-dirty" to the version:

Since this CMake module came from an external source, it comes with the Boost Software License (BSL-1.0). Since this license is more permissive than the MIT license, it should be compatible with VTR's license.