Newer
Older
Russell Taylor
committed
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/MantidVersion.h"
#include <sstream>
#include <boost/lexical_cast.hpp>
Russell Taylor
committed
namespace Mantid
{
namespace Kernel
{
const char* MantidVersion::version()
{
Russell Taylor
committed
// 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@.@VERSION_PATCH@";
Russell Taylor
committed
}
const char* MantidVersion::revision()
{
Russell Taylor
committed
return "@MtdVersion_WC_LAST_CHANGED_SHA@";
const char* MantidVersion::revisionFull()
{
return "@MtdVersion_WC_LAST_CHANGED_SHA_LONG@";
}
Russell Taylor
committed
const char* MantidVersion::releaseDate()
{
return "@MtdVersion_WC_LAST_CHANGED_DATE@";
}
const char* MantidVersion::mainDOI()
{
return "http://dx.doi.org/10.5286/Software/Mantid";
}
std::string MantidVersion::releaseDOI()
{
int patchVersion;
try
{
patchVersion = boost::lexical_cast<int>(@MtdVersion_WC_LAST_CHANGED_REV@);
}
catch(boost::bad_lexical_cast &)
{
patchVersion = 0;
}
std::stringstream doi;
doi << mainDOI() << "@VERSION_MAJOR@.@VERSION_MINOR@";
if( patchVersion != 0 )
doi << "." << patchVersion;
return doi.str();
}
Russell Taylor
committed
} // namespace Kernel
} // namespace Mantid