pmt: Improvement.

- At build time, the version, compile time, CMake version, compiler version, and compiler flags are retrieved with the new CMake module and a header is created. This header provides more robust version management and notifications.
- Build warnings fixed, code corrected for compilation.
- Improvements were made to CMake code.
- Modifications were made to the tests to read the library's version information.
This commit is contained in:
2025-07-23 18:44:06 +03:00
parent 424d651ce3
commit d907ee9447
13 changed files with 94 additions and 35 deletions

View File

@@ -24,6 +24,7 @@
#include <time.h>
#include <libgen.h>
#include <libhelper/lib.hpp>
#include <generated/buildInfo.hpp>
namespace Helper {
@@ -130,11 +131,9 @@ std::string pathDirname(const std::string_view entry)
std::string getLibVersion()
{
return std::string(
std::to_string(LIBHELPER_MAJOR) + "."
+ std::to_string(LIBHELPER_MINOR) + "."
+ std::to_string(LIBHELPER_PATCH)
);
char vinfo[512];
sprintf(vinfo, "libhelper %s [%s %s]\nBuildType: %s\nCMakeVersion: %s\nCompilerVersion: %s\nBuildFlags: %s\n", BUILD_VERSION, BUILD_DATE, BUILD_TIME, BUILD_TYPE, BUILD_CMAKE_VERSION, BUILD_COMPILER_VERSION, BUILD_FLAGS);
return std::string(vinfo);
}
} // namespace Helper