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.
| 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. |
| 321 | static 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. |
no test coverage detected