[proj] PROJ package sets invalid locaiton for proj.db in debug installation
@jimwang118 is already working on this.
Since Feb 20, 2024.
- Dominant language
- CMake
- Stars
- 27.5k
- Forks
- 7.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 321
Description
Describe the bug
PROJ package sets invalid locaiton for proj.db in debug mode. The PROJ_LIB variable (presumably controlled by CMake) is set to a location that doesn't exist in the debug installation of the library,
pj_obj_create: Cannot find proj.db
pj_obj_create: Cannot find proj.db
proj_create_operation_factory_context: Cannot find proj.db
proj_create_operations: source_crs is not a CRS
In filemanager.cpp, theres the lines:
static const char *proj_lib_name =
#ifdef PROJ_LIB
PROJ_LIB;
#else
nullptr;
#endif
in my project PROJ_LIB is "/home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/debug/share/proj4", something set during the installation process. The problem with this directory, is that no such directory actually exists, there's only one directory inside:
/home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/debug
and it's lib (which houses the static library). That doesn't mean, however, share and proj.db doesn't exist, it actually does, but in a separate sister directory:
/home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/share/proj4
and in this directory is where proj.db exists.
Environment
- x64-linux, centos 7
- GCC 8, devtoolset 8
To Reproduce
Steps to reproduce the behavior:
- ./vcpkg install proj
- See error
Repro code when
#include <proj.h>
int main(){
auto proj_context = proj_context_create();
auto proj_example = proj_create(proj_context, "+proj=latlong +ellps=WGS84 +datum=WGS84");
proj_destroy(proj_example);
proj_context_destroy(proj_context);
return 0;
}
Expected behavior
PROJ_LIB should be set to /home/user/Documents/projects/vcpkg/packages/proj4_x64-linux/share/proj4
Failure logs
N/A
Additional context
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.