|
| 1 | +/*---------------------------------------------------------------------------*\ |
| 2 | +------------------------------------------------------------------------------- |
| 3 | + Copyright (C) 2023 Oak Ridge National Laboratory |
| 4 | +------------------------------------------------------------------------------- |
| 5 | +
|
| 6 | +Class |
| 7 | + Foam::AdditiveFoamInfo |
| 8 | +
|
| 9 | +Description |
| 10 | + Outputs version and build information for AdditiveFOAM. |
| 11 | +
|
| 12 | +\*---------------------------------------------------------------------------*/ |
| 13 | + |
| 14 | +#ifndef AdditiveFoamInfo_H |
| 15 | +#define AdditiveFoamInfo_H |
| 16 | + |
| 17 | +#include "OSspecific.H" |
| 18 | + |
| 19 | +#ifdef GIT_MODULE_ENABLED |
| 20 | + #include "Make/gitInfo.H" |
| 21 | +#endif |
| 22 | + |
| 23 | +// Static version |
| 24 | +#define ADDITIVEFOAM_VERSION "1.1.0-dev" |
| 25 | + |
| 26 | +namespace Foam |
| 27 | +{ |
| 28 | + |
| 29 | +class AdditiveFoamInfo |
| 30 | +{ |
| 31 | +public: |
| 32 | + |
| 33 | + //- Disallow default construction, copy, assignment, and destruction |
| 34 | + AdditiveFoamInfo() = delete; |
| 35 | + ~AdditiveFoamInfo() = delete; |
| 36 | + AdditiveFoamInfo(const AdditiveFoamInfo&) = delete; |
| 37 | + AdditiveFoamInfo& operator=(const AdditiveFoamInfo&) = delete; |
| 38 | + |
| 39 | + //- Print version/build information to Info stream |
| 40 | + static void write() |
| 41 | + { |
| 42 | + Info<< "AdditiveFOAM Information:" << nl; |
| 43 | + Info<< "Version: " << ADDITIVEFOAM_VERSION << nl; |
| 44 | + |
| 45 | + //- Print git describe and SHA1 (optional) |
| 46 | + #ifdef ADDITIVEFOAM_GIT_DESCRIBE |
| 47 | + Info<< "Build: " << ADDITIVEFOAM_GIT_DESCRIBE << nl; |
| 48 | + #endif |
| 49 | + |
| 50 | + #ifdef ADDITIVEFOAM_GIT_SHA1 |
| 51 | + Info<< "Git SHA1: " << ADDITIVEFOAM_GIT_SHA1 << nl; |
| 52 | + #endif |
| 53 | + |
| 54 | + Info<< endl; |
| 55 | + } |
| 56 | +}; |
| 57 | + |
| 58 | +} // End namespace Foam |
| 59 | + |
| 60 | +#endif |
| 61 | + |
| 62 | +// ************************************************************************* // |
| 63 | + |
0 commit comments