Version CNA-free

Easy3D / Reference / Version

<Easy3D/Version.hpp> provides compile-time and run-time version information for Easy3D. It is completely CNA-free — usable from any build configuration.

#include <Easy3D/Version.hpp>

Preprocessor macros

MacroCurrent value
EASY3D_VERSION_MAJOR0
EASY3D_VERSION_MINOR1
EASY3D_VERSION_PATCH0

Constants and functions

inline constexpr int VersionMajor / VersionMinor / VersionPatch
The version components as constexpr int values, mirroring the macros.
inline constexpr int VersionNumber() noexcept
A single comparable integer: major * 10000 + minor * 100 + patch. For 0.1.0 this is 100. Usable in static_assert and #if-style feature gates.
const char* VersionString() noexcept
Human-readable version string, e.g. "0.1.0". Defined in Version.cpp — a run-time function, but it does not require linking CNA.

Example

#include <Easy3D/Version.hpp>
#include <iostream>

static_assert(Easy3D::VersionNumber() >= 100, "Easy3D 0.1.0 or newer required");

int main()
{
    std::cout << "Easy3D " << Easy3D::VersionString() << "\n";   // Easy3D 0.1.0
}
The library's CMake project version (project(easy3d VERSION 0.1.0)) is kept in sync with these macros.