Skip to content

Commit

Permalink
Re #7321. Unified mantid version and added extra git attr.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Aug 15, 2013
1 parent 373cd34 commit a8667fa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/Framework/Kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ add_subdirectory ( test )
# determine it from git and the file already exists. This makes sure the
# version number is correct when building off the source tarball

include (PatchVersionNumber)
if ( NOT NOT_GIT_REPO OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp )
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp.in
${CMAKE_CURRENT_SOURCE_DIR}/src/MantidVersion.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class MANTID_KERNEL_DLL MantidVersion
public:
static const char* version(); ///< The full version number
static const char* revision(); ///< The abbreviated SHA-1 of the last commit
static const char* revisionFull(); ///< The full SHA-1 of the last commit
static const char* releaseDate(); ///< The date of the last commit

private:
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/Kernel/src/ConfigService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace Mantid
*/
std::string welcomeMessage()
{
return "Welcome to Mantid " + std::string(Mantid::Kernel::MantidVersion::version()) + " - Manipulation and Analysis Toolkit for Instrument Data";
return "Welcome to Mantid version " + std::string(Mantid::Kernel::MantidVersion::version()) + " - Manipulation and Analysis Toolkit for Instrument Data";
}

namespace Kernel
Expand Down Expand Up @@ -264,8 +264,8 @@ ConfigServiceImpl::ConfigServiceImpl() :
g_log.debug() << "ConfigService created." << std::endl;
g_log.debug() << "Configured Mantid.properties directory of application as " << getPropertiesDir()
<< std::endl;
g_log.information() << "This is Mantid Version "
<< MantidVersion::version() << "-" << MantidVersion::revision() << std::endl;
g_log.information() << "This is Mantid version "
<< MantidVersion::version() << " revision " << MantidVersion::revision() << std::endl;
g_log.information() << "Properties file(s) loaded: " << propertiesFilesList << std::endl;
#ifndef MPI_BUILD // There is no logging to file by default in MPI build
g_log.information() << "Logging to: " << m_logFilePath << std::endl;
Expand Down
7 changes: 6 additions & 1 deletion Code/Mantid/Framework/Kernel/src/MantidVersion.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ const char* MantidVersion::version()
{
// The major and minor version numbers are specified in Build/CMake/VersionNumber.cmake
// The patch number is the number of commits since the most recent tag of the repository
return "@VERSION_MAJOR@.@VERSION_MINOR@.@MtdVersion_WC_LAST_CHANGED_REV@";
return "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@";
}

const char* MantidVersion::revision()
{
return "@MtdVersion_WC_LAST_CHANGED_SHA@";
}

const char* MantidVersion::revisionFull()
{
return "@MtdVersion_WC_LAST_CHANGED_SHA_LONG@";
}

const char* MantidVersion::releaseDate()
{
return "@MtdVersion_WC_LAST_CHANGED_DATE@";
Expand Down

0 comments on commit a8667fa

Please sign in to comment.