// This file is a template that is processed by shell commands during
// the make process. Be very cautious about changing the parts in the
// first namespace block since the shell commands are fairly simple
// and can be confused by altering even one character in this section.
#include <casacore/casa/Exceptions/Error.h>
#include <stdcasa/version.h>
using casacore::AipsError;
static int environ_version( const char *evar ) {
char *cstr = getenv(evar);
bool alldigits = accumulate( val.begin(), val.end(), true,
[=](bool sum, char c){return sum && isdigit(c);} );
if ( alldigits ) return stoi(val);
int VersionInfo::major( ) {
static bool initialized = false;
if ( initialized == false ) {
version = environ_version("CASA_VERSION_MAJOR");
return version > 0 ? version : @CASA_VERSION_MAJOR@;
int VersionInfo::minor( ) {
static bool initialized = false;
if ( initialized == false ) {
version = environ_version("CASA_VERSION_MINOR");
return version > 0 ? version : @CASA_VERSION_MINOR@;
int VersionInfo::patch( ) {
static bool initialized = false;
if ( initialized == false ) {
version = environ_version("CASA_VERSION_PATCH");
return version > 0 ? version : @CASA_VERSION_PATCH@;