MCPcopy Create free account
hub / github.com/LAStools/LAStools / checkProjMajorVersion

Function checkProjMajorVersion

src/proj_loader.cpp:321–342  ·  view source on GitHub ↗

Checks the major PROJ version based on the loaded library filename >= 9. The version is extracted from the library name as a fallback, since the PROJ C-API version query cannot be used safely without ABI guarantees.

Source from the content-addressed store, hash-verified

319/// The version is extracted from the library name as a fallback, since the PROJ C-API version query
320/// cannot be used safely without ABI guarantees.
321static void checkProjMajorVersion(const std::string& loadedProjLibPath) {
322 std::filesystem::path proj(loadedProjLibPath);
323 std::string name = proj.filename().string();
324
325 std::vector<int> versions = parseVersion(name);
326 int major = -1;
327
328 if (!versions.empty()) {
329 // In libproj.so filenames, the PROJ major version is usually in the second position.
330 if (name.rfind("libproj.so.", 0) == 0 && versions.size() > 1) {
331 major = versions[1];
332 } else {
333 major = versions[0];
334 }
335 }
336
337 if (major < 0) {
338 LASMessage(LAS_WARNING, "The loaded PROJ version could not be determined from library name '%s'", name.c_str());
339 } else if (major < 9) {
340 LASMessage(LAS_WARNING, "The loaded PROJ version (major %d) is older than version 9.0.0. Full functionality cannot be guaranteed with this version.", major);
341 }
342}
343
344/// Finds the latest QGIS installation path by first checking the `QGIS_PREFIX_PATH` environment variable.
345/// If the environment variable is not set, it searches through default installation directories and selects the latest version based on directory names.

Callers 1

load_proj_libraryFunction · 0.85

Calls 5

parseVersionFunction · 0.85
LASMessageFunction · 0.85
emptyMethod · 0.80
stringMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected