Let cmake generate the needed version strings, so we don't
have to spend program time doing it. This simplifies the
settings manager versioning.
Also, convert some file line endings to UNIX from Windows.
A more robust fix for https://gitlab.com/kicad/code/kicad/-/issues/4015.
CHANGED: Update the Linux appdata file to include new tags
* Include version tags (and others) in the appdata file
* Refactor the version string generation to clean it up
Git is always used to generate the KiCad version string using the
command `git describe --dirty`. This gives a more concise and
accurate version string than the previous method. When git is not
available, the version string defaults to the value defined in
KiCadVersion.cmake. It is imperative that moving forward that the
default version string be updated the commit following a git tag
so that when git is not available, the last known commit following
a git tag will at least give some usable information about which
development branch of KiCad was used for a build.
Define empty string variable KICAD_BRANCH_NAME that can be used as an
optional version string element. When git is used to build the version
string, this variable is set to the git branch name. It can also be
defined at configuration time as an optional string appended to the
$KICAD_VERSION variable.
Define empty string variable KICAD_VERSION_EXTRA that can be set by
the user at configuration.
The variables KICAD_BRANCH_NAME and KICAD_VERSION_EXTRA are only
appended to KICAD_VERSION if they are set. Otherwise, only KICAD_VERSION
is uses as the version string.
Update the developer building from source document to reflect the changes.
When the version string in KiCadVersion.cmake is set to something other
than the default "no-vcs-found", it ignores the git version even if a
.git folder exists in the source folder.
Remove the KICAD_REPO_NAME option from the main cmake file and the
generated config.h file since it is no longer used.
Set the default branch name to "undefined" in CreateGitVersionHeader.cmake
instead of the KICAD_REPO_NAME option.
Remove generating KICAD_FULL_VERSION from CreateGitVersionHeader.cmake
and add it to WriteVersionHeader.cmake so that the default settings and
the new KiCadVersion.cmake definitions can be used to generate the full
version string as well.
Check to see if the branch name is set and only use the version to
generate the full version string. This allows the use of the KiCad
version cmake file to create a version only string like "4.0.4" with
no trailing branch name.
Change build_version.cpp to use the full version string rather than
concatenating the version and branch strings.
Add KiCadVersion.cmake to set the build version and branch name.
Update WriteVersionHeader.cmake to include KiCadVersion.cmake to set
the defaults in case no .git directory is found.
This commit also simplifies the rewrite logic slightly, removing the
regex parsing.
Bug introduced in:
commit 47772e7ae3
Author: Chris Pavlina <pavlina.chris@gmail.com>
Date: Sun Sep 25 10:28:50 2016 -0400
cmake: rewrite version header when branch changes
Before, only KICAD_BUILD_VERSION, which includes the hash but not the
branch, was compared when deciding whether to regenerate
kicad_build_version.h. This header also contains the branch name though,
so we should compare both to address the case of two branches pointing
at the same commit.
Before, only KICAD_BUILD_VERSION, which includes the hash but not the
branch, was compared when deciding whether to regenerate
kicad_build_version.h. This header also contains the branch name though,
so we should compare both to address the case of two branches pointing
at the same commit.
It is no longer necessary (or sensible) to include a simulated bzr
revision number, and we can reliably get a branch name now. Therefore,
the new version strings look like:
(2016-08-26 revision 67230ac)-master
| | |
| | branch name, "HEAD" if not on a branch,
| | or "unknown" if no .git present
| |
| abbreviated commit hash, or no-git if no .git
| present
|
date of commit, or date of build if no .git present
Signed-off-by: Chris Pavlina <pavlina.chris@gmail.com>
* Add CreateGitVersionHeader.cmake to extract git version information to create the kicad version
header.
* Add check for .git folder in source path to trigger git version CMake macro.
* Use CMake add_custom_target() to run WriteVersionHeader.cmake as a command.
* Modify WriteVersionHeader.cmake to be run as a command instead of a macro.
* Add version header creation as a CMake common library build dependency.
* Add cached CMake variable KICAD_BUILD_VERSION when build version is defined during
configuration.
* Fix CMake macro create_bzr_version_header to always update version.h file whenever a repo change
is found. Running `make rebuild_cache is no longer required.
* Add new CMake function for writing version.h file.
* Always use version.h file for build version string instead of meaningless hard coded date.
* Only use bzr version string when build version is not defined at configuration time for stable release
version strings.
* Minor cleanup of FindBazaar.cmake.
* Remove unnecessary version.h.cmake file.