77 * For a full list of authors see the git log.
88 */
99
10+ #include "format.hpp"
11+ #include "reprojection.hpp"
1012#include "version.hpp"
1113
14+ #include <osmium/version.hpp>
15+
16+ #include <lua.hpp>
17+
18+ #include <nlohmann/json.hpp>
19+
1220char const *get_build_type() noexcept
1321{
1422 return "@CMAKE_BUILD_TYPE@";
@@ -34,3 +42,18 @@ uint32_t get_minimum_postgresql_server_version_num() noexcept
3442 return @MINIMUM_POSTGRESQL_SERVER_VERSION_NUM@;
3543}
3644
45+ void print_version(std::string const &command)
46+ {
47+ fmt::print(stderr, "{} version {}\n", command, get_osm2pgsql_version());
48+ fmt::print(stderr, "Build: {}\n", get_build_type());
49+ fmt::print(stderr, "Compiled using the following library versions:\n");
50+ fmt::print(stderr, "Libosmium {}\n", LIBOSMIUM_VERSION_STRING);
51+ fmt::print(stderr, "Proj {}\n", get_proj_version());
52+ fmt::print(stderr, "nlohmann JSON {}.{}.{}\n", NLOHMANN_JSON_VERSION_MAJOR,
53+ NLOHMANN_JSON_VERSION_MINOR, NLOHMANN_JSON_VERSION_PATCH);
54+ #ifdef HAVE_LUAJIT
55+ fmt::print(stderr, "{} ({})\n", LUA_RELEASE, LUAJIT_VERSION);
56+ #else
57+ fmt::print(stderr, "{}\n", LUA_RELEASE);
58+ #endif
59+ }
0 commit comments