Distinguish between release and development builds

actorid
pvdk 11 years ago
parent d92ded3bcd
commit 19bef4fce8

@ -20,23 +20,24 @@ include(OpenMWMacros)
include(GetGitRevisionDescription) include(GetGitRevisionDescription)
get_git_tag_revision(taghash --tags --max-count=1) get_git_tag_revision(TAGHASH --tags --max-count=1)
get_git_head_revision(refspec commithash) get_git_head_revision(REFSPEC COMMITHASH)
git_describe(version --tags ${taghash}) git_describe(VERSION --tags ${TAGHASH})
string(REGEX MATCH "^openmw-[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" match "${version}") string(REGEX MATCH "^openmw-[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" MATCH "${VERSION}")
if (match) if (MATCH)
string(REGEX REPLACE "^openmw-([0-9]+)\\..*" "\\1" OPENMW_VERSION_MAJOR "${version}") string(REGEX REPLACE "^openmw-([0-9]+)\\..*" "\\1" OPENMW_VERSION_MAJOR "${VERSION}")
string(REGEX REPLACE "^openmw-[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_MINOR "${version}") string(REGEX REPLACE "^openmw-[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_MINOR "${VERSION}")
string(REGEX REPLACE "^openmw-[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_RELEASE "${version}") string(REGEX REPLACE "^openmw-[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_RELEASE "${VERSION}")
set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}") set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}")
set(OPENMW_VERSION_COMMIT "${commithash}") set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}")
set(OPENMW_VERSION_TAGHASH "${TAGHASH}")
message(STATUS "Configuring OpenMW ${OPENMW_VERSION}...") message(STATUS "Configuring OpenMW ${OPENMW_VERSION}...")
else (match) else (MATCH)
message(FATAL_ERROR "Failed to get valid version information from Git") message(FATAL_ERROR "Failed to get valid version information from Git")
endif (match) endif (MATCH)
# doxygen main page # doxygen main page

@ -73,13 +73,19 @@ Launcher::MainDialog::MainDialog(QWidget *parent)
setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
// Add version information to bottom of the window // Add version information to bottom of the window
QString revision(OPENMW_VERSION_COMMIT); QString revision(OPENMW_VERSION_COMMITHASH);
revision = revision.left(10); QString tag(OPENMW_VERSION_TAGHASH);
if (revision == tag) {
versionLabel->setText(tr("OpenMW %0 release").arg(OPENMW_VERSION));
} else {
versionLabel->setText(tr("OpenMW unstable, revision %0").arg(revision.left(10)));
}
// Add the compile date and time
QDate date(QDate::fromString(__DATE__, QLatin1String("MMM dd yyyy"))); QDate date(QDate::fromString(__DATE__, QLatin1String("MMM dd yyyy")));
QTime time(QTime::fromString(__TIME__, QLatin1String("hh:m:ss"))); QTime time(QTime::fromString(__TIME__, QLatin1String("hh:m:ss")));
versionLabel->setText(tr("OpenMW %0 revision %1").arg(OPENMW_VERSION, revision));
versionLabel->setToolTip(tr("Compiled on %0 %1").arg(date.toString(Qt::SystemLocaleShortDate), versionLabel->setToolTip(tr("Compiled on %0 %1").arg(date.toString(Qt::SystemLocaleShortDate),
time.toString(Qt::SystemLocaleShortDate))); time.toString(Qt::SystemLocaleShortDate)));

@ -6,7 +6,8 @@
#define OPENMW_VERSION_RELEASE @OPENMW_VERSION_RELEASE@ #define OPENMW_VERSION_RELEASE @OPENMW_VERSION_RELEASE@
#define OPENMW_VERSION "@OPENMW_VERSION@" #define OPENMW_VERSION "@OPENMW_VERSION@"
#define OPENMW_VERSION_COMMIT "@OPENMW_VERSION_COMMIT@" #define OPENMW_VERSION_COMMITHASH "@OPENMW_VERSION_COMMITHASH@"
#define OPENMW_VERSION_TAGHASH "@OPENMW_VERSION_TAGHASH@"
#endif // VERSION_HPP #endif // VERSION_HPP

Loading…
Cancel
Save