-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version is now generated automatically based on git tags. Both cases are handled: building from git tree and building tarball downloaded from github. Works for qmake and cmake
- Loading branch information
Showing
12 changed files
with
95 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
limereport/version.h.in export-subst |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
find_package(Git) | ||
|
||
if(GIT_EXECUTABLE) | ||
# Generate a git-describe version string from Git repository tags | ||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} describe --tags --dirty | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_DESCRIBE_VERSION | ||
RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(NOT GIT_DESCRIBE_ERROR_CODE) | ||
set(GIT_VERSION ${GIT_DESCRIBE_VERSION}) | ||
endif() | ||
endif() | ||
|
||
# Final fallback: Just use a bogus version string that is semantically older | ||
# than anything else and spit out a warning to the developer. | ||
if(NOT DEFINED GIT_VERSION) | ||
set(GIT_VERSION 0.0.0-unknown) | ||
message(WARNING "Failed to determine version from Git tags. Using default version \"${GIT_VERSION}\".") | ||
endif() | ||
|
||
configure_file( | ||
${CMAKE_SOURCE_DIR}/limereport/version.h.in | ||
${CMAKE_BINARY_DIR}/limereport/version.h | ||
@ONLY) | ||
|
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
// git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$ | ||
|
||
#ifdef GIT_ARCHIVE | ||
#define LIMEREPORT_VERSION_STR "$Format:%(describe:tags=true)$" | ||
#else | ||
#define LIMEREPORT_VERSION_STR "@GIT_VERSION@" | ||
#endif |